32static const char*
const s_tag =
"ra8_io_spi_bus";
68 if (bus->
iface ==
nullptr) {
158 out->
ctx = (
void*)(uintptr_t)bus;
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_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_io_spi_bus_xfer8(const ra8_io_spi_bus_t *bus, uint8_t tx, uint8_t *rx)
Full-duplex single-byte exchange on the bound bus.
ra8_err_t ra8_io_spi_bus_write_read(const ra8_io_spi_bus_t *bus, const void *tx, void *rx, uint32_t len, ra8_spi_bit_width_t width)
Full-duplex multi-frame transfer on the bound bus.
static ra8_err_t internal_validate(const ra8_io_spi_bus_t *bus)
Reject a handle that is NULL or has no backend bound.
static ra8_err_t internal_ops_xfer8(void *ctx, uint8_t tx, uint8_t *rx)
Seam trampoline – forward an xfer8 into the bound bus.
ra8_err_t ra8_io_spi_bus_set_clock(const ra8_io_spi_bus_t *bus, uint32_t baud_hz, uint32_t pclk_hz)
Re-program the bound bus bit-rate without reconfiguring.
ra8_err_t ra8_io_spi_bus_as_ops(const ra8_io_spi_bus_t *bus, ra8_spi_bus_ops_t *out)
Expose a bound bus through the Ring-3 seam ra8_spi_bus_ops_t.
ra8_io SPI-bus facade – one controller-transfer vtable over thechip's two SPI implementations.
Internal vtable type for the ra8_io SPI-bus facade.
SPI_B controller driver (RA8D2 Type-B SPI peripheral).
ra8_spi_bit_width_t
Per-frame bit width for multi-byte transfers.
Injected SPI-bus seam consumed by Ring-3 SPI device drivers.
ra8_err_t(* set_clock)(void *ctx, uint32_t baud_hz, uint32_t pclk_hz)
Re-program the bit-rate divider from baud_hz / pclk_hz.
ra8_err_t(* xfer8)(void *ctx, uint8_t tx, uint8_t *rx)
Full-duplex single-byte exchange (rx may be NULL).
ra8_err_t(* write_read)(void *ctx, const void *tx, void *rx, uint32_t len, ra8_spi_bit_width_t width)
Full-duplex multi-frame transfer (either buffer may be NULL).
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).
Caller-filled SPI transfer seam: one full-duplex byte exchange.
void * ctx
Opaque cookie handed to xfer8 (binder-owned).
ra8_err_t(* xfer8)(void *ctx, uint8_t tx, uint8_t *rx)
Full-duplex single-byte exchange on the bound bus.