31#include "font_fixture.h"
44typedef enum : uint32_t {
76 "<html><body><h1>The Machine</h1>"
77 "<p>The Time Traveller was expounding a recondite matter to us. His pale grey "
78 "eyes shone and twinkled, and his usually pale face was flushed and animated.</p>"
79 "<p>The fire burnt brightly, and the soft radiance of the incandescent lights "
80 "caught the bubbles that flashed and passed in our glasses.</p>"
81 "<p>Our chairs, being his patents, embraced and caressed us rather than "
82 "submitted to be sat upon, and there was that luxurious after-dinner "
83 "atmosphere when thought runs gracefully free of the trammels of precision.</p>"
84 "<p>And he put it to us in this way, marking the points with a lean forefinger, "
85 "as we sat and lazily admired his earnestness over this new paradox.</p>"
95static const uint8_t
s_msg_boot[] =
"reflow-content-hil: boot\r\n";
103static const uint8_t
s_msg_fail[] =
"reflow-content-hil: FAIL init\r\n";
111static const uint8_t
s_msg_lerr[] =
"reflow-content-hil: FAIL layout\r\n";
119static const uint8_t
s_msg_pre[] =
"reflow-content-hil: pages=";
179 __asm__
volatile(
"bkpt #0");
181 __asm__
volatile(
"wfi");
229 buf[n] = (uint8_t)(
'0' + (value % (uint32_t)
k_rc_dec_ten));
233 for (uint32_t i = 0U; i < n; i++) {
259 for (uint32_t p = 0U; p < pages; p++) {
263 for (
size_t i = 0U; i < nbytes; i++) {
284 uint32_t cpuclk0_hz = 0U;
358 __asm__
volatile(
"wfi");
void main(void)
Secure fallback main entry point.
static uint16_t s_framebuffer[(size_t) k_panel_height_px *(size_t) k_panel_width_px]
1024x600 RGB565 framebuffer in external SDRAM (GLCDC scans this).
static reflow_t s_engine
Reflow engine (glyph / page / token / text pools live inside).
static const uint8_t s_msg_boot[]
Console marker emitted after core and peripheral setup.
static const uint8_t s_msg_fail[]
Diagnostic emitted when the VFS round-trip fails.
static void internal_rc_print_hex(uint32_t value)
Print a 32-bit value as eight uppercase hexadecimal digits.
static void internal_rc_panic_halt(const uint8_t *msg, uint32_t len)
Emit a failure banner, break into the debugger, and halt.
static const uint8_t s_msg_crc[]
Separator introducing a rendered-framebuffer hash.
static const char s_rc_chapter[]
Fixed multi-paragraph HTML chapter used by both layout passes.
static uint32_t internal_rc_render_all(uint32_t *out_hash)
Render every page of the laid-out chapter; fold an FNV over the output.
static const uint8_t s_msg_pre[]
Prefix for the original page-count diagnostic.
static const uint8_t s_msg_rpages[]
Separator introducing the larger-font page count.
static void internal_rc_print(const uint8_t *msg, uint32_t len)
Emit a byte run on the board UART console.
static void internal_rc_print_uint(uint32_t value)
Print an unsigned 32-bit integer in decimal.
static const uint8_t s_msg_lerr[]
Fatal chapter layout or font-size reflow diagnostic.
static void internal_rc_setup_or_halt(void)
Bring up clocks, module-stop control, timekeeping, and the console.
rc_consts_t
Framebuffer / console / hash / type-size knobs.
@ k_rc_fb_w
Framebuffer width, pixels.
@ k_rc_ink
Body ink colour (ARGB).
@ k_rc_bg
Page background (0x00RRGGBB).
@ k_rc_nibble_bits
Bits per hex nibble.
@ k_rc_fnv_offset
FNV-1a-32 offset basis.
@ k_rc_dec_ten
Hex digit / decimal split.
@ k_rc_reflow_px
Re-flow font size, pixels.
@ k_rc_fnv_prime
FNV-1a-32 prime.
@ k_rc_link_col
Anchor colour (ARGB).
@ k_rc_hex_nibbles
Hex digits in a 32-bit value.
@ k_rc_font_px
Body font size, pixels.
@ k_rc_nibble_mask
Low-nibble mask.
@ k_rc_fb_h
Framebuffer height, pixels.
@ k_rc_uart_baud
Console baud.
static const uint8_t s_msg_eol[]
Console line terminator for the result banner.
static const uint8_t s_ahem_ttf[]
Embedded Ahem TrueType font bytes.
static const uint32_t s_ahem_ttf_len
Exact byte length of s_ahem_ttf.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
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.
Software 2D graphics primitives layered on top of a caller-ownedframebuffer (DRW / D/AVE 2D / GLCDC r...
@ k_ra8_gfx_format_rgb565
16-bit RGB565, little-endian in memory.
ra8_err_t ra8_gfx_clear(uint32_t color)
Fill the bound framebuffer's clip region with a single colour.
ra8_err_t ra8_gfx_init(void *fb, uint16_t width, uint16_t height, ra8_gfx_format_t format)
Bind ra8_gfx to a caller-owned framebuffer.
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_render_page(const reflow_t *engine, uint32_t page_idx, void *framebuffer)
Render one page into the active ra8_gfx framebuffer.
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_set_font_size(reflow_t *engine, uint16_t new_font_px)
Change the body font size and re-flow the cached chapter.
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.
ra8_err_t reflow_get_page_count(const reflow_t *engine, uint32_t *out_count)
Report the laid-out page count.
Reflow / pagination engine state.