|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ra8_io byte-stream sink over a caller-owned RAM buffer. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_io_stream_ram_state_t |
| Caller-owned private state for a RAM stream sink. More... | |
Functions | |
| ra8_err_t | ra8_io_stream_ram_init (ra8_io_stream_t *s, ra8_io_stream_ram_state_t *state, uint8_t *buf, uint32_t cap) |
| Bind a RAM stream sink into a caller-owned stream handle. | |
| ra8_err_t | ra8_io_stream_ram_used (const ra8_io_stream_ram_state_t *state, uint32_t *out_used) |
| Report how many bytes have been captured into the RAM sink. | |
ra8_io byte-stream sink over a caller-owned RAM buffer.
Appends written bytes into a fixed caller-owned buffer until it is full, then reports k_ra8_err_no_mem. Useful as a capture buffer for tests, an in-memory log ring, or staging bytes before a bulk transfer. Host-friendly: pure memory.
Definition in file ra8_io_stream_ram.h.
|
nodiscard |
Bind a RAM 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] | buf | Capture buffer of cap bytes. |
| [in] | cap | Buffer capacity in bytes (>= 1). |
| k_ra8_ok | Sink bound; s is usable. |
| k_ra8_err_null_ptr | s, state, or buf was NULL. |
| k_ra8_err_invalid_size | cap was zero. |
Definition at line 80 of file ra8_io_stream_ram.c.
References ra8_io_stream_ram_state_t::buf, ra8_io_stream_ram_state_t::cap, k_ra8_err_invalid_size, ra8_io_stream_ram_state_t::len, RA8_CHECK_NULL_PTR, ra8_io_stream_bind(), s_ram_iface, and s_tag.
Referenced by main().
|
nodiscard |
Report how many bytes have been captured into the RAM sink.
| [in] | state | Bound RAM sink state. |
| [out] | out_used | Number of captured bytes. |
| k_ra8_ok | *out_used populated. |
| k_ra8_err_null_ptr | state or out_used was NULL. |
Definition at line 97 of file ra8_io_stream_ram.c.
References k_ra8_ok, ra8_io_stream_ram_state_t::len, RA8_CHECK_NULL_PTR, and s_tag.
Referenced by internal_swap_replay_capture().