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

Driver-owned completion context for an RX DMA, used to bridge the cache-invalidate step onto the caller's completion callback. More...

Data Fields

void * rx_buf
 Caller RX buffer to invalidate.
uint16_t rx_len
 RX byte count (pre-rounding).
ra8_dma_complete_fn_t user_on_complete
 Caller callback (may be NULL).
void * user_ctx
 Caller callback context.

Detailed Description

Driver-owned completion context for an RX DMA, used to bridge the cache-invalidate step onto the caller's completion callback.

The RX DMA writes the caller's out_buf directly to memory. With the Cortex-M85 L1 D-cache enabled the CPU would otherwise read stale cached lines, so the buffer must be invalidated once the transfer is known complete. The substrate's only "known-complete" signal in this asynchronous model is the transfer-end completion callback, so this driver installs its own wrapper (internal_spi_dma_rx_complete) as req.on_complete and stashes the original caller callback / context / buffer here. The wrapper invalidates the buffer first, then chains to the caller's callback.

Invariant
Indexed by SPI channel; at most one RX DMA is in flight per channel (the channel owns a single SPDR FIFO front-end).
See also
internal_spi_dma_rx_complete

Definition at line 107 of file ra8_spi_b_dma.c.

Field Documentation

◆ rx_buf

void* ra8_spi_dma_rx_ctx_t::rx_buf

Caller RX buffer to invalidate.

Definition at line 108 of file ra8_spi_b_dma.c.

Referenced by internal_spi_dma_rx_complete(), and ra8_spi_read_dma().

◆ rx_len

uint16_t ra8_spi_dma_rx_ctx_t::rx_len

RX byte count (pre-rounding).

Definition at line 109 of file ra8_spi_b_dma.c.

Referenced by internal_spi_dma_rx_complete(), and ra8_spi_read_dma().

◆ user_ctx

void* ra8_spi_dma_rx_ctx_t::user_ctx

Caller callback context.

Definition at line 111 of file ra8_spi_b_dma.c.

Referenced by internal_spi_dma_rx_complete(), and ra8_spi_read_dma().

◆ user_on_complete

ra8_dma_complete_fn_t ra8_spi_dma_rx_ctx_t::user_on_complete

Caller callback (may be NULL).

Definition at line 110 of file ra8_spi_b_dma.c.

Referenced by internal_spi_dma_rx_complete(), and ra8_spi_read_dma().


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