41typedef enum : uint32_t {
49typedef enum : uint8_t {
56typedef enum : uint16_t {
87 __asm__
volatile(
"wfi");
111 uint32_t cpuclk0_hz = 0U;
176 uint16_t m = (uint16_t)a.
minute + add_min;
179 uint16_t h = (uint16_t)a.
hour + add_hr;
223 }
while ((status & any_mask) == 0U);
void main(void)
Secure fallback main entry point.
static void internal_rtc_demo_setup_or_halt(void)
Initialize clocks, timekeeping, console, and RTC calendar state.
rtc_demo_seed_t
Alarm offset from the current RTC reading.
@ k_rtc_demo_seed_day
Rtc demo seed day.
@ k_rtc_demo_seed_month
Rtc demo seed month.
@ k_rtc_demo_alarm_offset_s
Rtc demo alarm offset s.
@ k_rtc_demo_seed_year_lo
2026 - 2000.
@ k_rtc_demo_year_base
Calendar epoch base for the year field.
static const uint8_t s_rtc_demo_log_msg[]
static const uint8_t s_rtc_demo_boot_msg[]
static void internal_rtc_demo_panic_halt(void)
Park the processor after an unrecoverable RTC demo failure.
static ra8_err_t internal_rtc_demo_arm_alarm(const ra8_rtc_datetime_t *now)
Program a +5 s alarm relative to now and enable AIE.
rtc_demo_calendar_t
Calendar-arithmetic moduli for the +5 s alarm calc.
@ k_rtc_demo_mins_per_hour
Rtc demo mins per hour.
@ k_rtc_demo_hours_per_day
Rtc demo hours per day.
@ k_rtc_demo_secs_per_min
Rtc demo secs per minimum.
rtc_demo_const_t
Demo tunables.
@ k_rtc_demo_ms_per_sec
Rtc demo ms per sec.
@ k_rtc_demo_baud
Rtc demo baud.
@ k_rtc_demo_poll_ms
Rtc demo poll ms.
@ k_rtc_demo_advance_secs
Rtc demo advance secs.
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_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.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Real-Time Clock driver (BCD calendar mode).
ra8_err_t ra8_rtc_set_alarm(const ra8_rtc_datetime_t *alarm)
Programme the alarm-match registers (hour/minute/second).
ra8_err_t ra8_rtc_init(void)
Start the RTC in 24-hour calendar mode.
ra8_err_t ra8_rtc_clear_status(uint8_t mask)
Clear RCR1 IRQ enable bits.
ra8_err_t ra8_rtc_set(const ra8_rtc_datetime_t *dt)
Write the calendar registers.
@ k_ra8_rtc_irq_periodic
RCR1.PIE.
@ k_ra8_rtc_irq_alarm
RCR1.AIE.
ra8_err_t ra8_rtc_get(ra8_rtc_datetime_t *out)
Read the calendar registers.
ra8_err_t ra8_rtc_get_status(uint8_t *out_mask)
Read RCR1 IRQ enable bits.
ra8_err_t ra8_rtc_set_irq_enable(uint8_t mask)
Enable one or more RTC IRQ sources via RCR1.
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.
Calendar date + time decoded from BCD.