ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
main.c
Go to the documentation of this file.
1
28
29#include <stdint.h>
30
31#include "ra8_attributes.h"
32#include "ra8_board_ek_ra8d2.h"
33#include "ra8_boot_entry.h"
34#include "ra8_err.h"
35#include "ra8_isr.h"
36#include "ra8_time.h"
37
41typedef enum : uint32_t {
44
46typedef enum : uint32_t {
49
68volatile uint32_t g_blink_hal_tick = 0U;
69
70/* Forward declarations -- definitions appear after main() so the
71 * audit_init_order linter sees the canonical CGC -> TIME -> peripheral
72 * sequence in source order. */
73[[nodiscard]] RA8_INTERNAL static ra8_err_t internal_blink_pins_init(void);
75
76void main(void)
77{
79 while (1) {
80 __asm__ volatile("wfi");
81 }
82 }
83
85 while (1) {
86 __asm__ volatile("wfi");
87 }
88 }
89
91
92 while (1) {
94 break;
95 }
96 g_blink_hal_tick += 1U;
98 }
99
100 while (1) {
101 __asm__ volatile("wfi");
102 }
103}
104
126{
127 for (uint8_t i = 0U; i < (uint8_t)k_ra8_board_led_count; ++i) {
129 if (err != k_ra8_ok) {
130 return err;
131 }
132 }
133 return k_ra8_ok;
134}
135
155{
156 for (uint8_t i = 0U; i < (uint8_t)k_ra8_board_led_count; ++i) {
158 if (err != k_ra8_ok) {
159 return err;
160 }
161 }
162 return k_ra8_ok;
163}
void main(void)
Secure fallback main entry point.
Definition main.c:37
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).
ra8_board_led_id_t
Identifiers for the three user LEDs on EK-RA8D2 v1.
@ k_ra8_board_led_count
RA8 board led count.
Boot entry points shared between a vector table and its startup code.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Definition ra8_err.h:119
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Definition ra8_isr.c:439
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.
Definition ra8_time.c:59
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.
Definition ra8_time.c:129