ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
main.c File Reference

Hybrid baked + SD e-reader: shelf, cover, TOC, full-book reader. More...

#include <string.h>
#include "miniz.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_display_pal.h"
#include "ra8_display_pal_lcd.h"
#include "ra8_gfx.h"
#include "ra8_gfx_font.h"
#include "ra8_isr.h"
#include "ra8_mstp.h"
#include "ra8_panel_timing.h"
#include "ra8_sdramc.h"
#include "ra8_time.h"
#include "ra8_touch.h"
#include "ra8_wdt.h"
#include "sh_app.h"
Include dependency graph for main.c:

Go to the source code of this file.

Enumerations

enum  sh_main_const_t : uint32_t {
  k_sh_thirds = 3U ,
  k_sh_demo_steps = 8U ,
  k_sh_demo_period = 30U ,
  k_sh_idle_dim_ms = 30000U ,
  k_sh_fnv_offset = 2166136261U ,
  k_sh_fnv_prime = 16777619U ,
  k_sh_hex_digits = 8U ,
  k_sh_nib_bits = 4U ,
  k_sh_nib_mask = 0xFU
}
 Boot + banner formatting constants. More...
enum  sh_demo_t : uint32_t {
  k_sh_demo_cover0 = 0U ,
  k_sh_demo_toc0 = 1U ,
  k_sh_demo_read0 = 2U ,
  k_sh_demo_turn = 3U ,
  k_sh_demo_cover1 = 4U ,
  k_sh_demo_toc1 = 5U ,
  k_sh_demo_cover2 = 6U ,
  k_sh_demo_read2 = 7U
}
 Idle-demo step indices (one screen transition each). More...

Functions

static void sh_print (const uint8_t *msg, uint32_t len)
 Emit a byte run on the SCI8 console.
static uint32_t sh_fb_hash (void)
 FNV-1a hash of the whole framebuffer (deterministic render digest).
static void sh_print_banner (const sh_comic_probe_t *cbz, const sh_comic_probe_t *cbr, bool rtl_ok)
 Emit the gate banner: book count, SD flag, framebuffer hash, comic digests.
static void sh_panic_halt (void)
 Print the fail banner and trap (ra8_emulator halts on the BKPT).
ra8_err_t sh_inflate (const void *src, size_t src_len, void *dst, size_t dst_cap, size_t *out_len)
 Heap-free zlib inflater matching book_inflate_fn (miniz; main.c).
uint16_t * sh_fb_pixels (void)
 The live RGB565 framebuffer ra8_gfx scans (defined in main.c).
static void sh_seed_baked (void)
 Seed the shelf with the MRAM-baked library books.
static int32_t sh_center_x (const char *s)
 Centre a string horizontally for the bitmap font.
static void sh_loading_overlay (const char *name)
 Paint a "Loading from SD card..." panel before a (blocking) SD open.
static bool sh_select_book (uint16_t idx)
 Open the selected book and move to the cover screen; ignore on failure.
static int32_t sh_edge_dir (int32_t x)
 Reader edge-tap to direction: -1 left third, +1 right third, else 0.
static void sh_start_reading (void)
 Start the reader at the book's first prose chapter (past front matter).
static bool sh_tap_cover (int32_t x, int32_t y, bool header)
 Handle a cover-screen tap; returns whether to repaint.
static bool sh_tap_toc (int32_t x, int32_t y, bool header)
 Handle a TOC-screen tap; returns whether to repaint.
static bool sh_tap_reader (int32_t x, int32_t y, bool header)
 Handle a reader-screen tap (header back / edge page turn).
static bool sh_handle_tap (int32_t x, int32_t y)
 Route a touch tap to the active screen; returns whether to repaint.
static bool sh_loupe_held (int32_t x, int32_t y, bool *out_lens_only)
 Held-finger step of the cover loupe gesture: pan an open lens, or open one once the press has been held for k_sh_loupe_hold_ms.
static bool sh_cover_gesture (bool down, int32_t x, int32_t y, bool was_down, bool *out_lens_only)
 Cover-screen press-hold loupe gesture: a hold opens the magnifier, drag pans it, release exits; a short press falls through to the cover tap.
static bool sh_handle_button (bool is_sw2)
 Route an SW1/SW2 edge to the active screen; returns whether to repaint.
static void sh_present (void)
 Re-render the active screen and push it to the panel.
static void sh_present_loupe (void)
 Repaint only the fixed lens window during a loupe pan and flush just it.
static void sh_setup_or_halt (void)
 Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
static void sh_panel_or_halt (void)
 SDRAM + GLCDC panel bring-up; bind ra8_gfx to the live framebuffer.
static void sh_wdt_arm_or_halt (void)
 Arm WDT0 to reset a wedged reader loop; fatal on failure.
static void sh_input_init (void)
 Open touch + the two user buttons (best-effort; input is optional).
static bool sh_pump_input (uint8_t *prev_touch, ra8_board_sw_state_t *prev1, ra8_board_sw_state_t *prev2)
 Poll touch + buttons once; re-present on any change.
static void sh_demo_step (uint32_t step)
 Advance the idle self-demo one step (shelf -> cover -> TOC -> read ...).
static void sh_run (void)
 Run the reader superloop – input pump, opt-in self-demo, watchdog, backlight idle-dim.
void main (void)
 App entry: bring up panel + optional SD, build the shelf, pump input.

Variables

sh_state_t g_sh
 The single whole-app state instance.
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 display_cfg_t k_sh_display_cfg
static display_handle_ts_display
static const uint8_t k_msg_fail [] = "ereader-shelf: FAIL init\r\n"
static tinfl_decompressor s_tinfl
 Static DEFLATE decompressor state (~11 KiB) kept off the small stack.

Detailed Description

Hybrid baked + SD e-reader: shelf, cover, TOC, full-book reader.

The front end of the compiled-book pipeline on the EK-RA8D2 parallel TFT. Books come from two sources tested side by side in one app: a few baked into MRAM (library.h, chunked RBKC containers) and the rest read from a FAT SD card. Either way .rabook books are demand-paged: sh_paged.c binds the chunked reader + ra8_vmem page cache and single chunks inflate into cache frames as they are touched (never the whole book – see #204/#205). The same source-agnostic screens render everything:

shelf (cover-thumbnail grid) -> cover/title page -> table of contents -> reader (every chapter, paginated, page-turn crosses chapter boundaries).

This file owns boot (clocks, console, panel, touch, optional SD), the single g_sh state, the miniz inflate callback, and the input loop that polls the GT911 panel + SW1/SW2 and dispatches to the active screen. Under ra8_emulator, --click X Y drives it, --sd img attaches the card, and --ppm captures a frame.

[Ring 6 / App] {World: NS}

Since
0.1.0

Definition in file main.c.

Enumeration Type Documentation

◆ sh_demo_t

enum sh_demo_t : uint32_t

Idle-demo step indices (one screen transition each).

Enumerator
k_sh_demo_cover0 

Open book 0 on its cover.

k_sh_demo_toc0 

Book 0 table of contents.

k_sh_demo_read0 

Read book 0.

k_sh_demo_turn 

Turn one page.

k_sh_demo_cover1 

Open book 1 cover.

k_sh_demo_toc1 

Book 1 table of contents.

k_sh_demo_cover2 

Open book 2 cover.

k_sh_demo_read2 

Read book 2.

Definition at line 639 of file main.c.

◆ sh_main_const_t

enum sh_main_const_t : uint32_t

Boot + banner formatting constants.

Enumerator
k_sh_thirds 

Reader edge-tap split.

k_sh_demo_steps 

Idle-demo sequence length.

k_sh_demo_period 

Input polls between demo steps.

k_sh_idle_dim_ms 

No-input time before backlight off.

k_sh_fnv_offset 

FNV-1a 32-bit offset basis.

k_sh_fnv_prime 

FNV-1a 32-bit prime.

k_sh_hex_digits 

Hex digits in the framebuffer hash.

k_sh_nib_bits 

Bits per hex digit.

k_sh_nib_mask 

Low-nibble mask.

Definition at line 51 of file main.c.

Function Documentation

◆ main()

void main ( void )

App entry: bring up panel + optional SD, build the shelf, pump input.

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss; SystemInit set VTOR/FPU.
Postcondition
The shelf scans on the panel; taps open books, browse, and read.
Since
0.1.0

Definition at line 750 of file main.c.

References g_sh, k_sh_screen_shelf, ra8_isr_globals_enable(), sh_comic_selfcheck(), sh_input_init(), sh_panel_or_halt(), sh_present(), sh_print_banner(), sh_run(), sh_sd_mount(), sh_sd_scan(), sh_seed_baked(), sh_setup_or_halt(), and sh_shelf_build_thumbs().

◆ sh_center_x()

int32_t sh_center_x ( const char * s)
static

Centre a string horizontally for the bitmap font.

Definition at line 208 of file main.c.

References k_sh_fb_w, k_sh_glyph_w, and strlen().

Referenced by sh_loading_overlay().

◆ sh_cover_gesture()

bool sh_cover_gesture ( bool down,
int32_t x,
int32_t y,
bool was_down,
bool * out_lens_only )
static

Cover-screen press-hold loupe gesture: a hold opens the magnifier, drag pans it, release exits; a short press falls through to the cover tap.

Deferring the cover tap to release is what tells a long press apart from a tap without ever firing both; the reader's page-turn thirds are a different screen and keep their unchanged tap-on-press path.

Parameters
[in]downtrue if a finger is currently down.
[in]xCurrent touch X (press-start X when released).
[in]yCurrent touch Y (press-start Y when released).
[in]was_downtrue if a finger was down on the previous poll.
[out]out_lens_onlyReceives true when only the lens window needs a repaint.
Returns
true if the screen must be re-presented.

Definition at line 396 of file main.c.

References g_sh, k_sh_bar_h, ra8_time_ms(), sh_loupe_held(), and sh_tap_cover().

Referenced by sh_pump_input().

◆ sh_demo_step()

void sh_demo_step ( uint32_t step)
static

Advance the idle self-demo one step (shelf -> cover -> TOC -> read ...).

Runs only until the user touches the panel; lets a headless ra8_emulator –record walk every screen with no input. Wraps to the shelf so the loop is closed.

Definition at line 656 of file main.c.

References g_sh, k_sh_demo_cover0, k_sh_demo_cover1, k_sh_demo_cover2, k_sh_demo_read0, k_sh_demo_read2, k_sh_demo_steps, k_sh_demo_toc0, k_sh_demo_toc1, k_sh_demo_turn, k_sh_screen_toc, sh_reader_turn(), sh_select_book(), and sh_start_reading().

Referenced by sh_run().

◆ sh_edge_dir()

int32_t sh_edge_dir ( int32_t x)
static

Reader edge-tap to direction: -1 left third, +1 right third, else 0.

Definition at line 262 of file main.c.

References k_sh_fb_w, and k_sh_thirds.

Referenced by sh_tap_reader().

◆ sh_fb_hash()

uint32_t sh_fb_hash ( void )
static

FNV-1a hash of the whole framebuffer (deterministic render digest).

Definition at line 89 of file main.c.

References k_sh_fnv_offset, k_sh_fnv_prime, and s_framebuffer.

Referenced by sh_print_banner().

◆ sh_fb_pixels()

uint16_t * sh_fb_pixels ( void )

The live RGB565 framebuffer ra8_gfx scans (defined in main.c).

Definition at line 180 of file main.c.

References s_framebuffer.

Referenced by sh_comic_selfcheck(), and sh_epub_thumb().

◆ sh_handle_button()

bool sh_handle_button ( bool is_sw2)
static

Route an SW1/SW2 edge to the active screen; returns whether to repaint.

Definition at line 421 of file main.c.

References g_sh, k_sh_screen_comic, k_sh_screen_cover, k_sh_screen_reader, k_sh_screen_shelf, k_sh_screen_toc, sh_comic_turn(), sh_reader_turn(), sh_select_book(), sh_start_reading(), and sh_toc_scroll().

Referenced by sh_pump_input().

◆ sh_handle_tap()

bool sh_handle_tap ( int32_t x,
int32_t y )
static

Route a touch tap to the active screen; returns whether to repaint.

Definition at line 329 of file main.c.

References g_sh, k_sh_bar_h, k_sh_screen_comic, k_sh_screen_cover, k_sh_screen_reader, k_sh_screen_shelf, k_sh_screen_toc, sh_comic_tap(), sh_select_book(), sh_shelf_hit(), sh_tap_cover(), sh_tap_reader(), and sh_tap_toc().

Referenced by sh_pump_input().

◆ sh_inflate()

ra8_err_t sh_inflate ( const void * src,
size_t src_len,
void * dst,
size_t dst_cap,
size_t * out_len )

Heap-free zlib inflater matching book_inflate_fn (miniz; main.c).

The chunked reader hands one chunk's zlib stream plus a destination sized to the recorded inflated length, so a single non-wrapping tinfl_decompress() call suffices – no dictionary window, no allocation. tinfl also verifies the stream's Adler-32, which is the per-chunk integrity check the paged open path relies on.

Parameters
[in]srcStart of the zlib stream.
[in]src_lenStream length in bytes.
[out]dstDestination buffer to inflate into.
[in]dst_capCapacity of dst in bytes.
[out]out_lenReceives the number of bytes written to dst.
Returns
k_ra8_ok, or k_ra8_err_invalid_size on a malformed/mismatched stream.
Precondition
src holds one complete zlib (RFC 1950) stream.
Postcondition
On k_ra8_ok the stream's Adler-32 checksum was verified.
Since
0.1.0

Definition at line 160 of file main.c.

References k_ra8_err_invalid_size, k_ra8_ok, and s_tinfl.

Referenced by sh_paged_open().

◆ sh_input_init()

void sh_input_init ( void )
static

Open touch + the two user buttons (best-effort; input is optional).

Definition at line 577 of file main.c.

References k_ra8_board_sw1, k_ra8_board_sw2, k_ra8_touch_irq_pin_unset, k_sh_poll_pts, ra8_board_sw_init(), and ra8_board_touch_open().

Referenced by main().

◆ sh_loading_overlay()

void sh_loading_overlay ( const char * name)
static

Paint a "Loading from SD card..." panel before a (blocking) SD open.

The chunk reads + inflates behind an SD open are synchronous; over ra8_emulator's byte-emulated SPI the first faults (header, metadata, cover chunks) take a while, so this gives immediate feedback instead of a frozen-looking shelf. On hardware the reads are instant.

Definition at line 221 of file main.c.

References display_flush(), k_display_refresh_quality, k_sh_col_bg, k_sh_col_card, k_sh_col_sub, k_sh_fb_h, k_sh_fb_w, k_sh_glyph_h, k_sh_line_h, ra8_gfx_clear(), ra8_gfx_font_8x16, ra8_gfx_text_out(), s_display, and sh_center_x().

Referenced by sh_select_book().

◆ sh_loupe_held()

bool sh_loupe_held ( int32_t x,
int32_t y,
bool * out_lens_only )
static

Held-finger step of the cover loupe gesture: pan an open lens, or open one once the press has been held for k_sh_loupe_hold_ms.

Parameters
[in]xCurrent touch X in framebuffer pixels.
[in]yCurrent touch Y in framebuffer pixels.
[out]out_lens_onlySet true when only the fixed lens window changed.
Returns
true if the screen must be re-presented.

Definition at line 357 of file main.c.

References g_sh, k_sh_loupe_hold_ms, ra8_time_ms(), and sh_cover_loupe_map().

Referenced by sh_cover_gesture().

◆ sh_panel_or_halt()

void sh_panel_or_halt ( void )
static

SDRAM + GLCDC panel bring-up; bind ra8_gfx to the live framebuffer.

Definition at line 525 of file main.c.

References display_get_framebuffer(), display_init(), k_ra8_gfx_format_rgb565, k_ra8_ok, k_sh_display_cfg, k_sh_fb_h, k_sh_fb_w, display_fb_t::pixels, ra8_gfx_init(), ra8_sdramc_init(), s_display, and sh_panic_halt().

Referenced by main().

◆ sh_panic_halt()

void sh_panic_halt ( void )
static

Print the fail banner and trap (ra8_emulator halts on the BKPT).

Definition at line 145 of file main.c.

References k_msg_fail, and sh_print().

Referenced by sh_panel_or_halt(), sh_setup_or_halt(), and sh_wdt_arm_or_halt().

◆ sh_present()

◆ sh_present_loupe()

void sh_present_loupe ( void )
static

Repaint only the fixed lens window during a loupe pan and flush just it.

The lens is a fixed on-screen rectangle; panning changes only the sampled source sub-rect, not the lens position, so the cover beneath is unchanged and never re-decoded – one bounded window read per frame.

Definition at line 496 of file main.c.

References display_flush(), k_display_refresh_quality, k_sh_fb_h, k_sh_fb_w, k_sh_loupe_h, k_sh_loupe_w, s_display, and sh_cover_loupe_render().

Referenced by sh_pump_input().

◆ sh_print()

void sh_print ( const uint8_t * msg,
uint32_t len )
static

Emit a byte run on the SCI8 console.

Definition at line 83 of file main.c.

References ra8_board_uart_console_write().

Referenced by sh_panic_halt(), and sh_print_banner().

◆ sh_print_banner()

void sh_print_banner ( const sh_comic_probe_t * cbz,
const sh_comic_probe_t * cbr,
bool rtl_ok )
static

Emit the gate banner: book count, SD flag, framebuffer hash, comic digests.

The fb= hash digests the rendered SHELF (unchanged by this feature), so the ra8_emulator uart_scrape gate still catches cover-decode / layout regressions. The appended cbz=/cbr=/rtl= fields pin the newly integrated comic decode + RTL path (#236) – a deterministic, toolchain-independent digest of page 0 of the baked CBZ + CBR fixtures decoded through the shelf's own ::comic + image pipeline.

Parameters
[in]cbzCBZ page-0 self-check result.
[in]cbrCBR page-0 self-check result.
[in]rtl_okRTL edge-mapping verdict.

Definition at line 112 of file main.c.

References g_sh, k_sh_dec_base, k_sh_hex_digits, k_sh_linebuf, k_sh_nib_bits, k_sh_nib_mask, sh_comic_append_banner(), sh_fb_hash(), sh_fmt_uint(), and sh_print().

Referenced by main().

◆ sh_pump_input()

bool sh_pump_input ( uint8_t * prev_touch,
ra8_board_sw_state_t * prev1,
ra8_board_sw_state_t * prev2 )
static

◆ sh_run()

void sh_run ( void )
static

Run the reader superloop – input pump, opt-in self-demo, watchdog, backlight idle-dim.

Arms the WWDT, then loops forever: refreshes the watchdog each iteration (a wedged loop underflows the WWDT into a reset), pumps touch/button input, advances the opt-in self-demo (hold SW1 at boot to enable), and blanks or relights the backlight around k_sh_idle_dim_ms of idle. prev1 starts at the boot SW1 state so a held SW1 does not also fire as a button edge; the loop idles in WFI between taps so ra8_emulator fast-forwards.

Precondition
The shelf has been presented and boot is complete (thumbs built, banner printed).
The board switch/touch inputs are initialised.
Postcondition
Does not return – drives the reader until reset.
The watchdog is armed and refreshed on every iteration.
Note
Not thread-safe; the single application superloop.
Since
0.1.0

Definition at line 707 of file main.c.

References k_ra8_board_sw1, k_ra8_board_sw_pressed, k_ra8_board_sw_released, k_ra8_wdt0, k_sh_demo_period, k_sh_idle_dim_ms, k_sh_poll_ms, ra8_board_backlight_set(), ra8_board_sw_read(), ra8_delay_ms(), ra8_time_ms(), ra8_wdt_refresh_for(), sh_demo_step(), sh_present(), sh_pump_input(), and sh_wdt_arm_or_halt().

Referenced by main().

◆ sh_seed_baked()

void sh_seed_baked ( void )
static

◆ sh_select_book()

bool sh_select_book ( uint16_t idx)
static

Open the selected book and move to the cover screen; ignore on failure.

Definition at line 245 of file main.c.

References g_sh, k_sh_screen_comic, k_sh_screen_cover, sh_book_open(), sh_fmt_is_comic(), and sh_loading_overlay().

Referenced by sh_demo_step(), sh_handle_button(), and sh_handle_tap().

◆ sh_setup_or_halt()

void sh_setup_or_halt ( void )
static

Bring up clocks/MSTP/time + the SCI8 console; halt on failure.

Definition at line 507 of file main.c.

References k_ra8_clock_id_cpuclk0, k_ra8_ok, k_sh_uart_baud, ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_mstp_init(), ra8_time_init(), and sh_panic_halt().

Referenced by main().

◆ sh_start_reading()

void sh_start_reading ( void )
static

Start the reader at the book's first prose chapter (past front matter).

Definition at line 275 of file main.c.

References g_sh, k_sh_screen_reader, sh_reader_first_content(), and sh_reader_load_chapter().

Referenced by sh_demo_step(), sh_handle_button(), and sh_tap_cover().

◆ sh_tap_cover()

bool sh_tap_cover ( int32_t x,
int32_t y,
bool header )
static

Handle a cover-screen tap; returns whether to repaint.

Definition at line 282 of file main.c.

References g_sh, k_sh_cover_read, k_sh_cover_toc, k_sh_screen_shelf, k_sh_screen_toc, sh_cover_action(), and sh_start_reading().

Referenced by sh_cover_gesture(), and sh_handle_tap().

◆ sh_tap_reader()

bool sh_tap_reader ( int32_t x,
int32_t y,
bool header )
static

Handle a reader-screen tap (header back / edge page turn).

Definition at line 317 of file main.c.

References g_sh, k_sh_screen_toc, sh_edge_dir(), and sh_reader_turn().

Referenced by sh_handle_tap().

◆ sh_tap_toc()

bool sh_tap_toc ( int32_t x,
int32_t y,
bool header )
static

Handle a TOC-screen tap; returns whether to repaint.

Definition at line 301 of file main.c.

References g_sh, k_sh_screen_cover, k_sh_screen_reader, sh_reader_load_chapter(), and sh_toc_hit().

Referenced by sh_handle_tap().

◆ sh_wdt_arm_or_halt()

void sh_wdt_arm_or_halt ( void )
static

Arm WDT0 to reset a wedged reader loop; fatal on failure.

Configures the M85 WWDT with the longest available count (k_ra8_wdt_timeout_16384 at PCLKB/8192, on the order of a second) and no refresh window (k_ra8_wdt_window_start_100 / k_ra8_wdt_window_end_0) so a heartbeat is legal on any loop iteration. k_ra8_wdt_sleep_keep_count keeps the counter running through the loop's ra8_delay_ms WFI naps, so a spin that never leaves WFI is still caught, and expiry drives an internal reset to reboot a hung reader. Armed once, immediately before the superloop, so the bounded boot (panel + SD + first render) never risks a spurious reset; the first ra8_wdt_refresh_for lands on the next iteration. A bring-up failure is fatal because a reader running without its declared watchdog is a worse state than a clean halt.

Returns
Nothing.
Precondition
sh_setup_or_halt has run, so PCLKB (the WWDT count clock) is live.
Called exactly once (WWDT control registers are write-once after reset).
Postcondition
WDT0 is counting; a missed refresh triggers an internal reset.
Control returns only on success; otherwise the CPU is parked.
Note
Not thread-safe; single-threaded boot only.
Since
0.1.0

Definition at line 561 of file main.c.

References k_ra8_ok, k_ra8_wdt_clkdiv_8192, k_ra8_wdt_on_expiry_reset, k_ra8_wdt_sleep_keep_count, k_ra8_wdt_timeout_16384, k_ra8_wdt_window_end_0, k_ra8_wdt_window_start_100, ra8_wdt_init(), and sh_panic_halt().

Referenced by sh_run().

Variable Documentation

◆ g_sh

◆ k_msg_fail

const uint8_t k_msg_fail[] = "ereader-shelf: FAIL init\r\n"
static

Definition at line 80 of file main.c.

◆ k_sh_display_cfg

const display_cfg_t k_sh_display_cfg
static
Initial value:
= {
.framebuffer = s_framebuffer,
.framebuffer_bytes = sizeof(s_framebuffer),
.width_px = (uint16_t)k_sh_fb_w,
.height_px = (uint16_t)k_sh_fb_h,
.panel_timing = &s_ra8_panel_ek_ra8d2_timing,
}
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).
Definition main.c:67
@ k_display_pixfmt_rgb565
16 bpp, 5/6/5 packed.
const display_backend_iface_t k_display_backend_lcd_ra8_glcdc
LCD backend vtable – pass its address through display_cfg_t.iface to drive the EK-RA8D2 panel.
static const ra8_glcdc_timing_t s_ra8_panel_ek_ra8d2_timing
EK-RA8D2 ER-TFT070-6 RGB timing for ra8_glcdc_init / the LCD backend.
@ k_sh_fb_h
Panel height in pixels.
Definition sh_app.h:47
@ k_sh_fb_w
Panel width in pixels.
Definition sh_app.h:46

Definition at line 69 of file main.c.

Referenced by sh_panel_or_halt().

◆ s_display

◆ s_framebuffer

◆ s_tinfl

tinfl_decompressor s_tinfl
static

Static DEFLATE decompressor state (~11 KiB) kept off the small stack.

Note
Single-threaded use only; reset by tinfl_init() on every inflate.

Definition at line 158 of file main.c.

Referenced by sh_inflate().