42typedef enum : uint32_t {
49typedef enum : uint8_t {
115 __asm__
volatile(
"wfi");
131 uint32_t cpuclk0_hz = 0U;
221 uint8_t dma_chan = 0U;
239 enum : uint32_t { k_wait_iters = 5U };
240 for (uint32_t i = 0U; i < k_wait_iters; ++i) {
void main(void)
Secure fallback main entry point.
static void internal_setup_or_halt(void)
Bring up clocks, MSTP, delay timing, and the board console.
static void internal_panic_halt(void)
Park the core after an unrecoverable ADC demo failure.
static ra8_err_t internal_arm_channel(void)
Init GPT0 as a saw-wave PWM with a stable initial period.
static const uint32_t s_period_table[k_gpt_dma_demo_period_count]
Four 32-bit period values DMA streams into GPT0.GTPR.
static bool internal_run_one(void)
Arm one DMA write of s_period_table into GPT0.GTPR.
static void internal_on_complete(void *ctx)
DMA completion callback – raise the s_dma_done flag.
volatile uint32_t g_gpt_dma_match
HIL liveness counter – bumped after each DMA-complete callback fires.
volatile uint32_t g_gpt_dma_mismatch
HIL failure counter – bumped when ra8_gpt_write_dma returned non-ok or the completion callback never ...
gpt_dma_demo_const_t
Demo tunables.
@ k_gpt_dma_demo_initial_period
GPT DMA demo initial period.
@ k_gpt_dma_demo_period_count
4 periods per DMA burst.
@ k_gpt_dma_demo_rearm_delay_ms
GPT DMA demo rearm delay ms.
gpt_dma_demo_chan_t
GPT channel.
@ k_gpt_dma_demo_channel
GPT DMA demo channel.
static volatile uint8_t s_dma_done
Set to 1 inside the DMA completion callback.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Generic DMA transfer substrate (DMAC engine).
ra8_err_t ra8_dma_init(void)
Initialise the DMA substrate.
ra8_err_t ra8_dma_release(uint8_t channel)
Stop a channel and return it to the free pool.
Error Code Definitions for ra8-firmware.
@ 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.
Full-featured General PWM Timer (GPT) driver.
ra8_err_t ra8_gpt_write_dma(uint8_t channel, const uint32_t *periods, uint16_t count, ra8_dma_complete_fn_t on_complete, void *ctx, uint8_t *out_dma_channel)
Stream a buffer of period values into GPT GTPR via DMA.
@ k_ra8_gpt_mode_saw_pwm
Saw-wave PWM (up-count).
ra8_err_t ra8_gpt_init(uint8_t channel, const ra8_gpt_cfg_t *cfg)
Initialise a GPT channel with a full config descriptor.
@ k_ra8_gpt_ps_div_4
PCLKD / 4.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.
Configuration descriptor for ra8_gpt_init.