45static const char*
s_tag =
"SPI_B";
158 return (bytes + (line - 1U)) & ~(line - 1U);
188 if (rxc ==
nullptr) {
202 uint8_t* out_dma_channel)
211 if (reg ==
nullptr) {
239 uint8_t* out_dma_channel)
248 if (reg ==
nullptr) {
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).
Cortex-M85 L1 cache maintenance, enable/disable, and I-cache invalidate.
ra8_err_t ra8_cache_dcache_invalidate_by_addr(const void *addr, uint32_t size)
Invalidate (drop) the D-cache lines covering a byte range.
uint32_t ra8_cache_dcache_line_bytes(void)
Smallest Cortex-M85 D-cache line size, in bytes.
ra8_err_t ra8_cache_dcache_clean_by_addr(const void *addr, uint32_t size)
Clean (write back) the D-cache lines covering a byte range.
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.
Generic DMA transfer substrate (DMAC engine).
ra8_err_t ra8_dma_request(const ra8_dma_request_t *req, uint8_t *out_channel)
Allocate a DMAC channel, programme it, and start the trigger wiring.
void(* ra8_dma_complete_fn_t)(void *ctx)
Caller-supplied completion callback.
8-channel DMA controller (DMAC0) driver
@ k_ra8_dmac_width_byte
8-bit transfers (DMTMD.SZ = 00b).
ra8_elc_event_t
Partial list of ELC events (populate as drivers need them).
Error Code Definitions for ra8-firmware.
@ 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.
SPI_B controller driver (RA8D2 Type-B SPI peripheral).
static ra8_err_t internal_dma_args_ok(uint8_t channel, uint16_t len)
Report whether a DMA entry point's channel index and length are usable.
static ra8_spi_dma_rx_ctx_t s_spi_dma_rx_ctx[k_ra8_spi_b_channel_count]
Per-channel RX-DMA completion bridge, indexed by SPI channel.
static uint32_t internal_round_up_to_cache_line(uint32_t bytes)
Round a byte count up to a whole number of D-cache lines.
ra8_err_t ra8_spi_read_dma(uint8_t channel, uint8_t *out_buf, uint16_t len, ra8_dma_complete_fn_t on_complete, void *ctx, uint8_t *out_dma_channel)
Kick off a DMA-backed RX transfer on an SPI channel.
static void internal_spi_dma_rx_complete(void *ctx)
RX-DMA transfer-end wrapper: invalidate the buffer, then chain.
ra8_err_t ra8_spi_write_dma(uint8_t channel, const uint8_t *data, uint16_t len, ra8_dma_complete_fn_t on_complete, void *ctx, uint8_t *out_dma_channel)
Kick off a DMA-backed TX transfer on an SPI channel.
SPI_B register layout for the Renesas RA8D2.
static volatile r_spi_regs_t * ra8_spi(uint8_t channel)
Get pointer to SPI_B channel channel (0..1).
@ k_ra8_spi_b_channel_count
SPI0 + SPI1.
SPI_B register-window mirror (matches FSP R_SPI_B0_Type, 0x70 bytes).
volatile uint32_t SPDR
+0x00 SPI Data Register.
Descriptor for a single DMA transfer.
ra8_dma_complete_fn_t on_complete
On complete.
uintptr_t dst_addr
Dst address.
ra8_dmac_width_t width
Width.
uintptr_t src_addr
Src address.
ra8_elc_event_t trigger
Trigger.
Driver-owned completion context for an RX DMA, used to bridge the cache-invalidate step onto the call...
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.