|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Module-private layout constants + draw primitives for the overlay. More...
Go to the source code of this file.
Enumerations | |
| enum | overlay_layout_t : int32_t { k_led_label_dy = 6 , k_led_row_dy = 22 , k_led_col_dx = 150 , k_led_row_h = 40 , k_pad_x = 18 , k_sidebar_top = 16 , k_title_gap = 26 , k_appname_gap = 30 , k_section_gap = 16 , k_heading_gap = 20 , k_row_step = 16 , k_rule_dy = 10 , k_kv_label_cols = 7 , k_title_bar_h = 40 } |
| enum | board_overlay_cfg_t : uint32_t { k_ovl_sidebar_w = k_board_overlay_sidebar_width_px , k_ovl_min_h = k_board_overlay_min_height_px , k_ovl_bg = 0x10A2U , k_ovl_bg_alt = 0x18E3U , k_ovl_panel_bg = 0x0000U , k_ovl_divider = 0x4208U , k_ovl_rule = 0x39C7U , k_ovl_text = 0xCE59U , k_ovl_dim = 0x8410U , k_ovl_heading = 0xFFFFU , k_ovl_accent = 0x5D1FU , k_ovl_ok = 0x3666U , k_ovl_amber = 0xFD20U , k_ovl_console_bg = 0x0841U , k_ovl_console_txt = 0x07E6U , k_ovl_console_new = 0xFFFFU , k_ovl_tab_on_bg = 0x2965U , k_ovl_tab_off_bg = 0x18E3U , k_ovl_tab_on_txt = 0xFFFFU , k_ovl_tab_off_txt = 0x8410U , k_ovl_tab_empty_txt = 0x4208U , k_ovl_led_off = 0x2104U , k_ovl_led_ring = 0x6B4DU , k_ovl_btn_border = 0x8430U , k_ovl_btn_up = 0x3186U , k_ovl_btn_down = 0x05E0U , k_ovl_btn_label = 0xFFFFU , k_ovl_red = 0xF800U , k_ovl_glyph_w = 5U , k_ovl_glyph_h = 7U , k_ovl_glyph_first = 0x20U , k_ovl_glyph_last = 0x7EU } |
| Sidebar geometry and palette (RGB565). More... | |
| enum | overlay_btn_layout_t : int32_t { k_btn_x_dx = 18 , k_btn_head_y = 404 , k_btn_y = 424 , k_btn_w = 150 , k_btn_h = 36 , k_btn_gap = 20 , k_btn_label_x = 14 , k_btn_label_y = 12 } |
| Fixed layout of the on-screen SW1 / SW2 buttons (sidebar-relative priv_px). More... | |
| enum | overlay_io_layout_t : int32_t { k_io_head_y = 250 } |
| Fixed Y anchor for the I/O section (below the LED row). More... | |
| enum | overlay_pwr_layout_t : int32_t { k_pwr_x_dx = 18 , k_pwr_head_y = 344 , k_pwr_y = 364 , k_pwr_h = 26 , k_pwr_track_w = 320 , k_pwr_chg_off = 338 , k_pwr_chg_w = 126 , k_pwr_label_y = 9 , k_pwr_soc_low = 20 , k_pwr_soc_mid = 50 , k_pwr_soc_full = 100 , k_core_lp_off = 338 , k_core_lp_w = 126 } |
| Fixed layout of the POWER section: battery slider + CHG toggle. More... | |
| enum | overlay_con_layout_t : int32_t { k_con_head_y = 480 , k_con_y = 496 , k_con_pad = 8 , k_con_line_h = 10 , k_con_bottom = 14 , k_con_tab_h = 13 , k_con_tab_txt = 3 , k_con_tab_gap = 1 , k_con_tab_min_w = 58 , k_con_tab_cap_y = 3 } |
| Console-panel layout (the bottom scrolling log with a tab bar). More... | |
| enum | overlay_sd_unit_t : uint64_t { k_sd_unit_div = 1024ULL } |
| Binary size-unit factor for the SD-card capacity readout. More... | |
Functions | |
| void | priv_px (board_overlay_surface_t *surface, int32_t x, int32_t y, uint16_t color) |
| Plot one clipped pixel into the composite (draw primitive). | |
| void | priv_fill_rect (board_overlay_surface_t *surface, int32_t x, int32_t y, int32_t rw, int32_t rh, uint16_t color) |
| Fill a clipped rectangle in the composite (draw primitive). | |
| int32_t | priv_draw_text (board_overlay_surface_t *surface, int32_t x, int32_t y, const char *s, uint16_t color, int32_t sc) |
| Draw a NUL-terminated string; returns the x after the last glyph. | |
| int32_t | priv_section_head (board_overlay_surface_t *surface, int32_t x, int32_t y, const char *title) |
| Draw a section heading (accent colour) with a thin rule beneath it. | |
| int32_t | priv_kv_row (board_overlay_surface_t *surface, int32_t x, int32_t y, const char *label, const char *value, uint16_t val_color) |
| Draw a "label value" row: dim label, coloured value; returns next y. | |
| void | priv_blit_panel (uint16_t *out, uint16_t w, uint16_t h, const uint16_t *panel, uint16_t panel_w, uint16_t panel_h) |
| Blit the rendered panel into the composite's panel region. | |
Module-private layout constants + draw primitives for the overlay.
The board-view overlay is one logical module split across two translation units: the panel composer / hit-testing core (board_overlay.c) and the pixel-level draw primitives + embedded 5x7 font (board_overlay_draw.c). The shared layout/colour/font constants and the primitive declarations live here; nothing in this header is part of the emulator-facing API in inc/board_overlay.h.
Definition in file board_overlay_internal.h.
| enum board_overlay_cfg_t : uint32_t |
Sidebar geometry and palette (RGB565).
Definition at line 47 of file board_overlay_internal.h.
| enum overlay_btn_layout_t : int32_t |
Fixed layout of the on-screen SW1 / SW2 buttons (sidebar-relative priv_px).
Both ::draw_buttons and board_overlay_hit_button derive the button rectangles from these constants, so the drawn face and the click hit-box stay in lock-step. The block sits below the status-text block (which ends near y 166 for any panel) and above the minimum composite height, so it is on-screen for every panel size.
Definition at line 91 of file board_overlay_internal.h.
| enum overlay_con_layout_t : int32_t |
Console-panel layout (the bottom scrolling log with a tab bar).
Definition at line 133 of file board_overlay_internal.h.
| enum overlay_io_layout_t : int32_t |
Fixed Y anchor for the I/O section (below the LED row).
| Enumerator | |
|---|---|
| k_io_head_y | "I/O" section heading row (clear of the LEDs). |
Definition at line 103 of file board_overlay_internal.h.
| enum overlay_layout_t : int32_t |
Definition at line 29 of file board_overlay_internal.h.
| enum overlay_pwr_layout_t : int32_t |
Fixed layout of the POWER section: battery slider + CHG toggle.
::draw_power, board_overlay_hit_button and board_overlay_battery_pct_at all derive their rectangles from these, so the drawn slider, its click hit-box, and the drag-to-percent map stay in lock-step. The block sits below the I/O text block (which ends near y 334) and above the BUTTONS block, so it is on-screen for every panel size.
Definition at line 116 of file board_overlay_internal.h.
| enum overlay_sd_unit_t : uint64_t |
Binary size-unit factor for the SD-card capacity readout.
| Enumerator | |
|---|---|
| k_sd_unit_div | Bytes per KiB step (KiB->MiB->GiB ladder). |
Definition at line 147 of file board_overlay_internal.h.
| void priv_blit_panel | ( | uint16_t * | out, |
| uint16_t | w, | ||
| uint16_t | h, | ||
| const uint16_t * | panel, | ||
| uint16_t | panel_w, | ||
| uint16_t | panel_h ) |
Blit the rendered panel into the composite's panel region.
Blit the rendered panel into the composite's panel region; this step is contained within the board overlay model and uses bounded caller or module-owned storage.
| [out] | out | Destination storage receiving the computed result. |
| [in] | w | W input used by the operation. |
| [in] | h | H input used by the operation. |
| [in] | panel | Panel input used by the operation. |
| [in] | panel_w | Panel w input used by the operation. |
| [in] | panel_h | Panel h input used by the operation. |
Blit the rendered panel into the composite's panel region.
Definition at line 252 of file board_overlay_draw.c.
References k_ovl_panel_bg.
Referenced by board_overlay_compose().
| int32_t priv_draw_text | ( | board_overlay_surface_t * | surface, |
| int32_t | x, | ||
| int32_t | y, | ||
| const char * | s, | ||
| uint16_t | color, | ||
| int32_t | sc ) |
Draw a NUL-terminated string; returns the x after the last glyph.
Draw a nul-terminated string; returns the x after the last glyph; this step is contained within the board overlay model and uses bounded caller or module-owned storage.
| [in,out] | surface | Descriptor-backed presentation surface to access. |
| [in] | x | Horizontal coordinate in pixels. |
| [in] | y | Vertical coordinate in pixels. |
| [in] | s | Module state instance processed by the operation. |
| [in] | color | RGB color value used by the drawing operation. |
| [in] | sc | Integer glyph scale used by the operation. |
| value | The operation-specific draw text value. |
Draw a NUL-terminated string; returns the x after the last glyph.
Definition at line 207 of file board_overlay_draw.c.
References internal_draw_glyph(), and k_ovl_glyph_w.
Referenced by board_overlay_draw_sidebar(), internal_draw_button(), internal_draw_console_body(), internal_draw_console_heading(), internal_draw_console_tabs(), internal_draw_core(), internal_draw_led(), internal_draw_power(), priv_kv_row(), and priv_section_head().
| void priv_fill_rect | ( | board_overlay_surface_t * | surface, |
| int32_t | x, | ||
| int32_t | y, | ||
| int32_t | rw, | ||
| int32_t | rh, | ||
| uint16_t | color ) |
Fill a clipped rectangle in the composite (draw primitive).
Fill a clipped rectangle in the composite (draw primitive); this step is contained within the board overlay model and uses bounded caller or module-owned storage.
| [in,out] | surface | Descriptor-backed presentation surface to access. |
| [in] | x | Horizontal coordinate in pixels. |
| [in] | y | Vertical coordinate in pixels. |
| [in] | rw | Rw input used by the operation. |
| [in] | rh | Rh input used by the operation. |
| [in] | color | RGB color value used by the drawing operation. |
Fill a clipped rectangle in the composite (draw primitive).
Definition at line 141 of file board_overlay_draw.c.
References board_overlay_surface_t::context, board_overlay_surface_t::fill, board_overlay_surface_t::height, board_overlay_surface_t::ok, and board_overlay_surface_t::width.
Referenced by board_overlay_draw_sidebar(), internal_draw_button(), internal_draw_console(), internal_draw_console_heading(), internal_draw_console_tabs(), internal_draw_core(), internal_draw_glyph(), internal_draw_led(), internal_draw_power(), priv_px(), and priv_section_head().
| int32_t priv_kv_row | ( | board_overlay_surface_t * | surface, |
| int32_t | x, | ||
| int32_t | y, | ||
| const char * | label, | ||
| const char * | value, | ||
| uint16_t | val_color ) |
Draw a "label value" row: dim label, coloured value; returns next y.
Draw a "label value" row: dim label, coloured value; returns next y; this step is contained within the board overlay model and uses bounded caller or module-owned storage.
| [in,out] | surface | Descriptor-backed presentation surface to access. |
| [in] | x | Horizontal coordinate in pixels. |
| [in] | y | Vertical coordinate in pixels. |
| [in] | label | NUL-terminated label used by the operation. |
| [in] | value | Register or payload value involved in the operation. |
| [in] | val_color | Val color input used by the operation. |
| value | The operation-specific kv row value. |
Draw a "label value" row: dim label, coloured value; returns next y.
Definition at line 237 of file board_overlay_draw.c.
References k_kv_label_cols, k_ovl_dim, k_ovl_glyph_w, k_row_step, and priv_draw_text().
Referenced by internal_draw_io_block(), and internal_draw_run_stats().
| void priv_px | ( | board_overlay_surface_t * | surface, |
| int32_t | x, | ||
| int32_t | y, | ||
| uint16_t | color ) |
Plot one clipped pixel into the composite (draw primitive).
Plot one clipped pixel into the composite (draw primitive); this step is contained within the board overlay model and uses bounded caller or module-owned storage.
| [in,out] | surface | Descriptor-backed presentation surface to access. |
| [in] | x | Horizontal coordinate in pixels. |
| [in] | y | Vertical coordinate in pixels. |
| [in] | color | RGB color value used by the drawing operation. |
Plot one clipped pixel into the composite (draw primitive).
Definition at line 135 of file board_overlay_draw.c.
References priv_fill_rect().
| int32_t priv_section_head | ( | board_overlay_surface_t * | surface, |
| int32_t | x, | ||
| int32_t | y, | ||
| const char * | title ) |
Draw a section heading (accent colour) with a thin rule beneath it.
Draw a section heading (accent colour) with a thin rule beneath it; this step is contained within the board overlay model and uses bounded caller or module-owned storage.
| [in,out] | surface | Descriptor-backed presentation surface to access. |
| [in] | x | Horizontal coordinate in pixels. |
| [in] | y | Vertical coordinate in pixels. |
| [in] | title | Title input used by the operation. |
| value | The operation-specific section head value. |
Definition at line 224 of file board_overlay_draw.c.
References k_heading_gap, k_ovl_accent, k_ovl_rule, k_ovl_sidebar_w, k_pad_x, k_rule_dy, priv_draw_text(), and priv_fill_rect().
Referenced by internal_draw_buttons(), internal_draw_io_block(), internal_draw_leds(), internal_draw_power(), and internal_draw_run_stats().