|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ra8_io byte-stream sink that buffers into a raw block device. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_io_stream_blockdev_state_t |
| Caller-owned private state for a block-device stream sink. More... | |
Functions | |
| ra8_err_t | ra8_io_stream_blockdev_init (ra8_io_stream_t *s, ra8_io_stream_blockdev_state_t *state, const ra8_io_blockdev_t *bd, uint32_t start_lba) |
| Bind a block-device stream sink into a caller-owned stream handle. | |
ra8_io byte-stream sink that buffers into a raw block device.
Block devices are sector-granular, so a byte stream must accumulate a 512-byte sector and flush it. This sink writes consecutive logical blocks of an ra8_io_blockdev_t starting at a chosen LBA: bytes fill an internal sector buffer; a full sector is committed automatically; ra8_io_stream_flush commits any partial trailing sector (zero-padded). Useful for streaming a log or a blob straight onto SD / OSPI / MRAM via the fabric without a filesystem.
Definition in file ra8_io_stream_blockdev.h.
|
nodiscard |
Bind a block-device stream sink into a caller-owned stream handle.
| [out] | s | Stream handle to bind (zero-initialised by the caller). |
| [out] | state | Caller-owned sink state to populate. |
| [in] | bd | Bound block device to stream into. |
| [in] | start_lba | First logical block address to write. |
| k_ra8_ok | Sink bound; s is usable. |
| k_ra8_err_null_ptr | s, state, or bd was NULL. |
Definition at line 247 of file ra8_io_stream_blockdev.c.
References ra8_io_stream_blockdev_state_t::bd, ra8_io_stream_blockdev_state_t::fill, ra8_io_stream_blockdev_state_t::lba, RA8_CHECK_NULL_PTR, ra8_io_stream_bind(), s_bd_iface, and s_tag.