56typedef enum : uint64_t {
70typedef enum : uint32_t {
75typedef enum : uint32_t {
81typedef enum : uint32_t {
89typedef enum : uint32_t {
94typedef enum : uint32_t {
140 return (uint32_t)(off / 4U);
338 for (uint32_t i = 0U; i < (uint32_t)
k_spi_count; i++) {
362 for (uint32_t ch = 0U; ch < (uint32_t)
k_spi_count; ch++) {
363 if (
s_spi[ch].frames > 0U) {
367 s_spi[ch].loopback ?
"yes" :
"no");
371 "SPI%u: %u frames lb=%s",
374 s_spi[ch].loopback ?
"on" :
"off");
Multi-channel console log store backing the board view's tabbed console.
void board_console_push(board_console_ch_t ch, const char *line)
Append one completed line to a channel ring and the ALL ring.
@ k_board_console_ch_spi
SPI_B transfer summaries.
Decentralized peripheral-block registry for the board emulator core.
void board_periph_register_block(const board_periph_block_t *block)
Register a peripheral block's descriptor with the core registry.
@ k_block_order_sci
SCI_B UART.
IT8951 e-paper SPI-device model for ra8_emulator (attached to SPI_B).
uint8_t board_eink_exchange(uint8_t tx)
Exchange one full-duplex SPI byte with the modelled controller.
void board_eink_reset(void)
Reset the controller's command / read framing to power-on.
void board_eink_report(void)
Print the controller's end-of-run summary line (if attached).
bool board_eink_attached(void)
Report whether the IT8951 controller is currently attached.
SD-card-over-SPI device model for ra8_emulator (attached to SPI_B).
bool board_sd_attached(void)
Report whether an SD-card image is currently attached.
uint8_t board_sd_exchange(uint8_t tx)
Exchange one full-duplex SPI byte with the modelled card.
void board_sd_reset(void)
Reset the card's command / response framing to power-on.
static spi_state_t s_spi[k_spi_count]
The modelled SPI_B channels (SPI0 + SPI1).
spi_spsr_bit_t
SPSR (status) flags the driver polls (ra8_spi_regs.h).
@ k_spi_spsr_cendf
CENDF: communication end (bit 30).
@ k_spi_spsr_spdrf
SPDRF: receive data ready (bit 23).
@ k_spi_spsr_sptef
SPTEF: transmit empty (bit 29).
@ k_spi_spsr_sprf
SPRF: receive full (bit 31).
static RA8_INTERNAL void internal_spi_spcr2_write(spi_state_t *s, uint32_t value)
Apply an SPCR2 write: latch whether internal loopback is engaged.
spi_map_t
SPI_B block geometry (ra8_spi_regs.h, 32-bit register file).
@ k_spi_reg_words
Shadow word count for one channel.
@ k_spi_stride
Bytes per SPI channel.
@ k_spi_off_spdr
SPDR data register (FIFO front).
@ k_spi_span
Both channel windows.
@ k_spi_off_spsr
SPSR status (SPTEF/SPRF/...).
@ k_spi_off_spcr
SPCR control 1 (SPE/MSTR).
@ k_spi_off_spcr2
SPCR2 control 2 (loopback bits).
@ k_spi_count
SPI0 + SPI1.
@ k_spi_off_spsrc
SPSRC status clear (write-1).
static RA8_INTERNAL uint64_t internal_spi_read(uc_engine *uc, uint64_t addr, unsigned size)
MMIO read inside the SPI_B window: route to the addressed channel.
static RA8_INTERNAL uint32_t internal_spi_word(uint64_t off)
Index of the shadow word for off within a channel (range-checked).
spi_spcr_bit_t
SPCR (control 1) bits the model observes (ra8_spi_regs.h).
@ k_spi_spcr_spe
SPE: SPI function enable (bit 0).
spi_console_dim_t
Sizing for the board-console SPI transfer-summary line.
@ k_spi_console_line_cap
Max chars in one SPI console summary line.
spi_spcr2_bit_t
SPCR2 (control 2) loopback bits (ra8_spi_regs.h).
@ k_spi_spcr2_splp2
SPLP2: non-inverting loopback.
@ k_spi_spcr2_splp
SPLP: inverting loopback (rx=~tx).
static RA8_INTERNAL uint64_t internal_spi_reg_read(spi_state_t *s, uint64_t off)
Read a register from one modelled SPI_B channel.
static RA8_INTERNAL void internal_spi_write(uc_engine *uc, uint64_t addr, unsigned size, uint64_t value)
MMIO write inside the SPI_B window: route to the addressed channel.
static RA8_INTERNAL void internal_spi_reg_write(spi_state_t *s, uint64_t off, uint32_t value)
Write a register on one modelled SPI_B channel.
static const board_periph_block_t s_k_spi_block
This block's descriptor (static lifetime; the core keeps the pointer).
static RA8_INTERNAL void internal_spi_report(void)
Print one line per SPI channel that echoed any frame.
static RA8_INTERNAL void internal_spi_spcr_write(spi_state_t *s, uint32_t value)
Apply an SPCR write: SPE gates the channel and arms TX-empty.
static RA8_INTERNAL void internal_spi_reset(void)
Clear all SPI_B channel state to power-on.
spi_data_t
One-byte / one-word masks used by the echo path.
@ k_spi_byte_mask
Low data byte of an 8-bit frame.
static RA8_INTERNAL void internal_spi_spsrc_write(spi_state_t *s, uint32_t value)
Handle an SPSRC write (write-1-to-clear the matching SPSR flags).
static RA8_INTERNAL void internal_spi_spdr_write(spi_state_t *s, uint32_t value)
Handle a write to SPDR: echo the frame and assert receive-full.
static RA8_INTERNAL void internal_board_periph_spi_register(void)
Self-register the SPI_B block before main runs (decentralized).
Bounded raw-descriptor I/O seam for the RA8 emulator.
emu_io_result_t priv_emu_io_errf(const char *format,...)
Format bounded text and write it to the injected error descriptor.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
A modelled peripheral block's self-description for the core registry.
One SPI_B channel: register shadow + a single-frame echo engine.
uint32_t frames
Frames echoed through this channel.
uint32_t reg[k_spi_reg_words]
Reflect-on-read register shadow.
uint32_t rx
Receive holding register (echoed word).
uint32_t spsr
SPSR flags (SPTEF / SPRF / ...).
bool enabled
SPCR.SPE: channel is running.
bool loopback
SPCR2.SPLP/SPLP2: internal rx = tx tie.