|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Viewable continuous vertical-scroll (longstrip / manhwa) reader (#289). More...
#include <stddef.h>#include <stdint.h>#include "jof.h"#include "longstrip.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_board_ek_ra8d2_touch.h"#include "ra8_boot_entry.h"#include "ra8_cgc.h"#include "ra8_check.h"#include "ra8_display_pal.h"#include "ra8_display_pal_lcd.h"#include "ra8_err.h"#include "ra8_gfx.h"#include "ra8_gfx_font.h"#include "ra8_io_i2c_bus.h"#include "ra8_isr.h"#include "ra8_mstp.h"#include "ra8_panel.h"#include "ra8_panel_timing.h"#include "ra8_sdramc.h"#include "ra8_tile_cache.h"#include "ra8_time.h"#include "ra8_touch.h"Go to the source code of this file.
Data Structures | |
| struct | ls_paint_ctx_t |
| Geometry the procedural band painter needs (tile-cache decode ctx). More... | |
Enumerations | |
| enum | ls_geom_t : uint16_t { k_ls_view_w = k_panel_width_px , k_ls_view_h = k_panel_height_px , k_ls_band_h = 280U , k_ls_bands = 16U , k_ls_status_h = 40U , k_ls_rail_w = 12U , k_ls_text_pad = 16U , k_ls_glyph_w = 8U , k_ls_glyph_h = 16U , k_ls_settle_ms = 500U , k_ls_frame_ms = 20U , k_ls_led_every = 16U } |
| Panel, chrome and strip geometry in pixels. More... | |
| enum | ls_size_t : uint32_t { k_ls_canvas_w = (uint32_t)k_panel_width_px , k_ls_canvas_h = (uint32_t)k_ls_bands * (uint32_t)k_ls_band_h , k_ls_bpp = 3U , k_ls_band_bytes = (uint32_t)k_panel_width_px * (uint32_t)k_ls_band_h * 3U , k_ls_cells = 6U , k_ls_buckets = 16U , k_ls_image_id = 1U , k_ls_scroll_page } |
| 32-bit strip + cache + scroll magnitudes. More... | |
| enum | ls_atlas_t : uint32_t { k_ls_hdr_bytes = 32U , k_ls_ftr_bytes = 16U , k_ls_idx_entry = 8U , k_ls_ftr_magic_off = 12U , k_ls_atlas_total , k_ls_byte_mask = 0xFFU , k_ls_shift_8 = 8U , k_ls_shift_16 = 16U , k_ls_shift_24 = 24U } |
| JOF metadata-only atlas layout (procedural bands -> no pixel region). More... | |
| enum | ls_paint_t : uint32_t { k_ls_grad_lo = 55U , k_ls_grad_span = 45U , k_ls_pct_full = 100U , k_ls_seam_h = 6U , k_ls_seam_level = 0xF0U , k_ls_palette_size = 16U } |
| Procedural band-painter constants. More... | |
| enum | ls_zone_t : uint16_t { k_ls_zone_top = (uint16_t)(k_panel_height_px / 3U) , k_ls_zone_mid = (uint16_t)((k_panel_height_px * 2U) / 3U) } |
| Vertical tap-zone thresholds (thirds of the panel), pixels. More... | |
| enum | ls_color_t : uint32_t { k_ls_col_bg = 0x0A0A12U , k_ls_col_status_bg = 0x101826U , k_ls_col_text = 0xF0F4FFU , k_ls_col_text_dim = 0x8FA0C0U , k_ls_col_rail_bg = 0x263042U , k_ls_col_rail_thumb = 0xF5C542U } |
| Chrome palette, 0x00RRGGBB. More... | |
| enum | ls_rail_t : int32_t { k_ls_rail_min_thumb = 32 } |
| Scroll-rail thumb geometry, pixels. More... | |
| enum | ls_console_t : uint32_t { k_ls_uart_baud = 115200U , k_ls_fnv_offset = 2166136261U , k_ls_fnv_prime = 16777619U , k_ls_hex_nibbles = 8U , k_ls_nibble_bits = 4U , k_ls_nibble_mask = 0x0FU , k_ls_dec_ten = 10U , k_ls_dec_digits = 10U } |
| Console baud + FNV-1a-32 + decimal/hex print knobs. More... | |
| enum | ls_touch_cfg_t : uint8_t { k_ls_touch_max_points = 1U } |
| GT911 touch-controller wiring (IIC_B channel 0, polled). More... | |
Functions | |
| static void | ls_print (const uint8_t *msg, uint32_t len) |
| Emit a byte run on the SCI8 console. | |
| static void | ls_print_hex (uint32_t value) |
| Print a 32-bit value as 8 upper-case hex digits. | |
| static void | ls_print_uint (uint32_t value) |
| Print a small unsigned integer in decimal on the console. | |
| static const char * | ls_utoa (char *buf, uint32_t value) |
| Format an unsigned integer as a NUL-terminated ASCII decimal string. | |
| static void | app_panic_halt (void) |
| Halt forever with the red board LED on (visual sign of fatal init). | |
| static void | app_bringup_clocks (void) |
| Bring up clocks, MSTP, SysTick, the SCI8 console and both LEDs. | |
| static void | app_bringup_panel (void) |
| Bring up external SDRAM + the GLCDC panel, then cache the FB. | |
| static void | app_bringup_gfx (void) |
| Bind ra8_gfx to the panel framebuffer. | |
| static void | app_bringup_touch (void) |
| Open the GT911 touch controller (best-effort, polled; non-fatal). | |
| static void | ls_put_u16 (uint8_t *p, uint16_t v) |
Write a little-endian u16 at p. | |
| static void | ls_put_u32 (uint8_t *p, uint32_t v) |
Write a little-endian u32 at p. | |
| static uint32_t | ls_build_atlas (void) |
| Build the metadata-only JOF band-tile atlas; return its byte length. | |
| static uint8_t | ls_scale_u8 (uint8_t v, uint32_t pct) |
| Scale an 8-bit channel by a 0..100 percentage (saturating at 255). | |
| static void | ls_row_color (uint32_t base, uint32_t r, uint32_t th, uint8_t *rgb) |
| Compute the RGB888 colour of one strip row inside a band. | |
| static ra8_err_t | ls_band_decode (void *ctx, const ra8_tile_key_t *key, uint8_t *cell, uint32_t cell_bytes, uint16_t *out_w, uint16_t *out_h) |
Tile-cache decode-on-miss: paint band key->tile_y procedurally. | |
| static ra8_err_t | ls_blit (void *ctx, const uint8_t *pixels, uint16_t src_w, uint16_t src_h, uint8_t bpp, int32_t dst_x, int32_t dst_y) |
| Longstrip blit sink -> ra8_gfx software blit (RGB888 -> RGB565). | |
| static void | ls_open_strip (uint32_t total) |
| Wire the memstore/painter/cache and open the strip; halt on failure. | |
| static int32_t | ls_text (int32_t x, int32_t y, const char *str, uint32_t color) |
| Draw a text run in the bundled font; return the next x column. | |
| static void | ls_draw_status (void) |
| Draw the status bar overlay: wordmark + band + scroll-position text. | |
| static void | ls_draw_rail (void) |
| Draw the right-edge scroll rail overlay (track + proportional thumb). | |
| static void | ls_redraw (void) |
| Repaint the whole panel: strip bands, then the chrome overlays. | |
| static void | ls_present (void) |
| Present the framebuffer to the panel (clean full refresh). | |
| static uint32_t | ls_hash_fb (void) |
| Fold an FNV-1a-32 over the whole panel framebuffer. | |
| static void | ls_emit_banner (void) |
| Emit the deterministic boot banner (bands, viewport, scroll, FB CRC). | |
| static void | ls_apply_nav (int32_t delta, bool toggle) |
| Apply one navigation action, redrawing + presenting if state changed. | |
| static void | ls_handle_tap (int32_t y) |
| Map a tap Y coordinate to a navigation action (tap-zone hit-test). | |
| static void | ls_poll_touch (void) |
| Poll the touch controller; dispatch one tap per delivered GT911 frame. | |
| static void | ls_poll_buttons (void) |
| Poll SW1/SW2 and page up/down on a fresh press (button fallback). | |
| void | main (void) |
| App entry: bring up the panel, build the strip, run the reader loop. | |
Variables | |
| static const char *const | s_tag = "ereader_longstrip" |
| Component tag for RA8_CHECK_* log lines. | |
| static const uint32_t | k_ls_palette [k_ls_palette_size] |
| Vivid 16-hue band palette (0x00RRGGBB) – distinct so scroll is obvious. | |
| static uint16_t | s_framebuffer [(size_t) k_ls_view_h *(size_t) k_ls_view_w] |
| RGB565 panel framebuffer in external SDRAM, AXI-burst aligned. | |
| static uint8_t | s_cells [(size_t) k_ls_cells *(size_t) k_ls_band_bytes] |
| Tile-cache cell storage in SDRAM (one decoded band per cell). | |
| static uint8_t | s_atlas [k_ls_atlas_total] |
| Metadata-only JOF atlas backing (header + index + footer). | |
| static ra8_tile_key_t | s_keys [(size_t) k_ls_cells] |
| Cache key storage. | |
| static ra8_tile_dims_t | s_dims [(size_t) k_ls_cells] |
| Cache dim storage. | |
| static ra8_keycache_cell_t | s_meta [(size_t) k_ls_cells] |
| Cache link metadata. | |
| static int32_t | s_buckets [(size_t) k_ls_buckets] |
| Cache hash buckets. | |
| static jof_memstore_t | s_store |
| Atlas backing-read seam. | |
| static ra8_tile_cache_t | s_cache |
| Band cache (procedural decode). | |
| static longstrip_t | s_strip |
| Opened longstrip scroll state. | |
| static ls_paint_ctx_t | s_paint |
| Painter context bound as the tile cache's decode ctx. | |
| static const display_cfg_t | k_ls_display_cfg |
| Display-PAL config: LCD/GLCDC backend over the SDRAM framebuffer. | |
| static display_handle_t * | s_display = nullptr |
| PAL handle returned by display_init. | |
| static display_fb_t | s_fb |
| Mutable copy of the FB descriptor populated at boot. | |
| static bool | s_chrome = true |
| True while the status bar + scroll rail chrome is shown. | |
| static uint16_t | s_last_skipped = 0U |
| Skipped-band count from the last render (must stay 0: #289 contract). | |
| static bool | s_was_sw1 = false |
| Edge-detect: was SW1 held on the previous button poll. | |
| static bool | s_was_sw2 = false |
| Edge-detect: was SW2 held on the previous button poll. | |
| volatile uint32_t | g_ls_loop_ticks = 0U |
| Free-running main-loop counter – HIL/liveness probe symbol. | |
| volatile uint32_t | g_ls_scroll_y = 0U |
| Current scroll position (px) mirrored for --dump-sym telemetry. | |
| volatile uint32_t | g_ls_redraws = 0U |
| Count of full redraws since boot – render-progress telemetry. | |
| volatile uint32_t | g_ls_frame_crc = 0U |
| FNV-1a-32 over the panel FB at the boot banner (render fingerprint). | |
| static const uint8_t | k_msg_boot [] = "ereader-longstrip: boot\r\n" |
| Boot / banner literals (SCI8). | |
| static const uint8_t | k_msg_pre [] = "ereader-longstrip: bands=" |
| static const uint8_t | k_msg_view [] = " view=" |
| static const uint8_t | k_msg_x [] = "x" |
| static const uint8_t | k_msg_scroll [] = " scroll=" |
| static const uint8_t | k_msg_crc [] = " crc=" |
| static const uint8_t | k_msg_eol [] = "\r\n" |
Viewable continuous vertical-scroll (longstrip / manhwa) reader (#289).
The #289 continuous vertical-scroll engine (longstrip) made VIEWABLE on the stock EK-RA8D2 1024x600 GLCDC panel: the headless sibling scrolled a strip into a 160x120 scratch buffer and printed a CRC; this app binds the engine's band-composite blit sink to the LIVE panel framebuffer, so ra8_emulator's --view window (or a --ppm capture) shows the reader screen.
Pipeline: boot clocks/MSTP/SysTick/console/LEDs, bring up external SDRAM + the 1024x600 RGB565 GLCDC panel via ra8_display_pal (k_display_backend_lcd_ra8_glcdc), bind ra8_gfx to the panel FB, then build a tall colourful strip as a JOF band-tile atlas (jof, one full-width band column). Only the atlas header + index + footer are materialised (~176 bytes); each band's pixels are painted PROCEDURALLY on a cache miss (a vivid palette hue + a top->bottom brightness gradient + a white seam stripe at every band edge, so scrolling is obviously visible), which keeps boot instant and needs no multi-megabyte pixel buffer while still exercising the real streaming path: bands page through a deliberately small ra8_tile_cache (fewer cells than bands, so the LRU must evict – the #147 bounded-memory property) and longstrip_render composites the visible range into the panel FB through ra8_gfx_blit.
Navigation is discrete-tap only (the ra8_emulator GT911 model has no swipe/drag gesture, so this app needs zero ra8_emulator change): a tap in the BOTTOM third pages down, the TOP third pages up, the CENTRE third toggles the chrome (status bar + scroll rail); SW1/SW2 page down/up as a button fallback. A deterministic boot banner (band count, viewport, initial scroll, FNV-1a-32 over the panel FB) is emitted over SCI8 so the headless EIL / smoke gate still asserts a stable render, and g_ls_loop_ticks feeds the jlink liveness probe.
Definition in file main.c.
| enum ls_atlas_t : uint32_t |
JOF metadata-only atlas layout (procedural bands -> no pixel region).
jof_parse reads only the header + footer and validates index_off + tiles*8 + 16 == total, never the pixel bytes, so the index is placed immediately after the header and the whole atlas is just header + index + footer. Band pixels are synthesised on demand by ls_band_decode, so no pixel region is stored.
| enum ls_color_t : uint32_t |
| enum ls_console_t : uint32_t |
Console baud + FNV-1a-32 + decimal/hex print knobs.
| enum ls_geom_t : uint16_t |
Panel, chrome and strip geometry in pixels.
The viewport is the whole panel; the status bar and scroll rail are chrome OVERLAYS drawn on top of the strip, so toggling them off lets the strip fill the full 1024x600 panel.
| enum ls_paint_t : uint32_t |
Procedural band-painter constants.
| enum ls_rail_t : int32_t |
| enum ls_size_t : uint32_t |
32-bit strip + cache + scroll magnitudes.
| enum ls_touch_cfg_t : uint8_t |
| enum ls_zone_t : uint16_t |
|
static |
Bring up clocks, MSTP, SysTick, the SCI8 console and both LEDs.
Definition at line 414 of file main.c.
References app_panic_halt(), k_ls_uart_baud, k_ra8_board_led_blue, k_ra8_board_led_red, k_ra8_clock_id_cpuclk0, k_ra8_ok, ra8_board_led_init(), ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_isr_globals_enable(), ra8_mstp_init(), and ra8_time_init().
Referenced by main().
|
static |
Bind ra8_gfx to the panel framebuffer.
Definition at line 452 of file main.c.
References app_panic_halt(), k_ra8_gfx_format_rgb565, k_ra8_ok, ra8_gfx_init(), and s_fb.
Referenced by main().
|
static |
Bring up external SDRAM + the GLCDC panel, then cache the FB.
Definition at line 437 of file main.c.
References app_panic_halt(), display_get_framebuffer(), display_init(), k_ls_display_cfg, k_ls_settle_ms, k_ra8_ok, ra8_delay_ms(), ra8_sdramc_init(), s_display, and s_fb.
Referenced by main().
|
static |
Open the GT911 touch controller (best-effort, polled; non-fatal).
Definition at line 461 of file main.c.
References k_ls_touch_max_points, k_ra8_touch_irq_pin_unset, and ra8_board_touch_open().
Referenced by main().
|
static |
Halt forever with the red board LED on (visual sign of fatal init).
Definition at line 405 of file main.c.
References k_ra8_board_led_red, and ra8_board_led_on().
Referenced by app_bringup_clocks(), app_bringup_display(), app_bringup_gfx(), app_bringup_panel(), and ls_open_strip().
|
static |
Apply one navigation action, redrawing + presenting if state changed.
| [in] | delta | Scroll delta (px, +down/-up); ignored when toggle is set. |
| [in] | toggle | True to toggle the chrome overlay instead of scrolling. |
Definition at line 841 of file main.c.
References longstrip_scroll_by(), ls_present(), ls_redraw(), s_chrome, and s_strip.
Referenced by ls_handle_tap(), and ls_poll_buttons().
|
static |
Tile-cache decode-on-miss: paint band key->tile_y procedurally.
| [in] | ctx | A ls_paint_ctx_t*. |
| [in] | key | Band to paint (tile_y = band index). |
| [out] | cell | Destination cell pixels. |
| [in] | cell_bytes | Cell capacity in bytes. |
| [out] | out_w | Receives the band width, pixels. |
| [out] | out_h | Receives the band height, pixels (clamped for the last). |
| k_ra8_ok | Band painted into cell. |
| k_ra8_err_null_ptr | A required pointer is NULL. |
| k_ra8_err_out_of_range | The band payload exceeds cell_bytes. |
Definition at line 602 of file main.c.
References ls_paint_ctx_t::band_h, ls_paint_ctx_t::bpp, ls_paint_ctx_t::canvas_h, k_ls_bpp, k_ls_palette, k_ls_palette_size, k_ra8_err_out_of_range, k_ra8_ok, ls_row_color(), RA8_CHECK_NULL_PTR, s_tag, ra8_tile_key_t::tile_y, and ls_paint_ctx_t::width.
Referenced by ls_open_strip().
|
static |
Longstrip blit sink -> ra8_gfx software blit (RGB888 -> RGB565).
| [in] | ctx | Unused sink context. |
| [in] | pixels | Decoded band pixels (RGB888, row-major). |
| [in] | src_w | Band width, pixels. |
| [in] | src_h | Band height, pixels. |
| [in] | bpp | Bytes per pixel (unused: strip is RGB888). |
| [in] | dst_x | Destination left in the framebuffer. |
| [in] | dst_y | Destination top in the framebuffer (may be negative). |
pixels is NULL. Definition at line 701 of file main.c.
References k_ra8_gfx_format_rgb888, RA8_CHECK_NULL_PTR, ra8_gfx_blit(), and s_tag.
Referenced by ls_open_strip().
|
static |
Build the metadata-only JOF band-tile atlas; return its byte length.
Emits only the header, the tile index (immediately after the header, so there is no pixel region) and the footer. jof_parse validates index_off + tiles*8 + 16 == total and never reads the pixel bytes, so the strip parses with band pixels supplied later by ls_band_decode.
Definition at line 503 of file main.c.
References k_jof_codec_raw, k_ls_atlas_total, k_ls_band_h, k_ls_bands, k_ls_bpp, k_ls_canvas_h, k_ls_canvas_w, k_ls_ftr_magic_off, k_ls_hdr_bytes, k_ls_idx_entry, ls_put_u16(), ls_put_u32(), and s_atlas.
Referenced by main().
|
static |
Draw the right-edge scroll rail overlay (track + proportional thumb).
Definition at line 757 of file main.c.
References k_ls_canvas_h, k_ls_col_rail_bg, k_ls_col_rail_thumb, k_ls_rail_min_thumb, k_ls_rail_w, k_ls_view_h, k_ls_view_w, ra8_gfx_rect(), and s_strip.
Referenced by ls_redraw().
|
static |
Draw the status bar overlay: wordmark + band + scroll-position text.
Definition at line 728 of file main.c.
References k_ls_bands, k_ls_col_status_bg, k_ls_col_text, k_ls_col_text_dim, k_ls_dec_digits, k_ls_glyph_h, k_ls_pct_full, k_ls_status_h, k_ls_text_pad, k_ls_view_w, ls_text(), ls_utoa(), ra8_gfx_rect(), s_last_skipped, and s_strip.
Referenced by ls_redraw().
|
static |
Emit the deterministic boot banner (bands, viewport, scroll, FB CRC).
Definition at line 813 of file main.c.
References g_ls_frame_crc, k_ls_bands, k_ls_view_h, k_ls_view_w, k_msg_crc, k_msg_eol, k_msg_pre, k_msg_scroll, k_msg_view, k_msg_x, ls_hash_fb(), ls_print(), ls_print_hex(), ls_print_uint(), and s_strip.
Referenced by main().
|
static |
Map a tap Y coordinate to a navigation action (tap-zone hit-test).
| [in] | y | Panel Y coordinate of the contact (pixels). |
Definition at line 862 of file main.c.
References k_ls_scroll_page, k_ls_zone_mid, k_ls_zone_top, and ls_apply_nav().
Referenced by ls_poll_touch().
|
static |
Fold an FNV-1a-32 over the whole panel framebuffer.
Definition at line 801 of file main.c.
References k_ls_fnv_offset, k_ls_fnv_prime, and s_framebuffer.
Referenced by ls_emit_banner().
|
static |
Wire the memstore/painter/cache and open the strip; halt on failure.
Definition at line 654 of file main.c.
References app_panic_halt(), jof_memstore_pread(), k_ls_atlas_total, k_ls_band_bytes, k_ls_band_h, k_ls_bpp, k_ls_buckets, k_ls_canvas_h, k_ls_canvas_w, k_ls_cells, k_ls_image_id, k_ls_view_h, k_ls_view_w, k_ra8_ok, longstrip_open(), ls_band_decode(), ls_blit(), ra8_tile_cache_init(), s_atlas, s_buckets, s_cache, s_cells, s_dims, s_keys, s_meta, s_paint, s_store, and s_strip.
Referenced by main().
|
static |
Poll SW1/SW2 and page up/down on a fresh press (button fallback).
Definition at line 899 of file main.c.
References k_ls_scroll_page, k_ra8_board_sw1, k_ra8_board_sw2, k_ra8_board_sw_pressed, k_ra8_ok, ls_apply_nav(), ra8_board_sw_read(), s_was_sw1, and s_was_sw2.
Referenced by main().
|
static |
Poll the touch controller; dispatch one tap per delivered GT911 frame.
Each drained GT911 frame is treated as one discrete tap. The GT911 reports a fresh "ready" frame on every poll while a contact is present (and ra8_emulator serves one queued --touch-seq tap per read with no interposed release), so a rising-edge gate would collapse a whole tap sequence into a single action; acting per delivered frame makes each queued tap page independently. There is no swipe/drag model, so navigation stays purely discrete-tap.
Definition at line 886 of file main.c.
References k_ls_touch_max_points, k_ra8_ok, ls_handle_tap(), ra8_touch_read(), and ra8_touch_point_t::y.
Referenced by main().
|
static |
Present the framebuffer to the panel (clean full refresh).
Definition at line 795 of file main.c.
References display_flush(), display_full_rect(), k_display_refresh_quality, and s_display.
Referenced by ls_apply_nav(), and main().
|
static |
Emit a byte run on the SCI8 console.
Definition at line 336 of file main.c.
References ra8_board_uart_console_write().
Referenced by ls_emit_banner(), ls_print_hex(), ls_print_uint(), and main().
|
static |
Print a 32-bit value as 8 upper-case hex digits.
Definition at line 342 of file main.c.
References k_ls_dec_ten, k_ls_hex_nibbles, k_ls_nibble_bits, k_ls_nibble_mask, and ls_print().
Referenced by ls_emit_banner().
|
static |
Print a small unsigned integer in decimal on the console.
Definition at line 354 of file main.c.
References k_ls_dec_digits, k_ls_dec_ten, and ls_print().
Referenced by ls_emit_banner().
|
static |
Write a little-endian u16 at p.
Definition at line 476 of file main.c.
References k_ls_byte_mask, and k_ls_shift_8.
Referenced by ls_build_atlas().
|
static |
Write a little-endian u32 at p.
Definition at line 483 of file main.c.
References k_ls_byte_mask, k_ls_shift_16, k_ls_shift_24, and k_ls_shift_8.
Referenced by ls_build_atlas().
|
static |
Repaint the whole panel: strip bands, then the chrome overlays.
Definition at line 779 of file main.c.
References g_ls_redraws, g_ls_scroll_y, k_ls_col_bg, longstrip_render(), ls_draw_rail(), ls_draw_status(), ra8_gfx_clear(), ra8_gfx_reset_clip(), s_chrome, s_last_skipped, s_strip, and longstrip_render_stats_t::skipped.
Referenced by ls_apply_nav(), and main().
|
static |
Compute the RGB888 colour of one strip row inside a band.
Rows in the seam stripe (r < k_ls_seam_h) are a bright neutral so band boundaries read as crisp lines; the rest is the band's palette hue on a top(dim)->bottom(full) brightness gradient, so vertical motion is visible even within one hue.
| [in] | base | Band base colour (0x00RRGGBB). |
| [in] | r | Row index within the band. |
| [in] | th | Band height in rows (>= 1). |
| [out] | rgb | Receives the row's R,G,B bytes (3 bytes). |
Definition at line 569 of file main.c.
References k_ls_byte_mask, k_ls_grad_lo, k_ls_grad_span, k_ls_seam_h, k_ls_seam_level, k_ls_shift_16, k_ls_shift_8, and ls_scale_u8().
Referenced by ls_band_decode().
|
static |
Scale an 8-bit channel by a 0..100 percentage (saturating at 255).
Definition at line 550 of file main.c.
References k_ls_pct_full.
Referenced by ls_row_color().
|
static |
Draw a text run in the bundled font; return the next x column.
Definition at line 716 of file main.c.
References k_ls_col_status_bg, k_ra8_ok, ra8_gfx_font_8x16, ra8_gfx_text_out(), and ra8_gfx_text_size().
Referenced by ls_draw_status().
|
static |
Format an unsigned integer as a NUL-terminated ASCII decimal string.
| [out] | buf | Destination (at least k_ls_dec_digits + 1 bytes). |
| [in] | value | Value to format. |
buf. Definition at line 379 of file main.c.
References k_ls_dec_digits, and k_ls_dec_ten.
Referenced by ls_draw_status().
| void main | ( | void | ) |
App entry: bring up the panel, build the strip, run the reader loop.
The application entry point Reset_Handler hands control to.
Definition at line 930 of file main.c.
References app_bringup_clocks(), app_bringup_gfx(), app_bringup_panel(), app_bringup_touch(), g_ls_loop_ticks, k_ls_frame_ms, k_ls_led_every, k_msg_boot, k_ra8_board_led_blue, k_ra8_board_sw1, k_ra8_board_sw2, ls_build_atlas(), ls_emit_banner(), ls_open_strip(), ls_poll_buttons(), ls_poll_touch(), ls_present(), ls_print(), ls_redraw(), ra8_board_led_toggle(), ra8_board_sw_init(), and ra8_delay_ms().
| volatile uint32_t g_ls_frame_crc = 0U |
FNV-1a-32 over the panel FB at the boot banner (render fingerprint).
Definition at line 319 of file main.c.
Referenced by ls_emit_banner().
| volatile uint32_t g_ls_loop_ticks = 0U |
| volatile uint32_t g_ls_redraws = 0U |
Count of full redraws since boot – render-progress telemetry.
Definition at line 317 of file main.c.
Referenced by ls_redraw().
| volatile uint32_t g_ls_scroll_y = 0U |
Current scroll position (px) mirrored for --dump-sym telemetry.
Definition at line 315 of file main.c.
Referenced by ls_redraw().
|
static |
Display-PAL config: LCD/GLCDC backend over the SDRAM framebuffer.
Definition at line 289 of file main.c.
Referenced by app_bringup_panel().
|
static |
Vivid 16-hue band palette (0x00RRGGBB) – distinct so scroll is obvious.
Definition at line 229 of file main.c.
Referenced by ls_band_decode().
|
static |
|
static |
Definition at line 328 of file main.c.
Referenced by iic_print_banner(), imp_panic(), imp_run(), imp_walk_book(), ls_emit_banner(), and main().
|
static |
|
static |
Definition at line 326 of file main.c.
Referenced by ls_emit_banner().
|
static |
Definition at line 324 of file main.c.
Referenced by ls_emit_banner(), and mg_print_banner().
|
static |
Metadata-only JOF atlas backing (header + index + footer).
Definition at line 262 of file main.c.
Referenced by ls_build_atlas(), and ls_open_strip().
|
static |
Cache hash buckets.
Definition at line 267 of file main.c.
Referenced by ez_setup_scene(), ls_open_strip(), and mg_setup_cache().
|
static |
Band cache (procedural decode).
Definition at line 270 of file main.c.
Referenced by ls_open_strip(), main(), and mg_setup_cache().
|
static |
Tile-cache cell storage in SDRAM (one decoded band per cell).
Definition at line 259 of file main.c.
Referenced by ls_open_strip().
|
static |
True while the status bar + scroll rail chrome is shown.
Definition at line 304 of file main.c.
Referenced by ls_apply_nav(), ls_redraw(), and wd_state_init().
|
static |
Cache dim storage.
Definition at line 265 of file main.c.
Referenced by ez_setup_scene(), ls_open_strip(), and mg_setup_cache().
|
static |
|
static |
|
static |
|
static |
Cache key storage.
Definition at line 264 of file main.c.
Referenced by ez_setup_scene(), ls_open_strip(), and mg_setup_cache().
|
static |
Skipped-band count from the last render (must stay 0: #289 contract).
Definition at line 306 of file main.c.
Referenced by ls_draw_status(), and ls_redraw().
|
static |
Cache link metadata.
Definition at line 266 of file main.c.
Referenced by ez_setup_scene(), ls_open_strip(), and mg_setup_cache().
|
static |
Painter context bound as the tile cache's decode ctx.
Definition at line 286 of file main.c.
Referenced by ls_open_strip().
|
static |
Atlas backing-read seam.
Definition at line 269 of file main.c.
Referenced by ls_open_strip(), mg_build_atlas(), and mg_setup_cache().
|
static |
Opened longstrip scroll state.
Definition at line 271 of file main.c.
Referenced by ez_setup_scene(), ls_apply_nav(), ls_draw_rail(), ls_draw_status(), ls_emit_banner(), ls_open_strip(), and ls_redraw().
|
static |
|
static |
Edge-detect: was SW1 held on the previous button poll.
Definition at line 308 of file main.c.
Referenced by er_poll_buttons(), ls_poll_buttons(), and wd_poll_buttons().
|
static |
Edge-detect: was SW2 held on the previous button poll.
Definition at line 310 of file main.c.
Referenced by er_poll_buttons(), ls_poll_buttons(), and wd_poll_buttons().