ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_io_stream_uart.h File Reference

ra8_io byte-stream sink over a UART/SCI channel. More...

#include <stdint.h>
#include "ra8_err.h"
#include "ra8_io_stream.h"
Include dependency graph for ra8_io_stream_uart.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_io_stream_uart_state_t
 Caller-owned private state for a UART stream sink. More...

Functions

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.

Detailed Description

ra8_io byte-stream sink over a UART/SCI channel.

Tag
[Ring 4 / PAL] {World: NS}

Streams bytes out of an ra8_sci channel by polling – the "print to the host over the serial console" target. The application must have brought the channel up with ra8_sci_init first. The data path is exercised on ra8_emulator / HIL; on the host this sink binds and validates only.

Since
0.1.0

Definition in file ra8_io_stream_uart.h.

Function Documentation

◆ ra8_io_stream_uart_init()

ra8_err_t ra8_io_stream_uart_init ( ra8_io_stream_t * s,
ra8_io_stream_uart_state_t * state,
uint8_t channel )
nodiscard

Bind a UART stream sink into a caller-owned stream handle.

Parameters
[out]sStream handle to bind (zero-initialised by the caller).
[out]stateCaller-owned sink state to populate.
[in]channelSCI channel index to write to.
Returns
ra8_err_t Error code.
Return values
k_ra8_okSink bound; s is usable.
k_ra8_err_null_ptrs or state was NULL.
Precondition
The SCI channel has been initialised with ra8_sci_init.
s and state out-live every call made through the stream.
Postcondition
On success s writes bytes out of channel.
On any non-ok return s and state are left unbound/untouched.
Note
Not thread-safe with respect to the same stream.
Since
0.1.0

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().