45typedef enum : uint32_t {
54typedef enum : uint8_t {
69 __asm__
volatile(
"wfi");
87 return (uint8_t)(
'0' + n);
105 const uint8_t shift =
139 uint32_t cpuclk0_hz = 0U;
void main(void)
Secure fallback main entry point.
static const uint8_t k_timer_demo_prefix[]
Output line tags.
static void timer_demo_panic_halt(void)
Park forever after a fatal init failure.
static uint32_t timer_demo_delta(uint32_t start, uint32_t stop)
Compute stop - start modulo 2^32 (handles wrap).
static void timer_demo_word_to_hex(uint32_t v, uint8_t *dst)
Render a 32-bit value as 8 ASCII hex chars (big-endian).
static ra8_err_t timer_demo_one_capture(void)
One iteration: capture two counter snapshots and emit the delta.
static uint8_t timer_demo_nibble_to_hex(uint8_t nibble)
Convert the low nibble of n to its ASCII hex char.
timer_demo_config_t
Compile-time settings.
@ k_timer_demo_capture_ms
Timer demo capture ms.
@ k_timer_demo_gpt_channel
Timer demo GPT channel.
@ k_timer_demo_period_ms
Timer demo period ms.
@ k_timer_demo_gpt_period
Timer demo GPT period.
@ k_timer_demo_baud
Timer demo baud.
timer_demo_byte_t
Single-byte constants.
@ k_timer_demo_hex_per_word
Timer demo hex per word.
@ k_timer_demo_alpha_thresh
Timer demo alpha thresh.
@ k_timer_demo_nibble_mask
Timer demo nibble mask.
@ k_timer_demo_nibble_shift
Timer demo nibble shift.
static const uint8_t k_timer_demo_eol[]
static void timer_demo_setup_or_halt(void)
Bring CGC + SysTick + SCI8 + LED1 + MSTP + GPT0 up.
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).
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
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.
Error Code Definitions for ra8-firmware.
@ 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.
Full-featured General PWM Timer (GPT) driver.
ra8_err_t ra8_gpt_start_free_run(uint8_t channel, uint32_t period)
Configure a GPT channel as a free-running up-counter.
ra8_err_t ra8_gpt_read(uint8_t channel, uint32_t *out)
Read the current counter value.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
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.