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

Nested ra8_widget tree composited on the live GLCDC panel (#145). More...

#include <stddef.h>
#include <stdint.h>
#include "ra8_board_ek_ra8d2.h"
#include "ra8_boot_entry.h"
#include "ra8_box.h"
#include "ra8_cgc.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_glcdc.h"
#include "ra8_isr.h"
#include "ra8_mstp.h"
#include "ra8_panel.h"
#include "ra8_panel_timing.h"
#include "ra8_time.h"
#include "ra8_ui.h"
#include "ra8_widget.h"
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  wc_status_ctx_t
 Status-bar state: the live frame counter it renders. More...
struct  wc_tile_ctx_t
 One body tile: a label over a coloured fill + a render counter. More...

Enumerations

enum  wc_geom_t : uint16_t {
  k_wc_fb_w = 512U ,
  k_wc_fb_h = 512U ,
  k_wc_status_h = 44U ,
  k_wc_footer_h = 28U ,
  k_wc_pad = 8U ,
  k_wc_line_h = 18U ,
  k_wc_tile_gap = 6U
}
 Framebuffer + band geometry (no magic numbers). More...
enum  wc_color_t : uint32_t {
  k_wc_col_clear = 0x000008U ,
  k_wc_col_status_bg = 0x1E2A40U ,
  k_wc_col_footer_bg = 0x14141AU ,
  k_wc_col_left_bg = 0x102038U ,
  k_wc_col_right_bg = 0x382414U ,
  k_wc_col_text = 0xFFFFFFU ,
  k_wc_col_dim = 0xA0A0B0U
}
 0xRRGGBB palette (ra8_gfx packs to RGB565). More...
enum  wc_widget_idx_t : uint16_t {
  k_wc_w_status = 0U ,
  k_wc_w_body = 1U ,
  k_wc_w_footer = 2U ,
  k_wc_root_n = 3U ,
  k_wc_root_cap = 4U ,
  k_wc_w_left = 0U ,
  k_wc_w_right = 1U ,
  k_wc_body_n = 2U ,
  k_wc_body_cap = 3U
}
 Index of each widget within its parent array. More...
enum  wc_console_t : uint32_t {
  k_wc_uart_baud = 115200U ,
  k_wc_frame_ms = 500U ,
  k_wc_fnv_offset = 2166136261U ,
  k_wc_fnv_prime = 16777619U ,
  k_wc_hex_nibbles = 8U ,
  k_wc_nibble_bits = 4U ,
  k_wc_nibble_mask = 0x0FU ,
  k_wc_dec_ten = 10U ,
  k_wc_frame_buf = 24U
}
 Console baud + text-format constants. More...

Functions

static void wc_print (const uint8_t *msg, uint32_t len)
 Emit a byte run on the board console.
static void wc_fail_halt (const uint8_t *msg, uint32_t len)
 Print a fail banner and park forever in WFI.
static void wc_print_hex (uint32_t value)
 Print value as 8 uppercase hex digits.
static void wc_print_uint (uint32_t value)
 Print a small unsigned integer in decimal.
static uint32_t wc_framebuffer_hash (void)
 FNV-1a-32 over the composited framebuffer bytes.
static void wc_fmt_frame (char *buf, uint32_t frame)
 Format "frame=<n>" into buf (>= k_wc_frame_buf bytes, NUL-term).
static void wc_status_render (ra8_widget_t *w)
 Status-bar render: fill + title over the live frame counter.
static void wc_tile_render (ra8_widget_t *w)
 Body-tile render: fill + label + a per-tile render counter.
static void wc_footer_render (ra8_widget_t *w)
 Footer render: fill + a one-line hint.
static void wc_leaf_init (ra8_widget_t *w, const ra8_widget_vtable_t *vt, void *ctx, int16_t fixed, uint16_t flex)
 Build a leaf widget bound to a vtable + context.
static bool wc_build_tree (void)
 Assemble the nested widget tree; return false on a bind error.
static void wc_invalidate_all (ra8_widget_refresh_t refresh)
 Mark every root child dirty so the next compose repaints the tree.
static ra8_err_t wc_compose (ra8_ui_rect_t *dmg, ra8_widget_refresh_t *hint, uint16_t *dirty)
 Compose the tree into the framebuffer; report the flush rect.
static bool wc_panel_up (void)
 Bring up the GLCDC panel and bind ra8_gfx to its framebuffer.
static display_refresh_hint_t wc_map_hint (ra8_widget_refresh_t hint)
 Map a widget refresh hint to the display PAL refresh hint.
static void wc_flush_rect (const ra8_ui_rect_t *dmg, ra8_widget_refresh_t hint)
 Flush only dmg to the panel with the mapped refresh hint.
static bool wc_check_full (uint32_t *out_crc, uint16_t *out_dirty)
 Assert the full compose: 3 dirty, full-frame quality, tiles drawn.
static bool wc_check_partial (uint32_t *out_crc, uint16_t *out_dirty)
 Assert the partial compose: status-only damage, tiles untouched.
static bool wc_selfcheck (uint32_t *crc0, uint16_t *d0, uint32_t *crc1, uint16_t *d1)
 Run the whole deterministic surface; return both composites' CRCs.
static void wc_setup_or_halt (void)
 Bring up clocks/MSTP/time and the console.
static void wc_print_banner (uint16_t d0, uint32_t crc0, uint16_t d1, uint32_t crc1)
 Emit the PASS banner once every self-check assertion holds.
static void wc_tick_live (void)
 Advance the frame counter and partial-flush only the status band.
void main (void)
 App entry: bring the panel up, self-check, then run the live loop.

Variables

static uint16_t s_framebuffer [(uint32_t) k_wc_fb_w *(uint32_t) k_wc_fb_h]
 GLCDC-scanned render target in SRAM, AXI-burst aligned.
static wc_status_ctx_t s_status = {.frame = 0U, .renders = 0U}
static wc_tile_ctx_t s_left = {.label = "Left widget", .bg = (uint32_t)k_wc_col_left_bg}
static wc_tile_ctx_t s_right = {.label = "Right widget", .bg = (uint32_t)k_wc_col_right_bg}
static ra8_widget_t s_root_kids [k_wc_root_n]
 [status, body, footer].
static ra8_widget_t s_body_kids [k_wc_body_n]
 [left tile, right tile].
static ra8_box_t s_body_scratch [k_wc_body_cap]
 Body layout scratch.
static ra8_box_t s_root_scratch [k_wc_root_cap]
 Root layout scratch.
static ra8_widget_panel_t s_body_panel
 Body row-panel descriptor (the nested panel).
static ra8_widget_panel_t s_root_panel
 Root column-panel descriptor.
static ra8_widget_t s_root
 The root panel widget (composed each frame).
static display_handle_ts_display = nullptr
 Live display handle once the GLCDC panel is up.
static const uint8_t k_wc_msg_boot [] = "widget-compose-demo: boot\r\n"
static const uint8_t k_wc_msg_finit [] = "widget-compose-demo: FAIL init\r\n"
static const uint8_t k_wc_msg_fpanl [] = "widget-compose-demo: FAIL panel\r\n"
static const uint8_t k_wc_msg_ftree [] = "widget-compose-demo: FAIL tree\r\n"
static const uint8_t k_wc_msg_fchk [] = "widget-compose-demo: FAIL selfcheck\r\n"
static const uint8_t k_wc_msg_pre [] = "widget-compose-demo: dirty0="
static const uint8_t k_wc_msg_crc0 [] = " crc0="
static const uint8_t k_wc_msg_d1 [] = " dirty1="
static const uint8_t k_wc_msg_crc1 [] = " crc1="
static const uint8_t k_wc_msg_tail [] = " flush=512x44 hint=fast"
static const uint8_t k_wc_msg_pass [] = " PASS\r\n"
static const ra8_widget_vtable_t k_wc_status_vt
 Status / footer / tiles are display-only (NULL on_input).
static const ra8_widget_vtable_t k_wc_tile_vt
static const ra8_widget_vtable_t k_wc_footer_vt
static const display_cfg_t k_wc_display_cfg
 Display PAL config: GLCDC LCD backend bound to the SRAM framebuffer.

Detailed Description

Nested ra8_widget tree composited on the live GLCDC panel (#145).

The sibling widget_app_demo proves the ra8_widget + ra8_app stack as an interactive launcher. This app is the focused demonstration of the new compositor primitive issue #145 adds: ra8_widget_panel – a container that is itself a ra8_widget_t, which is what turns the flat widget array into a tree. It composes a small tree and shows the damage-tracked partial flush on ra8_emulator's panel window.

The tree (dwm-style, each piece opt-in):

root (column panel) |- status (leaf, fixed) – title + a live frame counter |- body (ROW PANEL) – a nested panel ... | |- left tile (leaf, flex) | |- right tile (leaf, flex) |- footer (leaf, fixed) – a hint line

body is the new primitive in action: a panel nested inside the root panel. The whole tree is composed by one ra8_widget_panel_compose call, which lays the children out, computes the minimal damage rect + refresh hint, and renders only the dirty children – a dirty nested panel repaints its whole subtree.

A deterministic self-check runs before the live loop:

  • Full compose: mark the whole tree dirty -> 3 dirty children, damage covers the full 512x512 frame, quality hint, and the nested body panel renders both tiles (proven by per-tile render counters).
  • Partial compose: bump the frame counter and invalidate only the status bar -> exactly 1 dirty child, damage is just the 512x44 status rect with the fast hint, the tiles are NOT re-rendered, and the composite CRC changes (the counter advanced). This is the acceptance bullet: a status-only change flushes only the status rect.

It then emits one banner so the app doubles as a ra8_emulator gate:

widget-compose-demo: dirty0=3 crc0=<8hex> dirty1=1 crc1=<8hex> flush=512x44 hint=fast PASS

Any failed assertion prints FAIL ... and parks. After the banner the loop advances the frame counter and partial-composes the status bar live, so the panel visibly updates only its top band (the damage-tracked A2 path).

[Ring 6 / APP] {World: S}

Since
0.1.0

Definition in file main.c.

Enumeration Type Documentation

◆ wc_color_t

enum wc_color_t : uint32_t

0xRRGGBB palette (ra8_gfx packs to RGB565).

Since
0.1.0
Enumerator
k_wc_col_clear 

Whole-frame clear (near black).

k_wc_col_status_bg 

Status-bar fill (slate).

k_wc_col_footer_bg 

Footer fill (dark).

k_wc_col_left_bg 

Left tile (deep blue).

k_wc_col_right_bg 

Right tile (warm brown).

k_wc_col_text 

Primary text (white).

k_wc_col_dim 

Secondary text (gray).

Definition at line 95 of file main.c.

◆ wc_console_t

enum wc_console_t : uint32_t

Console baud + text-format constants.

Since
0.1.0
Enumerator
k_wc_uart_baud 

Console baud.

k_wc_frame_ms 

Live status repaint (ms).

k_wc_fnv_offset 

FNV-1a-32 offset basis.

k_wc_fnv_prime 

FNV-1a-32 prime.

k_wc_hex_nibbles 

Hex digits per 32-bit.

k_wc_nibble_bits 

Bits per hex nibble.

k_wc_nibble_mask 

Low-nibble mask.

k_wc_dec_ten 

Hex/decimal split + buf.

k_wc_frame_buf 

"frame=N" string buffer.

Definition at line 127 of file main.c.

◆ wc_geom_t

enum wc_geom_t : uint16_t

Framebuffer + band geometry (no magic numbers).

Since
0.1.0
Enumerator
k_wc_fb_w 

Framebuffer width, pixels.

k_wc_fb_h 

Framebuffer height, pixels.

k_wc_status_h 

Status-bar band height, pixels.

k_wc_footer_h 

Footer band height, pixels.

k_wc_pad 

Inner text padding, pixels.

k_wc_line_h 

Text line pitch (16px glyph + 2).

k_wc_tile_gap 

Gap between the two body tiles.

Definition at line 80 of file main.c.

◆ wc_widget_idx_t

enum wc_widget_idx_t : uint16_t

Index of each widget within its parent array.

Since
0.1.0
Enumerator
k_wc_w_status 

Root child 0: status bar (fixed).

k_wc_w_body 

Root child 1: nested body panel.

k_wc_w_footer 

Root child 2: footer (fixed).

k_wc_root_n 

Root child count.

k_wc_root_cap 

Root ra8_box scratch (count + 1).

k_wc_w_left 

Body child 0: left tile (flex).

k_wc_w_right 

Body child 1: right tile (flex).

k_wc_body_n 

Body child count.

k_wc_body_cap 

Body ra8_box scratch (count + 1).

Definition at line 110 of file main.c.

Function Documentation

◆ main()

void main ( void )

App entry: bring the panel up, self-check, then run the live loop.

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR / FPU / priority grouping.
Postcondition
The PASS banner is emitted and the panel shows the composed tree; the loop partial-flushes only the status band so the panel updates its top band live (the damage-tracked path), otherwise idling.
Since
0.1.0

Definition at line 633 of file main.c.

References k_ra8_ok, k_ra8_widget_refresh_none, k_ra8_widget_refresh_quality, k_wc_col_clear, k_wc_frame_ms, k_wc_msg_boot, k_wc_msg_fchk, k_wc_msg_fpanl, k_wc_msg_ftree, ra8_delay_ms(), ra8_gfx_clear(), ra8_isr_globals_enable(), wc_build_tree(), wc_compose(), wc_fail_halt(), wc_flush_rect(), wc_invalidate_all(), wc_panel_up(), wc_print(), wc_print_banner(), wc_selfcheck(), wc_setup_or_halt(), and wc_tick_live().

◆ wc_build_tree()

bool wc_build_tree ( void )
static

◆ wc_check_full()

bool wc_check_full ( uint32_t * out_crc,
uint16_t * out_dirty )
static

Assert the full compose: 3 dirty, full-frame quality, tiles drawn.

Definition at line 499 of file main.c.

References ra8_ui_rect_t::h, k_ra8_ok, k_ra8_widget_refresh_none, k_ra8_widget_refresh_quality, k_wc_fb_h, k_wc_fb_w, k_wc_root_n, s_left, s_right, ra8_ui_rect_t::w, wc_compose(), wc_framebuffer_hash(), and wc_invalidate_all().

Referenced by wc_selfcheck().

◆ wc_check_partial()

bool wc_check_partial ( uint32_t * out_crc,
uint16_t * out_dirty )
static

◆ wc_compose()

ra8_err_t wc_compose ( ra8_ui_rect_t * dmg,
ra8_widget_refresh_t * hint,
uint16_t * dirty )
static

Compose the tree into the framebuffer; report the flush rect.

Definition at line 424 of file main.c.

References k_wc_fb_h, k_wc_fb_w, ra8_widget_panel_compose(), and s_root.

Referenced by main(), wc_check_full(), wc_check_partial(), and wc_tick_live().

◆ wc_fail_halt()

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

Print a fail banner and park forever in WFI.

Definition at line 225 of file main.c.

References wc_print().

Referenced by main(), and wc_setup_or_halt().

◆ wc_flush_rect()

void wc_flush_rect ( const ra8_ui_rect_t * dmg,
ra8_widget_refresh_t hint )
static

Flush only dmg to the panel with the mapped refresh hint.

Definition at line 478 of file main.c.

References display_flush(), ra8_ui_rect_t::h, s_display, ra8_ui_rect_t::w, wc_map_hint(), ra8_ui_rect_t::x, and ra8_ui_rect_t::y.

Referenced by main(), and wc_tick_live().

◆ wc_fmt_frame()

void wc_fmt_frame ( char * buf,
uint32_t frame )
static

Format "frame=<n>" into buf (>= k_wc_frame_buf bytes, NUL-term).

Definition at line 282 of file main.c.

References k_wc_dec_ten.

Referenced by wc_status_render().

◆ wc_footer_render()

void wc_footer_render ( ra8_widget_t * w)
static

Footer render: fill + a one-line hint.

Definition at line 355 of file main.c.

References k_wc_col_dim, k_wc_col_footer_bg, k_wc_footer_h, k_wc_pad, ra8_gfx_font_8x16, ra8_gfx_rect(), and ra8_gfx_text_out().

◆ wc_framebuffer_hash()

uint32_t wc_framebuffer_hash ( void )
static

FNV-1a-32 over the composited framebuffer bytes.

Definition at line 265 of file main.c.

References k_wc_fnv_offset, k_wc_fnv_prime, and s_framebuffer.

Referenced by wc_check_full(), and wc_check_partial().

◆ wc_invalidate_all()

void wc_invalidate_all ( ra8_widget_refresh_t refresh)
static

Mark every root child dirty so the next compose repaints the tree.

Definition at line 416 of file main.c.

References k_wc_root_n, ra8_widget_invalidate(), and s_root_kids.

Referenced by main(), and wc_check_full().

◆ wc_leaf_init()

void wc_leaf_init ( ra8_widget_t * w,
const ra8_widget_vtable_t * vt,
void * ctx,
int16_t fixed,
uint16_t flex )
static

Build a leaf widget bound to a vtable + context.

Definition at line 385 of file main.c.

Referenced by wc_build_tree().

◆ wc_map_hint()

display_refresh_hint_t wc_map_hint ( ra8_widget_refresh_t hint)
static

Map a widget refresh hint to the display PAL refresh hint.

Definition at line 469 of file main.c.

References k_display_refresh_fast, k_display_refresh_quality, and k_ra8_widget_refresh_fast.

Referenced by wc_flush_rect().

◆ wc_panel_up()

bool wc_panel_up ( void )
static

Bring up the GLCDC panel and bind ra8_gfx to its framebuffer.

Definition at line 447 of file main.c.

References display_get_framebuffer(), display_init(), k_ra8_gfx_format_rgb565, k_ra8_ok, k_wc_display_cfg, k_wc_fb_h, k_wc_fb_w, display_fb_t::pixels, ra8_gfx_init(), s_display, and s_framebuffer.

Referenced by main().

◆ wc_print()

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

Emit a byte run on the board console.

Definition at line 219 of file main.c.

References ra8_board_uart_console_write().

Referenced by main(), wc_fail_halt(), wc_print_banner(), wc_print_hex(), and wc_print_uint().

◆ wc_print_banner()

void wc_print_banner ( uint16_t d0,
uint32_t crc0,
uint16_t d1,
uint32_t crc1 )
static

Emit the PASS banner once every self-check assertion holds.

Definition at line 596 of file main.c.

References k_wc_msg_crc0, k_wc_msg_crc1, k_wc_msg_d1, k_wc_msg_pass, k_wc_msg_pre, k_wc_msg_tail, wc_print(), wc_print_hex(), and wc_print_uint().

Referenced by main().

◆ wc_print_hex()

void wc_print_hex ( uint32_t value)
static

Print value as 8 uppercase hex digits.

Definition at line 234 of file main.c.

References k_wc_dec_ten, k_wc_hex_nibbles, k_wc_nibble_bits, k_wc_nibble_mask, and wc_print().

Referenced by wc_print_banner().

◆ wc_print_uint()

void wc_print_uint ( uint32_t value)
static

Print a small unsigned integer in decimal.

Definition at line 246 of file main.c.

References k_wc_dec_ten, and wc_print().

Referenced by wc_print_banner().

◆ wc_selfcheck()

bool wc_selfcheck ( uint32_t * crc0,
uint16_t * d0,
uint32_t * crc1,
uint16_t * d1 )
static

Run the whole deterministic surface; return both composites' CRCs.

Definition at line 561 of file main.c.

References wc_check_full(), and wc_check_partial().

Referenced by main().

◆ wc_setup_or_halt()

void wc_setup_or_halt ( void )
static

Bring up clocks/MSTP/time and the console.

Definition at line 578 of file main.c.

References k_ra8_clock_id_cpuclk0, k_ra8_ok, k_wc_msg_finit, k_wc_uart_baud, ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_mstp_init(), ra8_time_init(), and wc_fail_halt().

Referenced by main().

◆ wc_status_render()

void wc_status_render ( ra8_widget_t * w)
static

Status-bar render: fill + title over the live frame counter.

Definition at line 309 of file main.c.

References wc_status_ctx_t::frame, k_wc_col_dim, k_wc_col_status_bg, k_wc_col_text, k_wc_frame_buf, k_wc_line_h, k_wc_pad, ra8_gfx_font_8x16, ra8_gfx_rect(), ra8_gfx_text_out(), wc_status_ctx_t::renders, and wc_fmt_frame().

◆ wc_tick_live()

void wc_tick_live ( void )
static

Advance the frame counter and partial-flush only the status band.

Definition at line 611 of file main.c.

References k_ra8_ok, k_ra8_widget_refresh_fast, k_ra8_widget_refresh_none, k_wc_w_status, ra8_widget_invalidate(), s_root_kids, s_status, wc_compose(), and wc_flush_rect().

Referenced by main().

◆ wc_tile_render()

void wc_tile_render ( ra8_widget_t * w)
static

Body-tile render: fill + label + a per-tile render counter.

Definition at line 333 of file main.c.

References wc_tile_ctx_t::bg, k_wc_col_dim, k_wc_col_text, k_wc_line_h, k_wc_pad, wc_tile_ctx_t::label, ra8_gfx_font_8x16, ra8_gfx_rect(), ra8_gfx_text_out(), and wc_tile_ctx_t::renders.

Variable Documentation

◆ k_wc_display_cfg

const display_cfg_t k_wc_display_cfg
static
Initial value:
= {
.framebuffer = s_framebuffer,
.framebuffer_bytes = sizeof(s_framebuffer),
.width_px = (uint16_t)k_wc_fb_w,
.height_px = (uint16_t)k_wc_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_wc_fb_h
Framebuffer height, pixels.
Definition main.c:82
@ k_wc_fb_w
Framebuffer width, pixels.
Definition main.c:81
@ 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.

Display PAL config: GLCDC LCD backend bound to the SRAM framebuffer.

Definition at line 436 of file main.c.

Referenced by wc_panel_up().

◆ k_wc_footer_vt

const ra8_widget_vtable_t k_wc_footer_vt
static
Initial value:
= {.measure = nullptr,
.render = wc_footer_render,
.on_input = nullptr}
static void wc_footer_render(ra8_widget_t *w)
Footer render: fill + a one-line hint.
Definition main.c:355

Definition at line 375 of file main.c.

Referenced by wc_build_tree().

◆ k_wc_msg_boot

const uint8_t k_wc_msg_boot[] = "widget-compose-demo: boot\r\n"
static

Definition at line 201 of file main.c.

Referenced by main().

◆ k_wc_msg_crc0

const uint8_t k_wc_msg_crc0[] = " crc0="
static

Definition at line 207 of file main.c.

Referenced by wc_print_banner().

◆ k_wc_msg_crc1

const uint8_t k_wc_msg_crc1[] = " crc1="
static

Definition at line 209 of file main.c.

Referenced by wc_print_banner().

◆ k_wc_msg_d1

const uint8_t k_wc_msg_d1[] = " dirty1="
static

Definition at line 208 of file main.c.

Referenced by wc_print_banner().

◆ k_wc_msg_fchk

const uint8_t k_wc_msg_fchk[] = "widget-compose-demo: FAIL selfcheck\r\n"
static

Definition at line 205 of file main.c.

Referenced by main().

◆ k_wc_msg_finit

const uint8_t k_wc_msg_finit[] = "widget-compose-demo: FAIL init\r\n"
static

Definition at line 202 of file main.c.

Referenced by wc_setup_or_halt().

◆ k_wc_msg_fpanl

const uint8_t k_wc_msg_fpanl[] = "widget-compose-demo: FAIL panel\r\n"
static

Definition at line 203 of file main.c.

Referenced by main().

◆ k_wc_msg_ftree

const uint8_t k_wc_msg_ftree[] = "widget-compose-demo: FAIL tree\r\n"
static

Definition at line 204 of file main.c.

Referenced by main().

◆ k_wc_msg_pass

const uint8_t k_wc_msg_pass[] = " PASS\r\n"
static

Definition at line 211 of file main.c.

Referenced by wc_print_banner().

◆ k_wc_msg_pre

const uint8_t k_wc_msg_pre[] = "widget-compose-demo: dirty0="
static

Definition at line 206 of file main.c.

Referenced by wc_print_banner().

◆ k_wc_msg_tail

const uint8_t k_wc_msg_tail[] = " flush=512x44 hint=fast"
static

Definition at line 210 of file main.c.

Referenced by wc_print_banner().

◆ k_wc_status_vt

const ra8_widget_vtable_t k_wc_status_vt
static
Initial value:
= {.measure = nullptr,
.render = wc_status_render,
.on_input = nullptr}
static void wc_status_render(ra8_widget_t *w)
Status-bar render: fill + title over the live frame counter.
Definition main.c:309

Status / footer / tiles are display-only (NULL on_input).

Definition at line 369 of file main.c.

Referenced by wc_build_tree().

◆ k_wc_tile_vt

const ra8_widget_vtable_t k_wc_tile_vt
static
Initial value:
= {.measure = nullptr,
.render = wc_tile_render,
.on_input = nullptr}
static void wc_tile_render(ra8_widget_t *w)
Body-tile render: fill + label + a per-tile render counter.
Definition main.c:333

Definition at line 372 of file main.c.

Referenced by wc_build_tree().

◆ s_body_kids

ra8_widget_t s_body_kids[k_wc_body_n]
static

[left tile, right tile].

Definition at line 172 of file main.c.

Referenced by wc_build_tree(), and wk_build_tree().

◆ s_body_panel

ra8_widget_panel_t s_body_panel
static
Initial value:
= {.children = s_body_kids,
.box_scratch = s_body_scratch,
.count = (uint16_t)k_wc_body_n,
.box_cap = (uint16_t)k_wc_body_cap,
.gap = (int16_t)k_wc_tile_gap,
.pad = 0,
.reserved = 0U}
static ra8_box_t s_body_scratch[k_wc_body_cap]
Body layout scratch.
Definition main.c:173
@ k_wc_body_n
Body child count.
Definition main.c:118
@ k_wc_body_cap
Body ra8_box scratch (count + 1).
Definition main.c:119
static ra8_widget_t s_body_kids[k_wc_body_n]
[left tile, right tile].
Definition main.c:172
@ k_wc_tile_gap
Gap between the two body tiles.
Definition main.c:87
@ k_ra8_widget_axis_row
Horizontal stack (left -> right).
Definition ra8_widget.h:177

Body row-panel descriptor (the nested panel).

Definition at line 177 of file main.c.

Referenced by wc_build_tree(), and wk_build_tree().

◆ s_body_scratch

ra8_box_t s_body_scratch[k_wc_body_cap]
static

Body layout scratch.

Definition at line 173 of file main.c.

◆ s_display

display_handle_t* s_display = nullptr
static

Live display handle once the GLCDC panel is up.

Definition at line 199 of file main.c.

◆ s_framebuffer

uint16_t s_framebuffer[(uint32_t) k_wc_fb_w *(uint32_t) k_wc_fb_h]
static

GLCDC-scanned render target in SRAM, AXI-burst aligned.

Since
0.1.0

Definition at line 144 of file main.c.

◆ s_left

wc_tile_ctx_t s_left = {.label = "Left widget", .bg = (uint32_t)k_wc_col_left_bg}
static

Definition at line 168 of file main.c.

Referenced by wc_build_tree(), wc_check_full(), and wc_check_partial().

◆ s_right

wc_tile_ctx_t s_right = {.label = "Right widget", .bg = (uint32_t)k_wc_col_right_bg}
static

Definition at line 169 of file main.c.

Referenced by wc_build_tree(), wc_check_full(), and wc_check_partial().

◆ s_root

ra8_widget_t s_root
static

The root panel widget (composed each frame).

Definition at line 197 of file main.c.

◆ s_root_kids

ra8_widget_t s_root_kids[k_wc_root_n]
static

[status, body, footer].

Definition at line 171 of file main.c.

◆ s_root_panel

ra8_widget_panel_t s_root_panel
static
Initial value:
= {.children = s_root_kids,
.box_scratch = s_root_scratch,
.count = (uint16_t)k_wc_root_n,
.box_cap = (uint16_t)k_wc_root_cap,
.gap = 0,
.pad = 0,
.reserved = 0U}
static ra8_widget_t s_root_kids[k_wd_root_n]
The five chrome bands.
Definition main.c:345
static ra8_box_t s_root_scratch[k_wd_root_cap]
Root layout scratch.
Definition main.c:346
@ k_wc_root_cap
Root ra8_box scratch (count + 1).
Definition main.c:115
@ k_wc_root_n
Root child count.
Definition main.c:114
@ k_ra8_widget_axis_col
Vertical stack (top -> bottom).
Definition ra8_widget.h:176

Root column-panel descriptor.

Definition at line 187 of file main.c.

◆ s_root_scratch

ra8_box_t s_root_scratch[k_wc_root_cap]
static

Root layout scratch.

Definition at line 174 of file main.c.

◆ s_status

wc_status_ctx_t s_status = {.frame = 0U, .renders = 0U}
static

Definition at line 167 of file main.c.