|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Headless on-silicon HIL gate for the raster image decode pipeline (#106). More...
#include <stddef.h>#include <stdint.h>#include "cover_fixture.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_boot_entry.h"#include "ra8_cgc.h"#include "ra8_err.h"#include "ra8_gfx.h"#include "ra8_isr.h"#include "ra8_mstp.h"#include "ra8_time.h"#include "reflow_image.h"Go to the source code of this file.
Enumerations | |
| enum | iv_consts_t : uint32_t { k_iv_fb_w = 160U , k_iv_fb_h = 120U , k_iv_uart_baud = 115200U , k_iv_arena_bytes = 128U * 1024U , k_iv_fnv_offset = 2166136261U , k_iv_fnv_prime = 16777619U , k_iv_hex_nibbles = 8U , k_iv_nibble_bits = 4U , k_iv_nibble_mask = 0x0FU , k_iv_dec_ten = 10U } |
| Framebuffer / console / hash knobs. More... | |
| enum | iv_colors_t : uint32_t { k_iv_col_bg = 0x202028U } |
| 0x00RRGGBB palette. More... | |
Functions | |
| static void | iv_print (const uint8_t *msg, uint32_t len) |
| Emit a byte run on the SCI8 console. | |
| static void | iv_panic_halt (void) |
| Print the init-fail banner and spin (ra8_emulator halts on the BKPT). | |
| static void | iv_print_hex (uint32_t value) |
| Print a 32-bit value as 8 upper-case hex digits. | |
| static void | iv_print_uint (uint32_t value) |
| Print a small unsigned integer in decimal. | |
| static uint32_t | iv_framebuffer_hash (void) |
| FNV-1a-32 over the rendered framebuffer bytes. | |
| static void | iv_setup_or_halt (void) |
| Bring up clocks/MSTP/time + the SCI8 console; halt on failure. | |
| void | main (void) |
| App entry: decode + scale + blit the cover to SRAM, hash it, print. | |
Variables | |
| static uint16_t | s_framebuffer [(size_t) k_iv_fb_h *(size_t) k_iv_fb_w] |
| Fixed RGB565 framebuffer in internal SRAM (no panel attached). | |
| static uint8_t | s_img_arena [k_iv_arena_bytes] |
| Fixed bump arena backing the heap-free PNG decode. | |
| static const uint8_t | k_msg_boot [] = "ereader-img-hil: boot\r\n" |
| static const uint8_t | k_msg_fail [] = "ereader-img-hil: FAIL init\r\n" |
| static const uint8_t | k_msg_derr [] = "ereader-img-hil: FAIL decode\r\n" |
| static const uint8_t | k_msg_pre [] = "ereader-img-hil: img " |
| static const uint8_t | k_msg_x [] = "x" |
| static const uint8_t | k_msg_crc [] = " crc=" |
| static const uint8_t | k_msg_eol [] = "\r\n" |
Headless on-silicon HIL gate for the raster image decode pipeline (#106).
Closes the real-hardware gap for the zero-heap <img> / cover-image pipeline (reflow_image): decode -> nearest-neighbour scale-to-fit -> blit, with no panel / SDRAM / touch / SD dependency. The app:
Folds an FNV-1a-32 hash over the whole framebuffer and prints it on the SCI8 J-Link OB console:
ereader-img-hil: img <W>x<H> crc=<8 hex>
The render is deterministic (integer nearest-neighbour + fixed RGB565 pack + a zeroed static framebuffer), so the hash is identical every boot and – by construction – the same value the identical host / ra8_emulator render produces. Any drift in the decoder, the scale math, or the toolchain output changes the hash and trips the uart_scrape gate.
[Ring 7 / App] {World: NS}
Definition in file main.c.
| enum iv_colors_t : uint32_t |
| enum iv_consts_t : uint32_t |
Framebuffer / console / hash knobs.
|
static |
FNV-1a-32 over the rendered framebuffer bytes.
Definition at line 143 of file main.c.
References k_iv_fnv_offset, k_iv_fnv_prime, and s_framebuffer.
Referenced by main().
|
static |
Print the init-fail banner and spin (ra8_emulator halts on the BKPT).
Definition at line 97 of file main.c.
References iv_print(), and k_msg_fail.
Referenced by iv_setup_or_halt(), and main().
|
static |
Emit a byte run on the SCI8 console.
Definition at line 91 of file main.c.
References ra8_board_uart_console_write().
Referenced by iv_panic_halt(), iv_print_hex(), iv_print_uint(), and main().
|
static |
Print a 32-bit value as 8 upper-case hex digits.
Definition at line 107 of file main.c.
References iv_print(), k_iv_dec_ten, k_iv_hex_nibbles, k_iv_nibble_bits, and k_iv_nibble_mask.
Referenced by main().
|
static |
Print a small unsigned integer in decimal.
Definition at line 119 of file main.c.
References iv_print(), and k_iv_dec_ten.
Referenced by main().
|
static |
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
Definition at line 160 of file main.c.
References iv_panic_halt(), k_iv_uart_baud, 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: decode + scale + blit the cover to SRAM, hash it, print.
The application entry point Reset_Handler hands control to.
Definition at line 185 of file main.c.
References iv_framebuffer_hash(), iv_panic_halt(), iv_print(), iv_print_hex(), iv_print_uint(), iv_setup_or_halt(), k_cover_png, k_cover_png_len, k_iv_arena_bytes, k_iv_col_bg, k_iv_fb_h, k_iv_fb_w, k_msg_boot, k_msg_crc, k_msg_derr, k_msg_eol, k_msg_pre, k_msg_x, k_ra8_gfx_format_rgb565, k_ra8_ok, ra8_gfx_clear(), ra8_gfx_init(), ra8_img_decode_blit(), ra8_isr_globals_enable(), s_framebuffer, and s_img_arena.
|
static |
|
static |
|
static |
|
static |