43typedef enum : uint32_t {
98 __asm__
volatile(
"wfi");
120 static const char k_magic[] = {
'S',
'E',
'G',
'G',
'E',
'R',
' ',
'R',
'T',
'T', 0};
121 for (
size_t i = 0U; i <
sizeof k_magic; i++) {
165 if (data ==
nullptr) {
169 for (uint32_t i = 0U; i < len; i++) {
170 uint32_t next = up->
wr_off + 1U;
171 if (next == up->
size) {
201 static const char prefix[] =
"rtt_log_demo: ";
203 for (
size_t k = 0U; k < (
sizeof prefix - 1U); k++) {
204 buf[n++] = prefix[k];
208 uint32_t tmp = counter;
234 uint32_t cpuclk0_hz = 0U;
266 uint32_t counter = 0U;
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 uint32_t internal_format_line(uint8_t *out, bool enabled, uint32_t trig_count)
Format the per-cycle "elc: en=N trig=NN\r\n" line.
static rtt_cb_t s_rtt_cb
The control block itself.
static void internal_init(void)
Initialise the RTT control block in place.
static uint8_t s_rtt_up_buf[k_rtt_up_buf_bytes]
Up-buffer storage for channel 0.
static uint8_t s_rtt_down_buf[k_rtt_down_buf_bytes]
Down-buffer storage for channel 0.
rtt_demo_const_t
Demo tunables.
@ k_rtt_demo_period_ms
Rtt demo period ms.
@ k_rtt_down_buf_bytes
Rtt down buffer bytes.
@ k_rtt_msg_buf_bytes
Rtt message buffer bytes.
@ k_rtt_max_digits
Rtt maximum digits.
@ k_rtt_decimal_base
Rtt decimal base.
@ k_rtt_up_buf_bytes
Rtt up buffer bytes.
static ra8_err_t internal_write(const uint8_t *data, uint32_t len)
Push len bytes into channel 0's up-buffer (non-blocking).
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.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
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).
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.
One direction of an RTT channel (matches SEGGER layout).
uint8_t * buf
Backing ring buffer.
uint32_t rd_off
Read index (consumer = host).
const char * name
NUL-terminated channel name.
uint32_t size
Bytes of buf.
uint32_t wr_off
Write index (producer).
uint32_t flags
0 = no-block-skip, default.
SEGGER RTT control block.
uint32_t max_down
Number of down channels.
rtt_buf_t down[1]
Down channel array (host TX).
uint32_t max_up
Number of up channels.
rtt_buf_t up[1]
Up channel array (host RX).