|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Headless on-silicon HIL gate for e-reader interaction / hit-test (#118). More...
#include <stddef.h>#include <stdint.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_mstp.h"#include "ra8_time.h"#include "ra8_ui.h"Go to the source code of this file.
Enumerations | |
| enum | iu_consts_t : uint32_t { k_iu_uart_baud = 115200U , k_iu_dec_ten = 10U } |
| Console knobs (no magic numbers). More... | |
| enum | iu_action_t : uint16_t { k_iu_act_book0 = 10U , k_iu_act_book1 = 11U , k_iu_act_book2 = 12U , k_iu_act_book3 = 13U , k_iu_act_toolbar = 20U } |
| Chrome tap-target action ids. More... | |
| enum | iu_screen_t : uint16_t { k_iu_screen_library = 1U , k_iu_screen_reading = 2U } |
| Screen ids for the nav stack. More... | |
| enum | iu_miss_pt_t : int32_t { k_iu_miss_gutter_x = 112 , k_iu_miss_gutter_y = 70 , k_iu_miss_off_x = 300 , k_iu_miss_off_y = 400 , k_iu_tap_half = 2 , k_iu_miss_count = 2 } |
| Off-target tap coordinates that must miss. More... | |
| enum | iu_rect_t : int32_t { k_iu_grid_col0_x = 8 , k_iu_grid_col1_x = 116 , k_iu_grid_row0_y = 40 , k_iu_grid_row1_y = 110 , k_iu_cell_w = 100 , k_iu_cell_h = 60 , k_iu_toolbar_y = 4 , k_iu_toolbar_w = 60 , k_iu_toolbar_h = 28 } |
| Pixel geometry of the chrome tap-target rects. More... | |
Functions | |
| static void | iu_print (const uint8_t *msg, uint32_t len) |
| Emit a byte run on the SCI8 console. | |
| 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 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 bool | iu_nav_check (void) |
| Drive the screen stack: open book -> reading, back -> library. | |
| static void | iu_setup_or_halt (void) |
| Bring up clocks/MSTP/time + the SCI8 console; halt on failure. | |
| void | main (void) |
| App entry: inject synthetic taps + nav events, assert, print result. | |
Variables | |
| static const ra8_ui_target_t | k_iu_targets [] |
| Representative chrome targets: a 2x2 book grid + a toolbar button. | |
| static const uint8_t | k_msg_boot [] = "ui-hil: boot\r\n" |
| static const uint8_t | k_msg_fail [] = "ui-hil: FAIL init\r\n" |
| static const uint8_t | k_msg_pre [] = "ui-hil: taps=" |
| static const uint8_t | k_msg_hits [] = " hits=" |
| static const uint8_t | k_msg_nav [] = " nav_ok=" |
| static const uint8_t | k_msg_pass [] = " PASS\r\n" |
| static const uint8_t | k_msg_failr [] = " FAIL\r\n" |
Headless on-silicon HIL gate for e-reader interaction / hit-test (#118).
#80 built the e-reader interaction layer – ra8_ui hit-testing + screen-stack navigation – but no HIL routes an input event through it; the chrome HIL only checks the render. This app closes that gap with synthetic input (no GT911 touch needed): it builds a representative chrome target set (book cells
a toolbar button), injects a sequence of taps at known coordinates, and asserts each resolves to the expected ra8_ui action id (and that off-target taps miss). It then drives the screen stack (open book -> reading, back -> library) and asserts each transition. The result is printed on the SCI8 J-Link OB console:
ui-hil: taps=<N> hits=<M> nav_ok=<0|1> PASS
Pure logic (no peripheral state), so the banner is identical every boot and matches the host / ra8_emulator run.
[Ring 7 / App] {World: NS}
Definition in file main.c.
| enum iu_action_t : uint16_t |
| enum iu_consts_t : uint32_t |
| enum iu_miss_pt_t : int32_t |
Off-target tap coordinates that must miss.
| enum iu_rect_t : int32_t |
Pixel geometry of the chrome tap-target rects.
| enum iu_screen_t : uint16_t |
|
static |
Drive the screen stack: open book -> reading, back -> library.
Definition at line 174 of file main.c.
References k_iu_screen_library, k_iu_screen_reading, k_ra8_ok, ra8_ui_nav_init(), ra8_ui_nav_pop(), ra8_ui_nav_push(), and ra8_ui_nav_top().
Referenced by main().
|
static |
Print the fail banner and trap (ra8_emulator halts on the BKPT).
Definition at line 114 of file main.c.
References iu_print(), and k_msg_fail.
Referenced by iu_setup_or_halt().
|
static |
Emit a byte run on the SCI8 console.
Definition at line 108 of file main.c.
References ra8_board_uart_console_write().
Referenced by iu_panic_halt(), iu_print_uint(), and main().
|
static |
Print a small unsigned integer in decimal.
Definition at line 124 of file main.c.
References iu_print(), and k_iu_dec_ten.
Referenced by main().
|
static |
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
Definition at line 204 of file main.c.
References iu_panic_halt(), k_iu_uart_baud, k_ra8_clock_id_cpuclk0, k_ra8_ok, ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_mstp_init(), and ra8_time_init().
Referenced by main().
|
static |
Hit-test a synthetic tap; verify hit-ness + the resolved action.
| [in] | px | Tap x. |
| [in] | py | Tap y. |
| [in] | want_hit | Expected hit-ness. |
| [in] | want_act | Expected action id (when want_hit). |
| [in,out] | hits | Running hit counter (incremented on a real hit). |
Definition at line 152 of file main.c.
References k_iu_targets, k_ra8_ok, and ra8_ui_hit_test().
Referenced by main().
| void main | ( | void | ) |
App entry: inject synthetic taps + nav events, assert, print result.
The application entry point Reset_Handler hands control to.
Definition at line 229 of file main.c.
References ra8_ui_rect_t::h, iu_nav_check(), iu_print(), iu_print_uint(), iu_setup_or_halt(), iu_tap(), k_iu_miss_count, k_iu_miss_gutter_x, k_iu_miss_gutter_y, k_iu_miss_off_x, k_iu_miss_off_y, k_iu_tap_half, k_iu_targets, k_msg_boot, k_msg_failr, k_msg_hits, k_msg_nav, k_msg_pass, k_msg_pre, ra8_isr_globals_enable(), ra8_ui_rect_t::w, ra8_ui_rect_t::x, and ra8_ui_rect_t::y.
|
static |
Representative chrome targets: a 2x2 book grid + a toolbar button.
|
static |
|
static |
|
static |