31static const char*
s_tag =
"DMA";
180 if (req->
count == 0U) {
340 s_fake_requests[ch] = *req;
424 return &s_fake_requests[channel];
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_ISR_SAFE
The function is callable from interrupt context.
#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.
static bool s_initialized
True once display_init has succeeded.
ra8_err_t ra8_dma_channel_is_busy(uint8_t channel, bool *out_busy)
Query the allocation state of a channel.
static ra8_err_t internal_validate_request(const ra8_dma_request_t *req)
Validate a request descriptor before touching hardware.
static ra8_dma_channel_state_t s_channels[k_ra8_dma_channel_count]
Channel allocation + dispatch table.
ra8_err_t ra8_dma_init(void)
Bring up the generic DMA substrate.
ra8_err_t ra8_dma_release(uint8_t channel)
Release a previously allocated channel.
ra8_err_t ra8_dma_deinit(void)
Tear down the generic DMA substrate.
static void internal_pack_dmac_cfg(const ra8_dma_request_t *req, ra8_dmac_config_t *out_cfg)
Copy a high-level ra8_dma_request_t into the lower-level ra8_dmac_config_t the DMAC driver expects.
void ra8_dma_dispatch_complete(uint8_t channel)
Fire the per-channel completion callback.
ra8_err_t ra8_dma_request(const ra8_dma_request_t *req, uint8_t *out_channel)
Allocate a channel and arm a DMAC transfer.
static uint8_t internal_find_free(void)
Find the first free channel.
Generic DMA transfer substrate (DMAC engine).
@ k_ra8_dma_channel_none
RA8 DMA channel none.
@ k_ra8_dma_channel_count
RA8 DMA channel count.
void(* ra8_dma_complete_fn_t)(void *ctx)
Caller-supplied completion callback.
8-channel DMA controller (DMAC0) driver
@ k_ra8_dmac_width_word
32-bit transfers (DMTMD.SZ = 10b).
ra8_err_t ra8_dmac_stop(uint8_t channel)
Disable a DMAC0 channel and drop its MSTP reference.
ra8_err_t ra8_dmac_start(uint8_t channel, const ra8_dmac_config_t *cfg)
Programme and enable a DMAC0 channel.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_hw_init_failed
Hardware peripheral failed to initialise.
@ k_ra8_err_no_mem
Static buffer exhausted (no dynamic memory on this project).
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ 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_hw_error
Generic hardware fault detected (error flag set, fault interrupt).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_error_val(tag, message, value)
RA8 log error val.
#define ra8_log_info(tag, message)
RA8 log info.
#define ra8_log_error(tag, message)
RA8 log error.
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_enable(ra8_mstp_t id)
Reference-counted "ungate this peripheral" request.
ra8_err_t ra8_mstp_disable(ra8_mstp_t id)
Reference-counted "gate this peripheral" request.
Module Stop Control (MSTP) register layout for the Renesas RA8D2.
@ k_ra8_mstp_dmac0_dtc0
MSTPA22 DMAC0+DTC0 (shared).
Per-channel dispatch-table entry.
void * ctx
Stored context.
ra8_dma_complete_fn_t on_complete
Callback or NULL.
bool in_use
True while allocated.
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.
DMAC channel configuration.
uint16_t count
Transfer count (DMCRA low).
uint32_t src
Source address (DMSAR).
bool dst_inc
true: DM = increment, else fixed.
bool src_inc
true: SM = increment, else fixed.
uint32_t dst
Destination address (DMDAR).
ra8_dmac_width_t width
Transfer element width.