|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Headless on-silicon HIL gate for in-content hyperlink navigation (#110). More...
#include <stddef.h>#include <stdint.h>#include "font_fixture.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 "reflow.h"Go to the source code of this file.
Enumerations | |
| enum | lk_consts_t : uint32_t { k_lk_view_w = 280U , k_lk_view_h = 360U , k_lk_font_px = 16U , k_lk_ink = 0xFF101010U , k_lk_link_col = 0xFF2A52BEU , k_lk_uart_baud = 115200U , k_lk_fnv_offset = 2166136261U , k_lk_fnv_prime = 16777619U , k_lk_hex_nibbles = 8U , k_lk_nibble_bits = 4U , k_lk_nibble_mask = 0x0FU , k_lk_dec_ten = 10U } |
| Viewport / console / hash knobs (no magic numbers). More... | |
Functions | |
| static void | lk_print (const uint8_t *msg, uint32_t len) |
| Emit a byte run on the SCI8 console. | |
| static void | lk_panic_halt (const uint8_t *msg, uint32_t len) |
| Print the fail banner and trap (ra8_emulator halts on the BKPT). | |
| static void | lk_print_hex (uint32_t value) |
| Print a 32-bit value as 8 upper-case hex digits. | |
| static void | lk_print_uint (uint32_t value) |
| Print a small unsigned integer in decimal. | |
| static void | lk_print_bool (bool yes) |
| Print "Y" or "N". | |
| static uint32_t | lk_geom_hash (void) |
| FNV-1a-32 over the laid-out link-rectangle geometry. | |
| static void | lk_probe_rect (uint32_t idx, bool *out_cross, bool *out_frag) |
| Classify the href at a link rect's centre via the public nav API. | |
| static void | lk_setup_or_halt (void) |
| Bring up clocks/MSTP/time + the SCI8 console; halt on failure. | |
| void | main (void) |
| App entry: lay out the link chapter, drive the nav API, print results. | |
Variables | |
| static reflow_t | s_engine |
| Reflow engine (large – file-scope, not on the stack). | |
| static const char | k_lk_chapter [] |
| Baked chapter: two links (cross-chapter + fragment) and an anchor. | |
| static const uint8_t | k_msg_boot [] = "ereader-link-hil: boot\r\n" |
| static const uint8_t | k_msg_fail [] = "ereader-link-hil: FAIL init\r\n" |
| static const uint8_t | k_msg_lerr [] = "ereader-link-hil: FAIL layout\r\n" |
| static const uint8_t | k_msg_pre [] = "ereader-link-hil: links=" |
| static const uint8_t | k_msg_cross [] = " cross=" |
| static const uint8_t | k_msg_frag [] = " frag=" |
| static const uint8_t | k_msg_apage [] = " apage=" |
| static const uint8_t | k_msg_geom [] = " geom=" |
| static const uint8_t | k_msg_eol [] = "\r\n" |
| static const uint8_t | k_msg_yes [] = "Y" |
| static const uint8_t | k_msg_no [] = "N" |
Headless on-silicon HIL gate for in-content hyperlink navigation (#110).
Closes the real-hardware gap for the <a href> link pipeline: tokenize the href + element id, lay out the chapter, build tappable link rectangles + anchor positions, then drive the navigation API the way a touch tap would – no panel / SD / touch needed. The app:
Folds an FNV-1a-32 hash over the laid-out link-rectangle geometry and prints a banner on the SCI8 J-Link OB console:
ereader-link-hil: links=2 cross=Y frag=Y apage=<P> geom=<8 hex>
Ahem is a fixed-metric face, so the layout + link geometry are deterministic; the banner is identical every boot and matches the host / ra8_emulator run.
[Ring 7 / App] {World: NS}
Definition in file main.c.
| enum lk_consts_t : uint32_t |
Viewport / console / hash knobs (no magic numbers).
|
static |
FNV-1a-32 over the laid-out link-rectangle geometry.
Definition at line 145 of file main.c.
References k_lk_fnv_offset, k_lk_fnv_prime, and s_engine.
Referenced by main().
|
static |
Print the fail banner and trap (ra8_emulator halts on the BKPT).
Definition at line 94 of file main.c.
References lk_print().
Referenced by lk_setup_or_halt(), and main().
|
static |
Emit a byte run on the SCI8 console.
Definition at line 88 of file main.c.
References ra8_board_uart_console_write().
Referenced by lk_panic_halt(), lk_print_bool(), lk_print_hex(), lk_print_uint(), and main().
|
static |
|
static |
Print a 32-bit value as 8 upper-case hex digits.
Definition at line 104 of file main.c.
References k_lk_dec_ten, k_lk_hex_nibbles, k_lk_nibble_bits, k_lk_nibble_mask, and lk_print().
Referenced by main().
|
static |
Print a small unsigned integer in decimal.
Definition at line 116 of file main.c.
References k_lk_dec_ten, and lk_print().
Referenced by main().
|
static |
Classify the href at a link rect's centre via the public nav API.
| [in] | idx | Link-rect index to probe. |
| [out] | out_cross | Set true when the href is a cross-chapter target. |
| [out] | out_frag | Set true when the href is a same-chapter fragment. |
Definition at line 164 of file main.c.
References reflow_link_rect_t::h, k_ra8_ok, k_reflow_href_chapter, k_reflow_href_chapter_fragment, k_reflow_href_empty, k_reflow_href_fragment, reflow_link_rect_t::page_index, reflow_hit_test_link(), reflow_href_split(), s_engine, reflow_link_rect_t::w, reflow_link_rect_t::x, and reflow_link_rect_t::y.
Referenced by main().
|
static |
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
Definition at line 191 of file main.c.
References k_lk_uart_baud, k_msg_fail, k_ra8_clock_id_cpuclk0, k_ra8_ok, lk_panic_halt(), ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_mstp_init(), and ra8_time_init().
Referenced by main().
| void main | ( | void | ) |
App entry: lay out the link chapter, drive the nav API, print results.
The application entry point Reset_Handler hands control to.
Definition at line 216 of file main.c.
References k_ahem_ttf, k_ahem_ttf_len, k_lk_chapter, k_lk_font_px, k_lk_ink, k_lk_link_col, k_lk_view_h, k_lk_view_w, k_msg_apage, k_msg_boot, k_msg_cross, k_msg_eol, k_msg_fail, k_msg_frag, k_msg_geom, k_msg_lerr, k_msg_pre, k_ra8_ok, lk_geom_hash(), lk_panic_halt(), lk_print(), lk_print_bool(), lk_print_hex(), lk_print_uint(), lk_probe_rect(), lk_setup_or_halt(), ra8_isr_globals_enable(), reflow_find_anchor(), reflow_init(), reflow_layout_chapter(), and s_engine.
|
static |
Baked chapter: two links (cross-chapter + fragment) and an anchor.
Definition at line 67 of file main.c.
Referenced by main().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 85 of file main.c.
Referenced by lk_print_bool().
|
static |
Definition at line 84 of file main.c.
Referenced by lk_print_bool().