52typedef enum : uint32_t {
68static const uint8_t
k_msg_boot[] =
"ereader-svg-hil: boot\r\n";
69static const uint8_t
k_msg_fail[] =
"ereader-svg-hil: FAIL init\r\n";
70static const uint8_t
k_msg_size[] =
"ereader-svg-hil: FAIL size\r\n";
71static const uint8_t
k_msg_rerr[] =
"ereader-svg-hil: FAIL render\r\n";
72static const uint8_t
k_msg_pre[] =
"ereader-svg-hil: svg ";
78static void es_print(
const uint8_t* msg, uint32_t len)
87 __asm__
volatile(
"bkpt #0");
89 __asm__
volatile(
"wfi");
99 for (
size_t i = 0U; i < n; i++) {
127 buf[n] = (uint8_t)(
'0' + (value % (uint32_t)
k_es_dec_ten));
131 for (uint32_t i = 0U; i < n; i++) {
139 uint32_t cpuclk0_hz = 0U;
218 __asm__
volatile(
"wfi");
void main(void)
Secure fallback main entry point.
static const uint8_t k_msg_pre[]
static const uint8_t k_msg_ok[]
static const uint8_t k_msg_crc[]
static const uint8_t k_msg_boot[]
static const uint8_t k_msg_fail[]
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 const uint8_t k_msg_x[]
static const uint8_t k_msg_rerr[]
static void es_print_uint(uint32_t value)
Print a small unsigned integer in decimal.
static void es_print(const uint8_t *msg, uint32_t len)
Emit a byte run on the SCI8 console.
es_consts_t
Console / render knobs (no magic numbers).
@ k_es_nibble_mask
Low-nibble mask.
@ k_es_dec_ten
Hex digit / decimal split.
@ k_es_fb_w
Framebuffer width, pixels.
@ k_es_fnv_prime
FNV-1a 32-bit prime.
@ k_es_hex_nibbles
Hex digits in a 32-bit value.
@ k_es_fnv_offset
FNV-1a 32-bit offset basis.
@ k_es_fb_h
Framebuffer height, pixels.
@ k_es_col_bg
Framebuffer clear colour.
@ k_es_nibble_bits
Bits per hex nibble.
@ k_es_uart_baud
Console baud.
static void es_print_hex(uint32_t value)
Print a 32-bit value as 8 upper-case hex digits.
static uint32_t es_framebuffer_hash(void)
FNV-1a hash over the rendered framebuffer.
static const uint8_t k_msg_size[]
static void es_render_svg_or_halt(int32_t *out_w, int32_t *out_h)
Read the SVG intrinsic size and render it into the framebuffer.
static void es_panic_halt(const uint8_t *msg, uint32_t len)
Print the fail banner and trap (ra8_emulator halts on the BKPT).
static void es_setup_or_halt(void)
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
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.
Minimal SVG handling for the reflow ereader (#112).
ra8_err_t ra8_svg_render(const uint8_t *svg, size_t len, int32_t x, int32_t y, int32_t w, int32_t h)
Render an SVG's vector shapes into a box.
ra8_err_t ra8_svg_size(const uint8_t *svg, size_t len, int32_t *out_w, int32_t *out_h)
Report an SVG's intrinsic size (width/height, else viewBox dimensions).
Baked deterministic SVG vector-art fixture for ereader_svg.
static const char k_svg_fixture[]
Baked SVG vector-art document (NUL-terminated ASCII).