ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_io_stream_backend.h
Go to the documentation of this file.
1
20
21#pragma once
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <stdint.h>
28
29#include "ra8_err.h"
30#include "ra8_io_stream.h"
31
50 ra8_err_t (*write)(void* ctx, const uint8_t* buf, uint32_t len, uint32_t* out_written);
51
53 ra8_err_t (*flush)(void* ctx);
54};
55
72[[nodiscard]] ra8_err_t
73ra8_io_stream_bind(ra8_io_stream_t* stream, const ra8_io_stream_iface_t* iface, void* context);
74
75#ifdef __cplusplus
76}
77#endif
-proof
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_io targetable byte-stream facade – one writer, many destinations.
struct ra8_io_stream_iface ra8_io_stream_iface_t
ra8_err_t ra8_io_stream_bind(ra8_io_stream_t *stream, const ra8_io_stream_iface_t *iface, void *context)
Bind a backend vtable and caller-owned state into a stream handle.
Opaque to stream users; backend implementers use the public backend contract in ra8_io_stream_backend...
ra8_err_t(* flush)(void *ctx)
Commit any buffering.
Caller-allocated byte-stream handle binding a sink to its context.