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

One SPI_B channel: register shadow + a single-frame echo engine. More...

Data Fields

uint32_t reg [k_spi_reg_words]
 Reflect-on-read register shadow.
uint32_t spsr
 SPSR flags (SPTEF / SPRF / ...).
uint32_t rx
 Receive holding register (echoed word).
bool enabled
 SPCR.SPE: channel is running.
bool loopback
 SPCR2.SPLP/SPLP2: internal rx = tx tie.
uint32_t frames
 Frames echoed through this channel.

Detailed Description

One SPI_B channel: register shadow + a single-frame echo engine.

The model owns the registers the polling driver actually touches; the rest of the window reflects writes through reg. enabled tracks SPCR.SPE so the status flags only report ready once the channel is running, loopback latches SPCR2.SPLP/SPLP2 (the internal tie the example arms), rx holds the most recently echoed word an SPDR read returns, and spsr carries the SPTEF / SPRF flags the driver waits on (cleared through SPSRC).

Definition at line 109 of file board_periph_spi.c.

Field Documentation

◆ enabled

bool spi_state_t::enabled

SPCR.SPE: channel is running.

Definition at line 113 of file board_periph_spi.c.

Referenced by internal_spi_spcr_write(), and internal_spi_spsrc_write().

◆ frames

uint32_t spi_state_t::frames

Frames echoed through this channel.

Definition at line 115 of file board_periph_spi.c.

Referenced by internal_spi_spdr_write().

◆ loopback

bool spi_state_t::loopback

SPCR2.SPLP/SPLP2: internal rx = tx tie.

Definition at line 114 of file board_periph_spi.c.

Referenced by internal_spi_spcr2_write(), and internal_spi_spdr_write().

◆ reg

uint32_t spi_state_t::reg[k_spi_reg_words]

Reflect-on-read register shadow.

Definition at line 110 of file board_periph_spi.c.

Referenced by internal_spi_reg_read(), internal_spi_reg_write(), and internal_spi_spdr_write().

◆ rx

uint32_t spi_state_t::rx

Receive holding register (echoed word).

Definition at line 112 of file board_periph_spi.c.

Referenced by internal_spi_reg_read(), and internal_spi_spdr_write().

◆ spsr

uint32_t spi_state_t::spsr

SPSR flags (SPTEF / SPRF / ...).

Definition at line 111 of file board_periph_spi.c.

Referenced by internal_spi_reg_read(), internal_spi_spcr_write(), internal_spi_spdr_write(), and internal_spi_spsrc_write().


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