36static const char*
const s_tag =
"ra8_io_spi_bus_sci_spi";
110 return ra8_sci_spi_xfer((uint8_t)(uintptr_t)ctx, (
const uint8_t*)tx, (uint8_t*)rx, len);
158 bus->
ctx = (
void*)(uintptr_t)channel;
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_not_supported
Requested feature not compiled in, not wired, or not supported by this MCU variant.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_io SPI-bus facade – one controller-transfer vtable over thechip's two SPI implementations.
struct ra8_io_spi_bus_iface ra8_io_spi_bus_iface_t
Internal vtable type for the ra8_io SPI-bus facade.
static ra8_err_t internal_sci_spi_xfer8(void *ctx, uint8_t tx, uint8_t *rx)
SCI backend: full-duplex single-byte exchange.
ra8_err_t ra8_io_spi_bus_bind_sci_spi(ra8_io_spi_bus_t *bus, uint8_t channel)
Bind bus to SCI Simple-SPI channel channel.
static ra8_err_t internal_sci_spi_write_read(void *ctx, const void *tx, void *rx, uint32_t len, ra8_spi_bit_width_t width)
SCI backend: full-duplex multi-byte transfer (8-bit frames only).
static const ra8_io_spi_bus_iface_t s_sci_spi_iface
SCI Simple-SPI backend vtable – every row forwards to ra8_sci_spi_*.
static ra8_err_t internal_sci_spi_set_clock(void *ctx, uint32_t baud_hz, uint32_t pclk_hz)
SCI backend: re-program the CCR2 bit-rate divider.
SCI Simple-SPI backend binder for the ra8_io SPI-bus facade.
SCI_B (Serial Communication Interface, B variant) register layoutfor the RA8D2.
@ k_ra8_sci_channel_count
SCI0..SCI9.
SCI Simple-SPI controller-mode driver (polling, full-duplex).
ra8_err_t ra8_sci_spi_set_clock(uint8_t channel, uint32_t baud_hz, uint32_t pclk_hz)
Re-program the bit-rate without otherwise reconfiguring.
ra8_err_t ra8_sci_spi_xfer(uint8_t channel, const uint8_t *tx, uint8_t *rx, uint32_t len)
Full-duplex multi-byte transfer.
ra8_err_t ra8_sci_spi_xfer8(uint8_t channel, uint8_t tx, uint8_t *rx)
Full-duplex single-frame transfer.
SPI_B controller driver (RA8D2 Type-B SPI peripheral).
ra8_spi_bit_width_t
Per-frame bit width for multi-byte transfers.
@ k_ra8_spi_width_8
8-bit frame -> SPCMDn.SPB = 0b00111.
Caller-allocated SPI-bus handle binding a backend to its context.
void * ctx
Backend-private context (private).
const ra8_io_spi_bus_iface_t * iface
Bound backend vtable (private).