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

Per-channel dispatch state. More...

#include <ra8_sci_internal.h>

Data Fields

ra8_sci_rx_fn_t rx_fn
 Attached RX handler, NULL if none.
void * rx_ctx
 RX handler context.
ra8_sci_tx_fn_t tx_fn
 Attached TX handler, NULL if none.
void * tx_ctx
 TX handler context.
bool initialized
 True after ra8_sci_init.
const uint8_t * tx_buf
 Source buffer, NULL when idle.
uint32_t tx_len
 Total bytes requested.
uint32_t tx_idx
 Next byte index to push.
uint8_t * rx_buf
 Destination buffer, NULL when idle.
uint32_t rx_len
 Total bytes requested.
uint32_t rx_idx
 Next byte index to write.

Detailed Description

Per-channel dispatch state.

Holds both the user-attached callback and the byte-stream state that backs ra8_sci_write / ra8_sci_read. The byte-stream fields (tx_buf / tx_len / tx_idx / rx_buf / rx_len / rx_idx) describe the in-flight async transfer: tx_idx and rx_idx advance from 0 toward the matching *_len as TXI / RXI fire. A direction is "idle" when its *_len is zero; that is the sentinel checked by ra8_sci_abort and ra8_sci_read_stop.

Invariant
tx_idx <= tx_len and rx_idx <= rx_len at all times.
See also
s_sci_state
Since
0.1.0

Definition at line 72 of file ra8_sci_internal.h.

Field Documentation

◆ initialized

bool ra8_sci_state_t::initialized

True after ra8_sci_init.

Definition at line 77 of file ra8_sci_internal.h.

◆ rx_buf

uint8_t* ra8_sci_state_t::rx_buf

Destination buffer, NULL when idle.

Definition at line 83 of file ra8_sci_internal.h.

◆ rx_ctx

void* ra8_sci_state_t::rx_ctx

RX handler context.

Definition at line 74 of file ra8_sci_internal.h.

◆ rx_fn

ra8_sci_rx_fn_t ra8_sci_state_t::rx_fn

Attached RX handler, NULL if none.

Definition at line 73 of file ra8_sci_internal.h.

◆ rx_idx

uint32_t ra8_sci_state_t::rx_idx

Next byte index to write.

Definition at line 85 of file ra8_sci_internal.h.

◆ rx_len

uint32_t ra8_sci_state_t::rx_len

Total bytes requested.

0 = idle.

Definition at line 84 of file ra8_sci_internal.h.

◆ tx_buf

const uint8_t* ra8_sci_state_t::tx_buf

Source buffer, NULL when idle.

Definition at line 79 of file ra8_sci_internal.h.

◆ tx_ctx

void* ra8_sci_state_t::tx_ctx

TX handler context.

Definition at line 76 of file ra8_sci_internal.h.

◆ tx_fn

ra8_sci_tx_fn_t ra8_sci_state_t::tx_fn

Attached TX handler, NULL if none.

Definition at line 75 of file ra8_sci_internal.h.

◆ tx_idx

uint32_t ra8_sci_state_t::tx_idx

Next byte index to push.

Definition at line 81 of file ra8_sci_internal.h.

◆ tx_len

uint32_t ra8_sci_state_t::tx_len

Total bytes requested.

0 = idle.

Definition at line 80 of file ra8_sci_internal.h.


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