31#include "font_fixture.h"
42typedef enum : uint32_t {
62 "<html><body><h1>Schedule</h1>"
64 "<tr><th>Day</th><th>Activity for the morning</th></tr>"
65 "<tr><td>Monday</td><td>Read the first three chapters</td></tr>"
66 "<tr><td>Tuesday</td><td>Notes and a short summary</td></tr>"
67 "<tr><td>Wednesday</td><td>Review and discuss</td></tr>"
69 "<p>Text after the table resumes the normal flow.</p></body></html>";
71static const uint8_t
k_msg_boot[] =
"ereader-table-hil: boot\r\n";
72static const uint8_t
k_msg_fail[] =
"ereader-table-hil: FAIL init\r\n";
73static const uint8_t
k_msg_lerr[] =
"ereader-table-hil: FAIL layout\r\n";
74static const uint8_t
k_msg_pre[] =
"ereader-table-hil: glyphs=";
79static void tb_print(
const uint8_t* msg, uint32_t len)
88 __asm__
volatile(
"bkpt #0");
90 __asm__
volatile(
"wfi");
116 buf[n] = (uint8_t)(
'0' + (value % (uint32_t)
k_tb_dec_ten));
120 for (uint32_t i = 0U; i < n; i++) {
129 const size_t nbytes =
sizeof(int32_t) * 2U;
130 for (uint32_t g = 0U; g <
s_engine.glyph_count; g++) {
132 const uint8_t* p = (
const uint8_t*)coords;
133 for (
size_t i = 0U; i < nbytes; i++) {
143 uint32_t cpuclk0_hz = 0U;
197 __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 reflow_t s_engine
Reflow engine (glyph / page / token / text pools live inside).
static const uint8_t k_msg_eol[]
static const uint8_t k_msg_geom[]
static const uint8_t k_msg_lerr[]
tb_consts_t
Viewport / console / hash knobs (no magic numbers).
@ k_tb_font_px
Body font size, pixels.
@ k_tb_view_h
Layout viewport height, pixels.
@ k_tb_nibble_bits
Bits per hex nibble.
@ k_tb_fnv_prime
FNV-1a-32 prime.
@ k_tb_hex_nibbles
Hex digits in a 32-bit value.
@ k_tb_view_w
Layout viewport width, pixels.
@ k_tb_fnv_offset
FNV-1a-32 offset basis.
@ k_tb_uart_baud
Console baud.
@ k_tb_dec_ten
Hex digit / decimal split.
@ k_tb_nibble_mask
Low-nibble mask.
@ k_tb_link_col
Anchor colour (ARGB).
@ k_tb_ink
Body ink colour (ARGB).
static void tb_print_uint(uint32_t value)
Print a small unsigned integer in decimal.
static void tb_setup_or_halt(void)
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
static uint32_t tb_geom_hash(void)
FNV-1a-32 over every laid-out glyph's (x, y) position.
static void tb_print_hex(uint32_t value)
Print a 32-bit value as 8 upper-case hex digits.
static const char k_tb_chapter[]
Baked chapter: a heading, a 2-column table, and a trailing paragraph.
static void tb_print(const uint8_t *msg, uint32_t len)
Emit a byte run on the SCI8 console.
static void tb_panic_halt(const uint8_t *msg, uint32_t len)
Print the fail banner and trap (ra8_emulator halts on the BKPT).
static const uint8_t k_ahem_ttf[]
Ahem TTF bytes.
static const uint32_t k_ahem_ttf_len
Length of k_ahem_ttf in bytes.
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.
HTML / CSS reflow + paginate engine for the ra8d2 ereader.
ra8_err_t reflow_layout_chapter(reflow_t *engine, const uint8_t *xhtml_buf, size_t xhtml_len, uint32_t *out_total_pages)
Parse + lay out one chapter of XHTML.
ra8_err_t reflow_init(uint16_t viewport_w, uint16_t viewport_h, const uint8_t *font_data, size_t font_len, uint16_t font_px, uint32_t body_color, uint32_t link_color, reflow_t *out_engine)
Initialise a reflow engine for a given viewport / font.
Reflow / pagination engine state.