|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Public implementer contract for ra8_io byte-stream backends. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_io_stream_iface |
| Opaque to stream users; backend implementers use the public backend contract in ra8_io_stream_backend.h. More... | |
Functions | |
| 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. | |
Public implementer contract for ra8_io byte-stream backends.
Defines the narrow backend vtable and binding helper needed by an out-of-tree or platform adapter. Consumers continue to include only ra8_io_stream.h; implementers include this header, define one immutable vtable, and bind it to caller-owned state. Publishing this seam prevents a POSIX, RTOS, or board adapter from reaching into a sibling library's private src/ directory.
Definition in file ra8_io_stream_backend.h.
|
nodiscard |
Bind a backend vtable and caller-owned state into a stream handle.
| [out] | stream | Stream handle to initialize. |
| [in] | iface | Immutable backend operations. |
| [in,out] | context | Backend-owned state retained by the handle. |
| k_ra8_ok | The handle is bound and ready. |
| k_ra8_err_null_ptr | A required pointer is null. |
| k_ra8_err_invalid_arg | The mandatory write operation is absent. |
iface and context outlive every operation through stream. stream while binding it. stream with the requested binding. stream unchanged. Definition at line 81 of file ra8_io_stream.c.
References k_ra8_err_invalid_arg, k_ra8_err_null_ptr, k_ra8_ok, and ra8_io_stream_iface::write.
Referenced by ra8_io_stream_blockdev_init(), ra8_io_stream_posix_init(), ra8_io_stream_ram_init(), ra8_io_stream_uart_init(), and ra8_io_stream_usbcdc_init().