42typedef enum : uint32_t {
48typedef enum : uint16_t {
57typedef enum : uint16_t {
63typedef enum : int32_t {
73typedef enum : int32_t {
108static void iu_print(
const uint8_t* msg, uint32_t len)
117 __asm__
volatile(
"bkpt #0");
119 __asm__
volatile(
"wfi");
133 buf[n] = (uint8_t)(
'0' + (value % (uint32_t)
k_iu_dec_ten));
137 for (uint32_t i = 0U; i < n; i++) {
152static bool iu_tap(int32_t px, int32_t py,
bool want_hit, uint16_t want_act, uint32_t* hits)
155 uint16_t action = 0U;
163 if (hit != want_hit) {
166 return want_hit ? (action == want_act) :
true;
192 uint16_t new_top = 0U;
206 uint32_t cpuclk0_hz = 0U;
241 for (uint16_t t = 0U; t < ntargets; ++t) {
255 ok = ok && nav_ok && (hits == (uint32_t)ntargets) &&
271 __asm__
volatile(
"wfi");
void main(void)
Secure fallback main entry point.
static const uint8_t k_msg_pre[]
static const uint8_t k_msg_boot[]
static const uint8_t k_msg_fail[]
static const uint8_t k_msg_pass[]
static bool iu_nav_check(void)
Drive the screen stack: open book -> reading, back -> library.
static const ra8_ui_target_t k_iu_targets[]
Representative chrome targets: a 2x2 book grid + a toolbar button.
iu_consts_t
Console knobs (no magic numbers).
@ k_iu_uart_baud
Console baud.
@ k_iu_dec_ten
Decimal base.
iu_screen_t
Screen ids for the nav stack.
@ k_iu_screen_reading
Reading view.
@ k_iu_screen_library
Library / home grid.
iu_action_t
Chrome tap-target action ids.
@ k_iu_act_book3
Library book cell 3.
@ k_iu_act_book2
Library book cell 2.
@ k_iu_act_book0
Library book cell 0.
@ k_iu_act_book1
Library book cell 1.
@ k_iu_act_toolbar
Status-bar toolbar button.
static void iu_panic_halt(void)
Print the fail banner and trap (ra8_emulator halts on the BKPT).
static void iu_print_uint(uint32_t value)
Print a small unsigned integer in decimal.
static const uint8_t k_msg_hits[]
iu_rect_t
Pixel geometry of the chrome tap-target rects.
@ k_iu_toolbar_y
Toolbar-button y.
@ k_iu_toolbar_h
Toolbar-button height.
@ k_iu_grid_row0_y
Top row y of the 2x2 book grid.
@ k_iu_toolbar_w
Toolbar-button width.
@ k_iu_cell_w
Book-cell width.
@ k_iu_grid_row1_y
Bottom row y of the 2x2 book grid.
@ k_iu_cell_h
Book-cell height.
@ k_iu_grid_col0_x
Left column x of the 2x2 book grid.
@ k_iu_grid_col1_x
Right column x of the 2x2 book grid.
static bool iu_tap(int32_t px, int32_t py, bool want_hit, uint16_t want_act, uint32_t *hits)
Hit-test a synthetic tap; verify hit-ness + the resolved action.
static const uint8_t k_msg_nav[]
static void iu_setup_or_halt(void)
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
static const uint8_t k_msg_failr[]
iu_miss_pt_t
Off-target tap coordinates that must miss.
@ k_iu_tap_half
Divisor for a rect's centre point.
@ k_iu_miss_gutter_y
Mid-height of the first cell row.
@ k_iu_miss_off_y
Far off-screen y.
@ k_iu_miss_gutter_x
Column gutter (between cells 0 and 1).
@ k_iu_miss_count
Number of off-target (miss) taps.
@ k_iu_miss_off_x
Far off-screen x.
static void iu_print(const uint8_t *msg, uint32_t len)
Emit a byte run on the SCI8 console.
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.
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.
Bounded UI interaction core: hit-testing, screen stack, paging.
ra8_err_t ra8_ui_nav_init(ra8_ui_nav_t *nav, uint16_t root_screen)
Initialise a navigation stack with a root screen.
ra8_err_t ra8_ui_nav_push(ra8_ui_nav_t *nav, uint16_t screen)
Push a new screen onto the stack.
ra8_err_t ra8_ui_nav_pop(ra8_ui_nav_t *nav, uint16_t *out_screen)
Pop the top screen, revealing the one beneath.
ra8_err_t ra8_ui_nav_top(const ra8_ui_nav_t *nav, uint16_t *out_screen)
Read the current (top) screen id.
ra8_err_t ra8_ui_hit_test(const ra8_ui_target_t *targets, uint16_t count, int32_t px, int32_t py, uint16_t *out_action, bool *out_hit)
Find the first tap target containing a point.
Fixed-depth screen-id stack (caller-owned).
Axis-aligned rectangle in framebuffer pixel coordinates.
int32_t w
Width (pixels, >= 0).
int32_t h
Height (pixels, >= 0).
int32_t x
Left edge (pixels).
int32_t y
Top edge (pixels).
One tap target: a rectangle bound to an opaque action id.