53typedef enum : uint32_t {
67typedef enum : uint32_t {
77static const uint8_t
k_msg_boot[] =
"ereader-jpeg-hil: boot\r\n";
78static const uint8_t
k_msg_fail[] =
"ereader-jpeg-hil: FAIL init\r\n";
79static const uint8_t
k_msg_derr[] =
"ereader-jpeg-hil: FAIL decode\r\n";
80static const uint8_t
k_msg_pre[] =
"ereader-jpeg-hil: img ";
91static void iv_print(
const uint8_t* msg, uint32_t len)
100 __asm__
volatile(
"bkpt #0");
102 __asm__
volatile(
"wfi");
128 buf[n] = (uint8_t)(
'0' + (value % (uint32_t)
k_iv_dec_ten));
132 for (uint32_t i = 0U; i < n; i++) {
148 for (
size_t i = 0U; i < n; i++) {
162 uint32_t cpuclk0_hz = 0U;
228 __asm__
volatile(
"wfi");
void main(void)
Secure fallback main entry point.
static const uint8_t k_msg_pre[]
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 uint8_t s_img_arena[k_cm_arena_bytes]
Zero-heap bump arena in SDRAM backing the PNG page decode.
static const uint8_t k_msg_derr[]
static const uint8_t k_msg_x[]
static const uint8_t k_msg_eol[]
static void iv_print_hex(uint32_t value)
Print a 32-bit value as 8 upper-case hex digits.
iv_colors_t
0x00RRGGBB palette.
@ k_iv_col_bg
Framebuffer clear colour (dark slate).
static void iv_print(const uint8_t *msg, uint32_t len)
Emit a byte run on the SCI8 console.
iv_consts_t
Framebuffer / console / hash knobs.
@ k_iv_fnv_prime
FNV-1a-32 prime.
@ k_iv_hex_nibbles
Hex digits in a 32-bit value.
@ k_iv_dec_ten
Hex digit / decimal split.
@ k_iv_arena_bytes
PNG decode scratch, bytes.
@ k_iv_fnv_offset
FNV-1a-32 offset basis.
@ k_iv_uart_baud
Console baud.
@ k_iv_fb_h
Framebuffer height, pixels.
@ k_iv_nibble_mask
Low-nibble mask.
@ k_iv_nibble_bits
Bits per hex nibble.
@ k_iv_fb_w
Framebuffer width, pixels.
static void iv_setup_or_halt(void)
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
static void iv_print_uint(uint32_t value)
Print a small unsigned integer in decimal.
static void iv_panic_halt(void)
Print the init-fail banner and spin (ra8_emulator halts on the BKPT).
static uint32_t iv_framebuffer_hash(void)
FNV-1a-32 over the rendered framebuffer bytes.
Baked 120x90 RGB JPEG test cover for the ereader_jpeg gate.
static const uint32_t k_cover_jpg_len
Length of k_cover_jpg in bytes.
static const uint8_t k_cover_jpg[]
Encoded 120x90 RGB JPEG cover image.
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.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
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.
Zero-heap raster image decode + scale + blit for reflow (#106).
ra8_err_t ra8_img_decode_blit(ra8_img_arena_t *arena, const uint8_t *bytes, size_t len, int32_t dst_x, int32_t dst_y, int32_t box_w, int32_t box_h, int32_t *out_w, int32_t *out_h)
Decode bytes and blit it, scaled to fit, into the bound framebuffer.
Caller-owned bump arena backing a single image decode.