|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
E-reader UI chrome – shared contract between main.c and the per-aspect helper translation units (screens + input). More...
#include <stddef.h>#include <stdint.h>#include "er_pageturn.h"#include "ra8_app.h"#include "ra8_batt.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_box.h"#include "ra8_display_pal.h"#include "ra8_display_pal_policy.h"#include "ra8_keyboard.h"#include "ra8_panel.h"#include "ra8_panel_timing.h"#include "ra8_port_constants.h"#include "ra8_ui.h"#include "ra8_widget.h"#include "reflow.h"Go to the source code of this file.
Data Structures | |
| struct | er_book_t |
| One library entry: title, author, reading progress percent. More... | |
| struct | er_chapter_t |
| One mock-spine chapter: its XHTML, length, and resolving href. More... | |
| struct | er_loc_t |
| A reading location (chapter + page) for the navigation back-stack. More... | |
Enumerations | |
| enum | er_fb_dim_t : uint16_t { k_er_fb_w = k_panel_width_px , k_er_fb_h = k_panel_height_px } |
| Framebuffer dimensions, sourced from the BSP panel descriptor. More... | |
| enum | er_fb_misc_t : uint16_t { k_er_settle_ms = 500U , k_er_frame_ms = 25U , k_er_led_every = 16U } |
| Framebuffer byte-math and pacing constants. More... | |
| enum | er_color_t : uint32_t { k_er_paper = 0xFFFFFFU , k_er_ink = 0x000000U , k_er_ink_muted = 0x555555U , k_er_rule = 0xAAAAAAU , k_er_rule_soft = 0xCCCCCCU , k_er_fill = 0xDDDDDDU , k_er_fill_deep = 0x888888U } |
| PAPYR 16-level grayscale ramp, semantic roles (0xRRGGBB). More... | |
| enum | er_layout_t : uint16_t { k_er_statusbar_h = 64U , k_er_footer_h = 56U , k_er_nav_h = 88U , k_er_toolbar_h = 72U , k_er_margin_x = 64U , k_er_pad_ui = 32U , k_er_body_gap = 24U , k_er_line_h = 26U , k_er_glyph_w = 8U , k_er_glyph_h = 16U , k_er_text_inset_y = 24U , k_er_text_pad = 6U , k_er_hair = 1U , k_er_border_w = 2U , k_er_progress_h = 6U , k_er_progress_gap = 12U , k_er_blank_lines = 2U , k_er_grid_cols = 2U , k_er_grid_gap = 28U , k_er_tile_gap = 8U , k_er_card_label_h = 20U , k_er_card_bar_h = 8U , k_er_count_w = 200U } |
| Shared chrome layout metrics (8 px grid), pixels. More... | |
| enum | er_progress_t : uint16_t { k_er_page_current = 12U , k_er_page_total = 248U , k_er_pct_full = 100U } |
| Reading-position + percentage constants. More... | |
| enum | er_node_cap_t : uint16_t { k_er_max_nodes = 64U } |
| Box-tree node-storage capacity. More... | |
| enum | er_screen_t : uint16_t { k_er_screen_library = 1U , k_er_screen_reading = 2U , k_er_screen_keyboard = 3U , k_er_screen_settings = 4U } |
| Screen ids for the ra8_ui navigation stack. More... | |
| enum | er_action_t : uint16_t { k_er_act_none = 0U , k_er_act_open_book = 1U , k_er_act_nav = 2U , k_er_act_search = 3U , k_er_act_settings = 4U , k_er_act_key_base = 100U } |
| Tap-target action ids (carried on box nodes as their tag). More... | |
| enum | er_touch_cfg_t : uint8_t { k_er_touch_channel = (uint8_t)k_ra8_board_touch_i3c_channel , k_er_touch_max_points = 1U } |
| GT911 touch-controller wiring on the EK-RA8D2 carrier. More... | |
| enum | er_fg_cfg_t : uint8_t { k_er_fg_addr = 0x36U , k_er_fg_reg_soc = 0x04U , k_er_fg_reg_crate = 0x16U , k_er_fg_sign = 0x80U } |
| MAX17048-class fuel gauge wiring (shares the touch IIC_B bus). More... | |
| enum | er_nag_cfg_t : int32_t { k_er_nag_h = 72 , k_er_nag_margin = 24 , k_er_nag_top = 96 , k_er_nag_text_dx = 28 , k_er_nag_text_dy = 28 , k_er_nag_dec_max = 4 , k_er_nag_dec_ten = 10 , k_er_nag_line_max = 48 , k_er_batt_every = 40 } |
| Low-battery nag-banner geometry. More... | |
| enum | er_nag_color_t : uint32_t { k_er_nag_low_bg = 0x555555U , k_er_nag_crit_bg = 0x000000U , k_er_nag_text = 0xFFFFFFU } |
| Nag-banner palette (grayscale e-ink). More... | |
| enum | er_hit_cap_t : uint16_t { k_er_max_targets = 32U , k_er_back_w = 240U , k_er_page_back_cap = 16U } |
| Tap-target table capacity and Reading back-affordance size. More... | |
| enum | er_reflow_cfg_t : uint32_t { k_er_font_cap = 512U * 1024U , k_er_font_min = 16U , k_er_reflow_px = 22U , k_er_spi_chan = 0U , k_er_reflow_ink = 0xFF101010U , k_er_reflow_link = 0xFF2A52BEU , k_er_img_arena = 2U * 1024U * 1024U , k_er_glyph_cell_px = 64U , k_er_glyph_cell_bytes = k_er_glyph_cell_px * k_er_glyph_cell_px , k_er_glyph_cells = 256U , k_er_glyph_buckets = 512U } |
| SD-font load + reflow body-render tunables (no magic numbers). More... | |
| enum | er_reflow_sentinel_t : uint32_t { k_er_chapter_none = 0xFFFFFFFFU } |
| "No chapter cached" sentinel. More... | |
| enum | er_nav_count_t : uint16_t { k_er_nav_count = 4U , k_er_nav_idx_setting = 3U } |
| Bottom-nav destination count. More... | |
| enum | er_book_count_t : uint16_t { k_er_book_count = 6U } |
| Number of demo books. More... | |
| enum | er_body_count_t : uint16_t { k_er_body_line_count = 10U } |
| Number of pre-wrapped body lines. More... | |
| enum | er_spine_count_t : uint16_t { k_er_spine_count = 2U } |
| Number of chapters in the mock spine. More... | |
Functions | |
| void | er_text_left (int32_t x, int32_t y, const char *str, uint32_t color) |
| Draw a left-anchored text run in the bundled font. | |
| void | er_text_right (int32_t right, int32_t y, const char *str, uint32_t color) |
Draw a right-anchored text run ending at column right. | |
| void | er_render_library (void) |
| Render the full Library screen. | |
| void | er_render_reading (void) |
| Render the full Reading screen (status bar, body, footer). | |
| bool | er_apply_pageturn (er_dir_t dir) |
| Apply a page turn to the reading location (touch + button shared path). | |
| bool | er_reading_link_tap (int32_t x, int32_t y) |
| Follow an in-content <a> tap in the Reading body (#110). | |
| void | er_push_loc (void) |
| Push the current (chapter, page) on the back-stack, capacity permitting. | |
| uint32_t | er_spine_count (void) |
| Number of chapters in the (mock) spine. | |
| void | er_render_keyboard (void) |
| Render the on-screen keyboard screen + collect its key targets. | |
| void | er_nag_render (ra8_widget_t *w) |
| Nag banner overlay widget: a centered low-battery toast over the screen. | |
| void | er_poll_touch (void) |
| Poll the touch controller and dispatch a tap on a fresh press. | |
| void | er_poll_buttons (void) |
| Poll SW1/SW2 and turn a page on a fresh press (#78). | |
| void | er_poll_battery (void) |
| Poll the fuel gauge, fold it into the nag policy, and toggle the banner. | |
| void | er_render_current (void) |
| Render whichever screen is on top of the navigation stack. | |
| void | er_render_nag_region (void) |
| Repaint only the low-battery banner rect (dirty-region update). | |
| void | er_flush_event (display_turn_event_t event) |
| Flush the panel for a refresh event through the cadence policy (#78). | |
Variables | |
| const char | k_er_wordmark [6] |
| Wordmark / status text. | |
| const char | k_er_lib_heading [] |
| Library heading text. | |
| const char | k_er_status_right [] |
| Status-bar right text. | |
| const char | k_er_search_hint [] |
| Search placeholder. | |
| const char | k_er_count_text [] |
| Book-count chip text. | |
| const char | k_er_book_title [] |
| Reading title text. | |
| const char | k_er_page_label [] |
| Reading page label. | |
| const char | k_er_chapter [] |
| Bitmap-fallback heading. | |
| const char *const | k_er_nav_items [] |
| Bottom-nav destinations (Library / Store / Notes / Settings). | |
| const er_book_t | k_er_books [] |
| Demo shelf (public-domain works). | |
| const char *const | k_er_body_lines [] |
| Reading-view body paragraph lines (pre-wrapped for the font). | |
| const er_chapter_t | k_er_spine [] |
| Two-chapter mock spine for in-content cross-chapter navigation (#110). | |
| display_fb_t | s_fb |
| Mutable copy of the FB descriptor. | |
| ra8_ui_target_t | s_targets [] |
| Tap targets for the current screen. | |
| uint16_t | s_target_count |
| Tap targets currently populated. | |
| ra8_kbd_layout_t | s_kb |
| On-screen keyboard grid. | |
| ra8_kbd_text_t | s_query |
| Live search query. | |
| uint32_t | s_chapter_idx |
| Reading chapter index. | |
| uint32_t | s_reading_page |
| Reading current reflow page. | |
| uint32_t | s_reading_pages |
| Reading total reflow pages (>= 1). | |
| reflow_t | s_reflow_engine |
| reflow engine for the body. | |
| bool | s_reflow_open |
| True while the engine holds a layout. | |
| uint32_t | s_reflow_chapter |
| Chapter laid out (cache key). | |
| int32_t | s_reflow_w |
| Body width the layout used. | |
| int32_t | s_reflow_h |
| Body height the layout used. | |
| uint8_t | s_font_buf [] |
| Font blob read off the SD card. | |
| uint32_t | s_font_len |
| Bytes of font read off the card. | |
| bool | s_have_font |
| True once an SD font is loaded. | |
| uint8_t | s_img_arena_buf [] |
| Image-decode bump arena in SDRAM. | |
| er_loc_t | s_loc_back [] |
| Reading back-stack for link jumps. | |
| uint32_t | s_loc_back_count |
| Entries used in s_loc_back. | |
| ra8_ui_nav_t | s_nav |
| Navigation stack (active screen). | |
| ra8_batt_nag_t | s_batt_nag |
| Nag currently shown over the chrome. | |
| uint8_t | s_batt_soc |
| Last fuel-gauge SOC percent. | |
| ra8_batt_monitor_t | s_batt_mon |
| Low-battery nag policy state. | |
| bool | s_nag_region_only |
| True when a tap only toggled the nag. | |
| display_turn_event_t | s_pending_event |
| Pending refresh event for next flush. | |
| volatile uint32_t | g_er_cur_page |
| SWD / --dump-sym telemetry for the headless page-turn HIL (#78). | |
| volatile uint32_t | g_er_turns |
| Count of page turns applied since boot. | |
| volatile uint32_t | g_er_last_hint |
| Last display_refresh_hint_t flushed. | |
E-reader UI chrome – shared contract between main.c and the per-aspect helper translation units (screens + input).
ereader_ui/main.c was split into cohesive translation units to keep every source file under the repository's 1000-line cap. This header is the seam between them: it owns the compile-time typed-enum configuration, the small shared structs, the extern declarations of the mutable file-scope state and read-only data tables that main.c defines (single definition site), and the prototypes of the helper functions moved out of main.c. The split is a pure code move; the composited chrome is byte-identical.
Translation units sharing this contract:
Definition in file ereader_ui_steps.h.
| enum er_action_t : uint16_t |
Tap-target action ids (carried on box nodes as their tag).
Keyboard key taps use the contiguous block k_er_act_key_base .. k_er_act_key_base + 28 so the dispatcher recovers the key index by subtraction; nothing else may occupy that range.
Definition at line 154 of file ereader_ui_steps.h.
| enum er_body_count_t : uint16_t |
Number of pre-wrapped body lines.
| Enumerator | |
|---|---|
| k_er_body_line_count | Number of pre-wrapped body lines. |
Definition at line 328 of file ereader_ui_steps.h.
| enum er_book_count_t : uint16_t |
Number of demo books.
| Enumerator | |
|---|---|
| k_er_book_count | Number of demo books. |
Definition at line 318 of file ereader_ui_steps.h.
| enum er_color_t : uint32_t |
PAPYR 16-level grayscale ramp, semantic roles (0xRRGGBB).
Definition at line 76 of file ereader_ui_steps.h.
| enum er_fb_dim_t : uint16_t |
Framebuffer dimensions, sourced from the BSP panel descriptor.
| Enumerator | |
|---|---|
| k_er_fb_w | Framebuffer width (pixels). |
| k_er_fb_h | Framebuffer height (pixels). |
Definition at line 57 of file ereader_ui_steps.h.
| enum er_fb_misc_t : uint16_t |
Framebuffer byte-math and pacing constants.
| Enumerator | |
|---|---|
| k_er_settle_ms | PLL / SDRAM / panel-POR settle. |
| k_er_frame_ms | Input poll period (ms): touch / button cadence. |
| k_er_led_every | Toggle the heartbeat LED every Nth frame. |
Definition at line 66 of file ereader_ui_steps.h.
| enum er_fg_cfg_t : uint8_t |
MAX17048-class fuel gauge wiring (shares the touch IIC_B bus).
The fuel gauge sits at 7-bit 0x36 on the same IIC_B channel 0 the GT911 touch already brought up, so the battery is read with raw ra8_i3c register reads (no second bus init). ra8_emulator models this gauge and drives its SOC / CRATE from the on-screen battery slider.
Definition at line 188 of file ereader_ui_steps.h.
| enum er_hit_cap_t : uint16_t |
Tap-target table capacity and Reading back-affordance size.
| Enumerator | |
|---|---|
| k_er_max_targets | Max collected tap targets. |
| k_er_back_w | Reading back-region width (px). |
| k_er_page_back_cap | Footnote-jump back-stack depth. |
Definition at line 222 of file ereader_ui_steps.h.
| enum er_layout_t : uint16_t |
Shared chrome layout metrics (8 px grid), pixels.
Definition at line 90 of file ereader_ui_steps.h.
| enum er_nag_cfg_t : int32_t |
Low-battery nag-banner geometry.
Definition at line 199 of file ereader_ui_steps.h.
| enum er_nag_color_t : uint32_t |
Nag-banner palette (grayscale e-ink).
| Enumerator | |
|---|---|
| k_er_nag_low_bg | Low-battery banner fill (g5). |
| k_er_nag_crit_bg | Critical banner fill (g0 ink). |
| k_er_nag_text | Banner text (paper on the fill). |
Definition at line 212 of file ereader_ui_steps.h.
| enum er_nav_count_t : uint16_t |
Bottom-nav destination count.
| Enumerator | |
|---|---|
| k_er_nav_count | Number of bottom-nav destinations. |
| k_er_nav_idx_setting | Index of the "Settings" nav item. |
Definition at line 307 of file ereader_ui_steps.h.
| enum er_node_cap_t : uint16_t |
Box-tree node-storage capacity.
| Enumerator | |
|---|---|
| k_er_max_nodes | Upper bound on chrome box nodes. |
Definition at line 130 of file ereader_ui_steps.h.
| enum er_progress_t : uint16_t |
Reading-position + percentage constants.
| Enumerator | |
|---|---|
| k_er_page_current | Reading current page (1-based). |
| k_er_page_total | Reading total pages. |
| k_er_pct_full | Percent denominator. |
Definition at line 120 of file ereader_ui_steps.h.
| enum er_reflow_cfg_t : uint32_t |
SD-font load + reflow body-render tunables (no magic numbers).
Definition at line 262 of file ereader_ui_steps.h.
| enum er_reflow_sentinel_t : uint32_t |
"No chapter cached" sentinel.
| Enumerator | |
|---|---|
| k_er_chapter_none | s_reflow_chapter when nothing is laid out. |
Definition at line 280 of file ereader_ui_steps.h.
| enum er_screen_t : uint16_t |
Screen ids for the ra8_ui navigation stack.
Definition at line 138 of file ereader_ui_steps.h.
| enum er_spine_count_t : uint16_t |
Number of chapters in the mock spine.
| Enumerator | |
|---|---|
| k_er_spine_count | Number of chapters in k_er_spine. |
Definition at line 338 of file ereader_ui_steps.h.
| enum er_touch_cfg_t : uint8_t |
GT911 touch-controller wiring on the EK-RA8D2 carrier.
ra8_board_touch_open brings the GT911 up on the board's own channel, at the board's address and rate, against the live PCLKA – so only the contact cap is an app choice. The channel is still named here because the fuel gauge shares that bus and is read with raw ra8_i3c calls; its value is the board's, not a second declaration of it.
| Enumerator | |
|---|---|
| k_er_touch_channel | The board's GT911 bus. |
| k_er_touch_max_points | One contact = one tap. |
Definition at line 174 of file ereader_ui_steps.h.
| bool er_apply_pageturn | ( | er_dir_t | dir | ) |
Apply a page turn to the reading location (touch + button shared path).
| [in] | dir | Direction (k_er_dir_prev / k_er_dir_next / k_er_dir_none). |
| true | A page turn was applied. |
| false | No turn (book end, or k_er_dir_none). |
Definition at line 888 of file ereader_ui_screens.c.
References er_pageturn_step(), er_spine_count(), g_er_turns, k_display_event_chapter, k_display_event_turn, s_chapter_idx, s_pending_event, s_reading_page, and s_reading_pages.
Referenced by er_handle_reading_tap(), and er_poll_buttons().
| void er_flush_event | ( | display_turn_event_t | event | ) |
Flush the panel for a refresh event through the cadence policy (#78).
| [in] | event | The page-transition that occurred (open / turn / chapter). |
Definition at line 623 of file main.c.
References display_flush(), display_full_rect(), display_policy_decide(), display_policy_full_rect(), g_er_cur_page, g_er_last_hint, display_policy_decision_t::hint, k_display_refresh_quality, k_ra8_ok, s_display, s_fb, s_policy, and s_reading_page.
Referenced by er_poll_battery(), er_poll_buttons(), er_poll_touch(), and main().
| void er_nag_render | ( | ra8_widget_t * | w | ) |
Nag banner overlay widget: a centered low-battery toast over the screen.
| [in,out] | w | Widget instance (unused; the banner reads file-scope state). |
Definition at line 375 of file ereader_ui_input.c.
References er_append_pct(), er_append_str(), k_er_ink, k_er_nag_crit_bg, k_er_nag_crit_msg, k_er_nag_h, k_er_nag_hint, k_er_nag_line_max, k_er_nag_low_bg, k_er_nag_low_msg, k_er_nag_margin, k_er_nag_text, k_er_nag_text_dx, k_er_nag_text_dy, k_er_nag_top, k_ra8_batt_nag_critical, k_ra8_batt_nag_none, ra8_gfx_font_8x16, ra8_gfx_rect(), ra8_gfx_text_out(), s_batt_nag, s_batt_soc, and s_fb.
| void er_poll_battery | ( | void | ) |
Poll the fuel gauge, fold it into the nag policy, and toggle the banner.
Poll the fuel gauge, fold it into the nag policy, and toggle the banner.
Definition at line 626 of file ereader_ui_input.c.
References er_flush_event(), er_read_battery(), er_render_nag_region(), k_display_event_chapter, k_er_batt_every, k_ra8_batt_low_pct, k_ra8_batt_nag_none, k_ra8_batt_rearm_margin, k_ra8_ok, ra8_batt_update(), s_batt_mon, s_batt_nag, and s_batt_soc.
Referenced by main().
| void er_poll_buttons | ( | void | ) |
Poll SW1/SW2 and turn a page on a fresh press (#78).
Definition at line 589 of file ereader_ui_input.c.
References er_apply_pageturn(), er_buttons_to_dir(), er_flush_event(), er_render_current(), er_sw_pressed(), k_er_screen_library, k_er_screen_reading, k_ra8_board_sw1, k_ra8_board_sw2, k_ra8_pin_none, ra8_board_sw_pin(), ra8_ui_nav_top(), s_nav, s_pending_event, s_was_sw1, and s_was_sw2.
Referenced by main().
| void er_poll_touch | ( | void | ) |
Poll the touch controller and dispatch a tap on a fresh press.
Definition at line 558 of file ereader_ui_input.c.
References er_flush_event(), er_handle_tap(), er_render_current(), er_render_nag_region(), k_er_touch_max_points, k_ra8_ok, ra8_touch_read(), s_nag_region_only, s_pending_event, s_was_touching, ra8_touch_point_t::x, and ra8_touch_point_t::y.
Referenced by main().
| void er_push_loc | ( | void | ) |
Push the current (chapter, page) on the back-stack, capacity permitting.
Definition at line 874 of file ereader_ui_screens.c.
References k_er_page_back_cap, s_chapter_idx, s_loc_back, s_loc_back_count, and s_reading_page.
Referenced by er_nav_chapter(), and er_nav_fragment().
| bool er_reading_link_tap | ( | int32_t | x, |
| int32_t | y ) |
Follow an in-content <a> tap in the Reading body (#110).
| [in] | x | Tap X (panel pixels). |
| [in] | y | Tap Y (panel pixels). |
| true | A link was followed; chapter/page updated. |
| false | No link hit, or an unresolved / external target. |
Definition at line 960 of file ereader_ui_screens.c.
References er_nav_chapter(), er_nav_fragment(), k_er_body_gap, k_er_margin_x, k_er_statusbar_h, k_ra8_ok, k_reflow_href_chapter, k_reflow_href_chapter_fragment, k_reflow_href_empty, k_reflow_href_fragment, reflow_hit_test_link(), reflow_href_split(), s_reading_page, and s_reflow_engine.
Referenced by er_handle_reading_tap().
| void er_render_current | ( | void | ) |
Render whichever screen is on top of the navigation stack.
Definition at line 585 of file main.c.
References k_er_nag_vt, k_er_screen_library, k_ra8_batt_nag_none, ra8_app_launch(), ra8_app_render(), ra8_ui_nav_top(), ra8_widget_render_dirty(), s_app_reg, s_batt_nag, and s_nav.
Referenced by er_poll_buttons(), er_poll_touch(), er_render_nag_region(), and main().
| void er_render_keyboard | ( | void | ) |
Render the on-screen keyboard screen + collect its key targets.
Definition at line 267 of file ereader_ui_input.c.
References k_er_kbd_keys_vt, k_er_kbd_search_vt, k_er_paper, k_er_statusbar_h, k_er_toolbar_h, k_ra8_widget_axis_col, k_ra8_widget_refresh_quality, ra8_gfx_clear(), ra8_widget_invalidate(), ra8_widget_layout_stack(), ra8_widget_render_dirty(), and s_fb.
Referenced by er_app_render().
| void er_render_library | ( | void | ) |
Render the full Library screen.
Definition at line 545 of file ereader_ui_screens.c.
References ra8_box_tree_t::count, er_build_library(), er_collect_targets(), k_er_lib_body_vt, k_er_lib_sb_vt, k_er_paper, k_er_statusbar_h, k_ra8_widget_axis_col, k_ra8_widget_refresh_quality, ra8_gfx_clear(), ra8_widget_invalidate(), ra8_widget_layout_stack(), ra8_widget_render_dirty(), s_fb, and s_lib_node_count.
Referenced by er_app_render().
| void er_render_nag_region | ( | void | ) |
Repaint only the low-battery banner rect (dirty-region update).
Definition at line 602 of file main.c.
References er_render_current(), k_er_nag_h, k_er_nag_margin, k_er_nag_top, k_er_nag_vt, k_er_screen_library, k_ra8_batt_nag_none, k_ra8_ok, ra8_app_launch(), ra8_app_render(), ra8_gfx_reset_clip(), ra8_gfx_set_clip(), ra8_ui_nav_top(), ra8_widget_render_dirty(), s_app_reg, s_batt_nag, s_fb, and s_nav.
Referenced by er_poll_battery(), and er_poll_touch().
| void er_render_reading | ( | void | ) |
Render the full Reading screen (status bar, body, footer).
Definition at line 848 of file ereader_ui_screens.c.
References k_er_footer_h, k_er_paper, k_er_read_body_vt, k_er_read_footer_vt, k_er_read_sb_vt, k_er_statusbar_h, k_ra8_widget_axis_col, k_ra8_widget_refresh_quality, ra8_gfx_clear(), ra8_widget_invalidate(), ra8_widget_layout_stack(), ra8_widget_render_dirty(), and s_fb.
Referenced by er_app_render().
| uint32_t er_spine_count | ( | void | ) |
Number of chapters in the (mock) spine.
| count | The number of spine chapters. |
Definition at line 883 of file ereader_ui_screens.c.
References k_er_spine_count.
Referenced by er_apply_pageturn(), and er_nav_chapter().
| void er_text_left | ( | int32_t | x, |
| int32_t | y, | ||
| const char * | str, | ||
| uint32_t | color ) |
Draw a left-anchored text run in the bundled font.
| [in] | x | Left pixel column. |
| [in] | y | Top pixel row. |
| [in] | str | ASCII string (NUL-terminated). |
| [in] | color | Foreground colour (0xRRGGBB); background is paper. |
Definition at line 129 of file ereader_ui_screens.c.
References k_er_paper, ra8_gfx_font_8x16, and ra8_gfx_text_out().
Referenced by er_draw_reading_body(), er_kbd_search_render(), er_read_footer_render(), er_read_sb_render(), er_render_boxnodes(), and er_text_right().
| void er_text_right | ( | int32_t | right, |
| int32_t | y, | ||
| const char * | str, | ||
| uint32_t | color ) |
Draw a right-anchored text run ending at column right.
| [in] | right | Right pixel column the run ends at. |
| [in] | y | Top pixel row. |
| [in] | str | ASCII string (NUL-terminated). |
| [in] | color | Foreground colour (0xRRGGBB); background is paper. |
right. Definition at line 134 of file ereader_ui_screens.c.
References er_text_left(), k_ra8_ok, ra8_gfx_font_8x16, and ra8_gfx_text_size().
Referenced by er_lib_sb_render(), er_read_footer_render(), and er_read_sb_render().
|
extern |
SWD / --dump-sym telemetry for the headless page-turn HIL (#78).
Current reading page after the last turn.
Definition at line 254 of file main.c.
Referenced by er_flush_event().
|
extern |
Last display_refresh_hint_t flushed.
Definition at line 256 of file main.c.
Referenced by er_flush_event().
|
extern |
Count of page turns applied since boot.
Definition at line 255 of file main.c.
Referenced by er_apply_pageturn().
|
extern |
Reading-view body paragraph lines (pre-wrapped for the font).
Definition at line 110 of file main.c.
Referenced by er_draw_reading_body().
|
extern |
Reading title text.
Definition at line 86 of file main.c.
Referenced by er_read_footer_render(), and er_read_sb_render().
|
extern |
Demo shelf (public-domain works).
Definition at line 96 of file main.c.
Referenced by er_build_library().
|
extern |
Bitmap-fallback heading.
Definition at line 88 of file main.c.
Referenced by er_draw_reading_body().
|
extern |
|
extern |
|
extern |
Bottom-nav destinations (Library / Store / Notes / Settings).
Bottom-nav destinations (Library / Store / Notes / Settings).
Definition at line 91 of file main.c.
Referenced by er_build_nav().
|
extern |
|
extern |
Search placeholder.
Definition at line 84 of file main.c.
Referenced by er_build_toolbar(), and er_kbd_search_render().
|
extern |
Two-chapter mock spine for in-content cross-chapter navigation (#110).
Definition at line 164 of file main.c.
Referenced by er_nav_chapter(), and er_reflow_relayout().
|
extern |
Status-bar right text.
Definition at line 83 of file main.c.
Referenced by er_lib_sb_render(), and er_read_sb_render().
|
extern |
Wordmark / status text.
Complete bound so er_read_sb_render can take sizeof to advance past it (a static_assert in main.c pins the size).
Definition at line 80 of file main.c.
Referenced by er_read_sb_render().
|
extern |
Low-battery nag policy state.
Low-battery nag policy state.
Definition at line 235 of file main.c.
Referenced by er_poll_battery(), and main().
|
extern |
Nag currently shown over the chrome.
Nag currently shown over the chrome.
Definition at line 237 of file main.c.
Referenced by er_handle_tap(), er_nag_render(), er_poll_battery(), er_render_current(), and er_render_nag_region().
|
extern |
Last fuel-gauge SOC percent.
Last fuel-gauge SOC percent.
Definition at line 239 of file main.c.
Referenced by er_nag_render(), and er_poll_battery().
|
extern |
Reading chapter index.
Reading chapter index.
Definition at line 178 of file main.c.
Referenced by er_apply_pageturn(), er_draw_reading_body_reflow(), er_handle_reading_tap(), er_handle_tap(), er_nav_chapter(), er_push_loc(), and er_reflow_relayout().
|
extern |
|
extern |
|
extern |
Bytes of font read off the card.
Bytes of font read off the card.
Definition at line 288 of file main.c.
Referenced by er_draw_reading_body_reflow(), and er_try_load_font().
|
extern |
True once an SD font is loaded.
True once an SD font is loaded.
Definition at line 291 of file main.c.
Referenced by er_draw_reading_body_reflow(), and er_try_load_font().
|
extern |
Image-decode bump arena in SDRAM.
Image-decode bump arena in SDRAM.
Definition at line 274 of file main.c.
Referenced by er_reflow_relayout().
|
extern |
On-screen keyboard grid.
On-screen keyboard grid.
Definition at line 223 of file main.c.
Referenced by er_draw_key(), er_handle_keyboard_tap(), er_kbd_keys_render(), er_kbd_label(), kb_key_of(), kb_key_of_kind(), kb_tap(), and main().
|
extern |
Reading back-stack for link jumps.
Reading back-stack for link jumps.
Definition at line 265 of file main.c.
Referenced by er_handle_reading_tap(), and er_push_loc().
|
extern |
Entries used in s_loc_back.
Entries used in s_loc_back.
Definition at line 268 of file main.c.
Referenced by er_handle_reading_tap(), er_handle_tap(), and er_push_loc().
|
extern |
True when a tap only toggled the nag.
True when a tap only toggled the nag.
Definition at line 241 of file main.c.
Referenced by er_handle_tap(), and er_poll_touch().
|
extern |
|
extern |
Pending refresh event for next flush.
Pending refresh event for next flush.
Defaults to a clean chapter-boundary refresh for any screen change; a same-chapter page turn lowers it to k_display_event_turn.
Definition at line 251 of file main.c.
Referenced by er_apply_pageturn(), er_handle_tap(), er_poll_buttons(), and er_poll_touch().
|
extern |
Live search query.
Live search query.
Definition at line 226 of file main.c.
Referenced by er_book_matches(), er_handle_keyboard_tap(), er_handle_tap(), and er_kbd_search_render().
|
extern |
Reading current reflow page.
Reading current reflow page.
Definition at line 229 of file main.c.
Referenced by er_apply_pageturn(), er_draw_reading_body_reflow(), er_flush_event(), er_handle_reading_tap(), er_handle_tap(), er_nav_chapter(), er_nav_fragment(), er_push_loc(), er_read_footer_render(), and er_reading_link_tap().
|
extern |
Reading total reflow pages (>= 1).
Reading total reflow pages (>= 1).
Definition at line 232 of file main.c.
Referenced by er_apply_pageturn(), er_draw_reading_body_reflow(), er_read_footer_render(), and er_reflow_relayout().
|
extern |
Chapter laid out (cache key).
Chapter laid out (cache key).
Definition at line 282 of file main.c.
Referenced by er_draw_reading_body_reflow(), and er_reflow_relayout().
|
extern |
reflow engine for the body.
reflow engine for the body.
Definition at line 277 of file main.c.
Referenced by er_bind_glyph_atlas(), er_draw_reading_body_reflow(), er_nav_chapter(), er_nav_fragment(), er_reading_link_tap(), and er_reflow_relayout().
|
extern |
Body height the layout used.
Definition at line 285 of file main.c.
Referenced by er_draw_reading_body_reflow(), and er_reflow_relayout().
|
extern |
True while the engine holds a layout.
True while the engine holds a layout.
Definition at line 280 of file main.c.
Referenced by er_draw_reading_body_reflow(), and er_reflow_relayout().
|
extern |
Body width the layout used.
Body width the layout used.
Definition at line 284 of file main.c.
Referenced by er_draw_reading_body_reflow(), and er_reflow_relayout().
|
extern |
Tap targets currently populated.
Tap targets currently populated.
Definition at line 220 of file main.c.
Referenced by er_collect_targets(), er_handle_keyboard_tap(), er_handle_tap(), and er_kbd_keys_render().
|
extern |
Tap targets for the current screen.
Tap targets for the current screen.
Definition at line 217 of file main.c.
Referenced by er_collect_targets(), er_handle_keyboard_tap(), er_handle_tap(), and er_kbd_keys_render().