|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Headless on-silicon HIL gate for text alignment + justification (#108). 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 | al_consts_t : uint32_t { k_al_view_w = 280U , k_al_view_h = 360U , k_al_font_px = 16U , k_al_ink = 0xFF101010U , k_al_link_col = 0xFF2A52BEU , k_al_uart_baud = 115200U , k_al_fnv_offset = 2166136261U , k_al_fnv_prime = 16777619U , k_al_hex_nibbles = 8U , k_al_nibble_bits = 4U , k_al_nibble_mask = 0x0FU , k_al_dec_ten = 10U } |
| Viewport / console / hash knobs (no magic numbers). More... | |
Functions | |
| static void | al_print (const uint8_t *msg, uint32_t len) |
| Emit a byte run on the SCI8 console. | |
| static void | al_panic_halt (const uint8_t *msg, uint32_t len) |
| Print the fail banner and trap (ra8_emulator halts on the BKPT). | |
| static void | al_print_hex (uint32_t value) |
| Print a 32-bit value as 8 upper-case hex digits. | |
| static void | al_print_uint (uint32_t value) |
| Print a small unsigned integer in decimal. | |
| static uint32_t | al_geom_hash (void) |
| FNV-1a-32 over every laid-out glyph's (x, y) position. | |
| static void | al_setup_or_halt (void) |
| Bring up clocks/MSTP/time + the SCI8 console; halt on failure. | |
| void | main (void) |
| App entry: lay out the aligned chapter, hash the geometry, print. | |
Variables | |
| static reflow_t | s_engine |
| Reflow engine (large – file-scope, not on the stack). | |
| static const char | k_al_chapter [] |
| Baked chapter: right, centre, justified, and default-left paragraphs. | |
| static const uint8_t | k_msg_boot [] = "ereader-align-hil: boot\r\n" |
| static const uint8_t | k_msg_fail [] = "ereader-align-hil: FAIL init\r\n" |
| static const uint8_t | k_msg_lerr [] = "ereader-align-hil: FAIL layout\r\n" |
| static const uint8_t | k_msg_pre [] = "ereader-align-hil: glyphs=" |
| static const uint8_t | k_msg_geom [] = " geom=" |
| static const uint8_t | k_msg_eol [] = "\r\n" |
Headless on-silicon HIL gate for text alignment + justification (#108).
Closes the real-hardware gap for the alignment pipeline: parse style="text-align:...", lay out centre / right / justified paragraphs, and shift / space the glyphs accordingly – no panel / SD / touch needed. The app lays out a baked chapter (one paragraph each of right, centre, justify, and the default left) through reflow with the fixed-metric Ahem face, folds an FNV-1a-32 hash over the laid-out glyph geometry (every glyph's x + y), and prints a banner on the SCI8 J-Link OB console:
ereader-align-hil: glyphs=<N> geom=<8 hex>
Ahem's fixed metrics make the layout deterministic; the banner is identical every boot and matches the host / ra8_emulator run, so any drift in the alignment offsets or the justification slack changes the hash.
[Ring 7 / App] {World: NS}
Definition in file main.c.
| enum al_consts_t : uint32_t |
Viewport / console / hash knobs (no magic numbers).
|
static |
FNV-1a-32 over every laid-out glyph's (x, y) position.
Definition at line 124 of file main.c.
References k_al_fnv_offset, k_al_fnv_prime, and s_engine.
Referenced by main().
|
static |
Print the fail banner and trap (ra8_emulator halts on the BKPT).
Definition at line 83 of file main.c.
References al_print().
Referenced by al_setup_or_halt(), and main().
|
static |
Emit a byte run on the SCI8 console.
Definition at line 77 of file main.c.
References ra8_board_uart_console_write().
Referenced by al_panic_halt(), al_print_hex(), al_print_uint(), and main().
|
static |
Print a 32-bit value as 8 upper-case hex digits.
Definition at line 93 of file main.c.
References al_print(), k_al_dec_ten, k_al_hex_nibbles, k_al_nibble_bits, and k_al_nibble_mask.
Referenced by main().
|
static |
Print a small unsigned integer in decimal.
Definition at line 105 of file main.c.
References al_print(), and k_al_dec_ten.
Referenced by main().
|
static |
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
Definition at line 139 of file main.c.
References al_panic_halt(), k_al_uart_baud, k_msg_fail, 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().
| void main | ( | void | ) |
App entry: lay out the aligned chapter, hash the geometry, print.
The application entry point Reset_Handler hands control to.
Definition at line 164 of file main.c.
References al_geom_hash(), al_panic_halt(), al_print(), al_print_hex(), al_print_uint(), al_setup_or_halt(), k_ahem_ttf, k_ahem_ttf_len, k_al_chapter, k_al_font_px, k_al_ink, k_al_link_col, k_al_view_h, k_al_view_w, k_msg_boot, k_msg_eol, k_msg_fail, k_msg_geom, k_msg_lerr, k_msg_pre, k_ra8_ok, ra8_isr_globals_enable(), reflow_init(), reflow_layout_chapter(), and s_engine.
|
static |
Baked chapter: right, centre, justified, and default-left paragraphs.
Definition at line 61 of file main.c.
Referenced by main().
|
static |
|
static |
|
static |
|
static |
Definition at line 71 of file main.c.
Referenced by erb_render_chapter(), and main().
|
static |