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

Byte-level transport injected into the AT driver (DIP). More...

#include <ra8_modem_at.h>

Data Fields

ra8_err_t(* tx_byte )(void *ctx, uint8_t byte)
 Transmit a single byte (blocking).
ra8_err_t(* rx_byte )(void *ctx, uint8_t *out_byte)
 Try to receive a single byte without blocking.
uint32_t(* now_ms )(void *ctx)
 Return monotonic time in milliseconds.
void * ctx
 Opaque context passed to tx_byte/rx_byte/now_ms.

Detailed Description

Byte-level transport injected into the AT driver (DIP).

Decouples the AT layer from any concrete UART implementation. The production wiring binds these pointers to an ra8_uart-backed adapter; unit tests bind them to an in-memory FIFO. Function pointers here are explicitly permitted by the project's NASA Rule 9 deviation for Dependency Inversion.

Invariant
All three function pointers must be non-NULL.
See also
ra8_modem_at_init()

Definition at line 109 of file ra8_modem_at.h.

Field Documentation

◆ ctx

void* ra8_modem_at_io_t::ctx

Opaque context passed to tx_byte/rx_byte/now_ms.

Definition at line 144 of file ra8_modem_at.h.

◆ now_ms

uint32_t(* ra8_modem_at_io_t::now_ms) (void *ctx)

Return monotonic time in milliseconds.

Used to enforce per-command timeouts. The timebase need only be monotonic; absolute epoch is irrelevant.

Parameters
[in]ctxOpaque transport context.
Returns
Milliseconds since some fixed reference point.

Definition at line 139 of file ra8_modem_at.h.

Referenced by internal_validate_init_cfg().

◆ rx_byte

ra8_err_t(* ra8_modem_at_io_t::rx_byte) (void *ctx, uint8_t *out_byte)

Try to receive a single byte without blocking.

Parameters
[in]ctxOpaque transport context.
[out]out_byteReceive slot, only written on success.
Returns
k_ra8_ok if a byte was popped, k_ra8_err_no_data if the RX FIFO is empty.

Definition at line 127 of file ra8_modem_at.h.

Referenced by internal_validate_init_cfg().

◆ tx_byte

ra8_err_t(* ra8_modem_at_io_t::tx_byte) (void *ctx, uint8_t byte)

Transmit a single byte (blocking).

Parameters
[in]ctxOpaque transport context (e.g. SCI channel).
[in]byteByte to send.
Returns
k_ra8_ok on success, ra8_err_t otherwise.

Definition at line 117 of file ra8_modem_at.h.

Referenced by internal_validate_init_cfg().


The documentation for this struct was generated from the following file: