|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
UART/SCI byte-stream sink – polled writes through ra8_sci. More...
#include "ra8_io_stream_uart.h"#include <stdint.h>#include "ra8_attributes.h"#include "ra8_check.h"#include "ra8_err.h"#include "ra8_io_stream_backend.h"#include "ra8_sci.h"Go to the source code of this file.
Functions | |
| static ra8_err_t | internal_uart_write (void *ctx, const uint8_t *buf, uint32_t len, uint32_t *out_written) |
| UART sink: write all bytes out of the SCI channel by polling. | |
| static ra8_err_t | internal_uart_flush (void *ctx) |
| UART sink: drain the SCI transmit shift register. | |
| ra8_err_t | ra8_io_stream_uart_init (ra8_io_stream_t *s, ra8_io_stream_uart_state_t *state, uint8_t channel) |
| Bind a UART stream sink into a caller-owned stream handle. | |
Variables | |
| static const char *const | s_tag = "ra8_io_stream_uart" |
| Module log tag. | |
| static const ra8_io_stream_iface_t | s_uart_iface |
| UART stream sink vtable. | |
UART/SCI byte-stream sink – polled writes through ra8_sci.
Thin wrapper binding ra8_io_stream_iface to ra8_sci_write_polling / ra8_sci_flush. Touches no raw MMIO – the ra8_sci driver owns the HUM citations.
Definition in file ra8_io_stream_uart.c.
|
static |
UART sink: drain the SCI transmit shift register.
Forwards to ra8_sci_flush so a caller can guarantee the line is on the wire before sleeping or asserting a panic.
| [in] | ctx | UART sink state (as a void cookie). |
| k_ra8_ok | Transmit drained. |
| k_ra8_err_null_ptr | ctx was NULL. |
| k_ra8_err_* | Propagated from ra8_sci_flush. |
Definition at line 95 of file ra8_io_stream_uart.c.
References ra8_io_stream_uart_state_t::channel, RA8_CHECK_NULL_PTR, RA8_INTERNAL, ra8_sci_flush(), and s_tag.
|
static |
UART sink: write all bytes out of the SCI channel by polling.
Forwards to ra8_sci_write_polling. On success every byte was shifted out, so the accepted count equals len.
| [in] | ctx | UART sink state (as a void cookie). |
| [in] | buf | Source bytes. |
| [in] | len | Number of bytes to send. |
| [out] | out_written | Accepted byte count, or NULL. |
| k_ra8_ok | All bytes sent. |
| k_ra8_err_null_ptr | ctx or buf was NULL. |
| k_ra8_err_* | Propagated from ra8_sci_write_polling. |
Definition at line 57 of file ra8_io_stream_uart.c.
References ra8_io_stream_uart_state_t::channel, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_sci_write_polling(), and s_tag.
Referenced by priv_ra8_esp_hosted_osi_bind_absent().
|
nodiscard |
Bind a UART 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] | channel | SCI channel index to write to. |
| k_ra8_ok | Sink bound; s is usable. |
| k_ra8_err_null_ptr | s or state was NULL. |
Definition at line 109 of file ra8_io_stream_uart.c.
References ra8_io_stream_uart_state_t::channel, RA8_CHECK_NULL_PTR, ra8_io_stream_bind(), s_tag, and s_uart_iface.
Referenced by main(), and ra8_board_console_stream().
|
static |
Module log tag.
Definition at line 28 of file ra8_io_stream_uart.c.
|
static |
UART stream sink vtable.
Definition at line 103 of file ra8_io_stream_uart.c.
Referenced by ra8_io_stream_uart_init().