|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ULPT 1 Hz wake-from-software-standby demo for EK-RA8D2. More...
#include <stdint.h>#include "ra8_attributes.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_boot_entry.h"#include "ra8_cgc.h"#include "ra8_err.h"#include "ra8_isr.h"#include "ra8_time.h"#include "ra8_ulpt.h"Go to the source code of this file.
Enumerations | |
| enum | ulpt_demo_const_t : uint32_t { k_ulpt_demo_baud = 115200U , k_ulpt_demo_poll_ms = 50U , k_ulpt_demo_period_ticks = 0x8000U } |
| Demo tunables. More... | |
| enum | ulpt_demo_chan_t : uint8_t { k_ulpt_demo_channel = 0U , k_ulpt_demo_undf_bit = 0x20U } |
| ULPT channel + status. More... | |
Functions | |
| static void | internal_panic_halt (void) |
| Park the core after an unrecoverable ULPT demo failure. | |
| static void | internal_setup_or_halt (void) |
| Initialize clocks, SysTick, SCI8, and the ULPT block. | |
| static ra8_err_t | internal_arm (void) |
| Arm ULPT0 with the demo period. | |
| void | main (void) |
| Report and re-arm each observed ULPT0 underflow. | |
Variables | |
| static const uint8_t | s_ulpt_demo_log_msg [] = "ulpt: wake ok\r\n" |
ULPT 1 Hz wake-from-software-standby demo for EK-RA8D2.
Brings up the on-chip Ultra-Low-Power Timer (ULPT0) in 1 Hz mode and uses its underflow event as a wake source through software-standby cycles. Each underflow:
The demo deliberately keeps the wake-source path inside the ULPT driver and polls ULPTCR via ra8_ulpt_get_status: this matches the host unit-test path (no NVIC needed) and exercises the same register sequence on the EK-RA8D2 silicon.
Definition in file main.c.
| enum ulpt_demo_chan_t : uint8_t |
| enum ulpt_demo_const_t : uint32_t |
|
staticnodiscard |
Arm ULPT0 with the demo period.
Delegates the fixed channel and approximately one-second reload to the ULPT HAL without changing any other timer channel.
| k_ra8_ok | ULPT0 accepted the channel and reload configuration. |
| (other) | The HAL rejected or could not start the timer. |
Definition at line 131 of file main.c.
References k_ulpt_demo_channel, k_ulpt_demo_period_ticks, RA8_INTERNAL, and ra8_ulpt_start().
|
static |
Park the core after an unrecoverable ULPT demo failure.
Repeatedly executes WFI so an attached debugger can inspect the timer and clock state without additional foreground traffic.
Definition at line 69 of file main.c.
References RA8_INTERNAL.
|
static |
Initialize clocks, SysTick, SCI8, and the ULPT block.
Brings all foreground-loop dependencies up in order and transfers control to the terminal panic helper on the first HAL error.
Definition at line 89 of file main.c.
References internal_panic_halt(), k_ra8_clock_id_cpuclk0, k_ra8_ok, k_ulpt_demo_baud, ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), RA8_INTERNAL, ra8_time_init(), and ra8_ulpt_init().
| void main | ( | void | ) |
Report and re-arm each observed ULPT0 underflow.
The application entry point Reset_Handler hands control to.
Initializes and arms ULPT0, then polls its underflow bit. Each event emits the fixed wake banner, stops the channel to clear status, and starts the next interval with the same reload.
Definition at line 150 of file main.c.
References internal_arm(), internal_panic_halt(), internal_setup_or_halt(), k_ra8_ok, k_ulpt_demo_channel, k_ulpt_demo_poll_ms, k_ulpt_demo_undf_bit, ra8_board_uart_console_write(), ra8_delay_ms(), ra8_isr_globals_enable(), ra8_ulpt_get_status(), ra8_ulpt_stop(), and s_ulpt_demo_log_msg.