|
cryptnox-pos 1.0.0
Standalone USDC payment terminal firmware (ESP32 + Cryptnox smart card)
|
Private to the ui*.cpp files: the state and helpers they share. More...
#include "ui.h"#include <Arduino.h>#include <SPI.h>#include <TFT_eSPI.h>#include <XPT2046_Touchscreen.h>#include <stdio.h>#include <string.h>#include <inttypes.h>#include <time.h>#include "lvgl.h"#include "logo_img.h"#include "logo_small.h"#include "logo_mid.h"#include "chain_icons.h"#include "tap_icon.h"#include "assets.h"#include "settings.h"#include "money.h"#include "touch_cal.h"#include "civil_time.h"#include "provision.h"#include "ota.h"#include "ota_version.h"#include "freertos/FreeRTOS.h"#include "freertos/task.h"#include "freertos/semphr.h"#include "esp_timer.h"#include "wdt.h"#include "esp_log.h"#include "esp_system.h"#include "driver/ledc.h"#include "CW_Utils.h"Go to the source code of this file.
Macros | |
| #define | T_CS 33 |
| #define | T_IRQ 36 |
| #define | T_CLK 25 |
| #define | T_MOSI 32 |
| #define | T_MISO 39 |
| #define | SCR_W 240 |
| #define | SCR_H 320 |
| #define | LOGO_X_NUDGE (-4) |
| #define | COL_BG lv_color_hex(0xFFFFFF) /* white — page background */ |
| #define | COL_SURFACE lv_color_hex(0xF2F2F2) /* light grey — cards/secondary */ |
| #define | COL_TEXT lv_color_hex(0x000000) /* black — primary text */ |
| #define | COL_DIM lv_color_hex(0x9A9A9A) /* grey — secondary labels */ |
| #define | COL_TITLE lv_color_hex(0x424242) /* dark grey — screen titles */ |
| #define | COL_ACCENT lv_color_hex(0x22303D) /* slate — chrome, tabs, controls */ |
| #define | COL_ACTION lv_color_hex(0x101F2E) /* charcoal blue — Charge, Confirm */ |
| #define | COL_PAGE lv_color_hex(0xE2F5FF) /* pale sky — head of the ramp */ |
| #define | COL_PAGE_GRAD lv_color_hex(0xA8D8F0) /* deeper sky — foot of it */ |
| #define | COL_HOME_BAR COL_DIM /* grey — the swipe handle */ |
| #define | COL_WARN lv_color_hex(0xE39A2D) /* amber — "not confirmed yet" */ |
| #define | COL_SUCCESS lv_color_hex(0x1E9E50) /* green — "Sent" */ |
| #define | COL_DANGER lv_color_hex(0xD63A3A) /* red — failures / reset */ |
| #define | COL_BORDER lv_color_hex(0xE0E0E0) /* light grey — hairlines */ |
| #define | BTN_RADIUS 6 |
| #define | HDR_TITLE_Y |
| #define | HDR_DIVIDER_Y 42 /* rule under the title */ |
| #define | ACT_BTN_H 46 /* bottom action-button height */ |
| #define | ACT_BTN_Y (-8) /* bottom action-button offset */ |
| #define | FIELD_PAD_V 8 |
| #define | MENU_BTN_W 42 |
| #define | MENU_BTN_H 30 |
| #define | MENU_BTN_X 4 |
| #define | MENU_BTN_Y 6 |
| #define | ASSET_BTN_H 42 |
| #define | ASSET_BTN_X (-8) /* right edge inset */ |
| #define | ASSET_BTN_Y 10 /* the figure's row is centred on THIS */ |
| #define | ASSET_BTN_PAD 8 /* badge inset from the left edge */ |
| #define | TAB_PAD 12 /* settings tab page padding */ |
| #define | TAB_W (SCR_W - (2 * TAB_PAD)) /* usable tab width */ |
| #define | LV_TICK_PERIOD_MS 2 |
| #define | CAL_INSET 20 /* target centre, in from each corner */ |
| #define | CAL_VERIFY_MS 20000U /* un-confirmed calibration reverts after this */ |
| #define | WIFI_MAX_APS 16 |
| #define | ADMIN_CODE_MIN 6 |
| #define | ADMIN_CODE_MIN_STORED 4 /* shortest code an older build could store */ |
| #define | ADMIN_CODE_MAX 9 |
| #define | ACT_CHAIN_OF(chain) |
| #define | SETTINGS_TAB_COUNT 4 |
| #define | TAB_ABOUT 3 |
| #define | AMOUNT_SMALL_CENTS_FROM 10000ULL /* 100.00 in cents */ |
| #define | AMOUNT_ROW_GAP 8 |
| #define | AMOUNT_ROW_MIN_X 4 |
| #define | CARD_X 8 |
| #define | CARD_Y 28 |
| #define | CARD_W (SCR_W - (2 * CARD_X)) /* 224 */ |
| #define | CARD_H 262 /* 28..290; home bar sits below */ |
| #define | CARD_PAD 10 |
| #define | CARD_BTN_H 44 |
| #define | CARD_BTN_Y (-10) |
| #define | CARD_BTN_W (CARD_W - (2 * CARD_PAD)) |
| #define | BAND_Y 3 /* text top: clock and chip */ |
| #define | CLOCK_X 10 |
| #define | CLOCK_Y BAND_Y |
| #define | CLOCK_W 42 |
| #define | CHIP_X (CLOCK_X + CLOCK_W + 6) |
| #define | CHIP_Y 3 /* 20px tall, so 3 centres it on the band */ |
| #define | COIN_SZ 30 |
| #define | TAP_MARK_H 65 |
| #define | PILL_H 52 |
| #define | PILL_ICON_X 10 |
| #define | OTA_CARD_W 228 |
| #define | OTA_TEXT_W 200 |
| #define | CODE_EYE_GAP 6 |
| #define | CODE_FIELD_W(kbd_w) |
| #define | CODE_FIELD_X (-(MENU_BTN_W + CODE_EYE_GAP) / 2) |
| #define | CODE_KBD_W (CARD_W - (2 * CARD_PAD)) |
Enumerations | |
| enum | BtnAction { ACT_CONFIRM , ACT_CANCEL , ACT_SEND , ACT_NEW , ACT_TX_RECHECK , ACT_CLOSE , ACT_PIN_CANCEL , ACT_PIN_REVEAL , ACT_WIFI , ACT_WIFI_CANCEL , ACT_WIFI_PASS_REVEAL , ACT_ADMIN_CANCEL , ACT_ADMIN_REVEAL , ACT_WELCOME_OK , ACT_PROV_OK , ACT_PROV_NO , ACT_PROV_FINISH , ACT_RESET , ACT_RESET_CONFIRM , ACT_MODAL_CLOSE , ACT_NET_PICK , ACT_NET_ETH , ACT_NET_POLY , ACT_NET_TRON , ACT_PORTAL , ACT_PORTAL_CLOSE , ACT_OTA_OK , ACT_OTA_NO , ACT_TOUCH_CAL , ACT_CAL_SAVE , ACT_CAL_CANCEL , ACT_CHAIN_BASE } |
| enum | { PAY_STEP_NONE = -1 , PAY_STEP_AMOUNT = 0 , PAY_STEP_REVIEW , PAY_STEP_AUTH , PAY_STEP_TAP , PAY_STEP__COUNT } |
Functions | |
| void | theme_init (void) |
| Install the theme. After lv_disp_drv_register(), before any object. | |
| void | disp_flush (lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *px) |
| void | touch_cal_load (void) |
| bool | touch_raw (int16_t *rx, int16_t *ry) |
| void | indev_read (lv_indev_drv_t *drv, lv_indev_data_t *data) |
| void | tick_cb (void *arg) |
| void | backlight_set_pct (uint8_t pct) |
| void | backlight_init (uint8_t pct) |
| const pos_asset_t * | asset (pos_chain_t c=settings_get_chain()) |
| const char * | asset_name (pos_chain_t c=settings_get_chain()) |
| const char * | asset_network (pos_chain_t c=settings_get_chain()) |
| const char * | asset_caption (pos_chain_t c=settings_get_chain()) |
| void | request_screen (ui_screen_t s) |
| void | set_wifi_progress (const char *caption, const char *name) |
| uint64_t | amount_cents_max (void) |
| void | charge_set_busy (void) |
| void | code_field_reveal (lv_obj_t *ta, lv_obj_t *eye_lbl) |
| void | btn_event_cb (lv_event_t *e) |
| lv_obj_t * | make_button (lv_obj_t *parent, const char *label, lv_color_t bg, lv_color_t fg, lv_coord_t w, lv_coord_t h, lv_align_t align, lv_coord_t x, lv_coord_t y, BtnAction act, const lv_font_t *font) |
| lv_obj_t * | make_label (lv_obj_t *parent, const char *txt, lv_color_t color, const lv_font_t *font, lv_align_t align, lv_coord_t x, lv_coord_t y) |
| lv_obj_t * | make_ghost_button (lv_obj_t *parent, const char *label, lv_coord_t w, lv_align_t align, lv_coord_t x, lv_coord_t y, BtnAction act) |
| void | make_divider (lv_obj_t *parent, lv_coord_t y) |
| lv_obj_t * | make_glyph_disc (lv_obj_t *parent, const char *sym, lv_color_t bg, lv_coord_t sz) |
| lv_obj_t * | make_asset_badge (lv_obj_t *parent, pos_chain_t chain) |
| lv_obj_t * | make_asset_button (lv_obj_t *parent) |
| void | asset_btn_set_compact (bool compact) |
| lv_obj_t * | make_net_badge (lv_obj_t *parent, pos_net_t net) |
| void | make_tap_mark (lv_obj_t *parent, lv_coord_t y) |
| lv_obj_t * | make_pill (lv_obj_t *parent, const char *title, const char *sub, lv_coord_t w, lv_coord_t y, BtnAction act, bool leaf=false) |
| lv_obj_t * | make_field (lv_obj_t *parent, const char *caption, const char *value, lv_color_t col=COL_TEXT) |
| void | clear_screen (void) |
| void | paint_page (lv_obj_t *obj) |
| Lay the sale-flow chrome and return the white card to build into. | |
| lv_obj_t * | make_card (lv_obj_t *parent) |
| lv_obj_t * | build_page (int step, bool band=true) |
| void | settings_persist (void) |
| void | build_settings (void) |
| void | build_touch_cal (void) |
| void | touch_cal_poll (void) |
| void | close_modal (void) |
| lv_obj_t * | open_modal (lv_coord_t w, lv_coord_t h) |
| void | open_reset_confirm (void) |
| lv_obj_t * | ota_text (lv_obj_t *card, lv_obj_t *above, const char *txt, lv_color_t col, const lv_font_t *font) |
| void | ota_fit_card (lv_obj_t *card, lv_obj_t *last, lv_coord_t buttons_h) |
| void | open_portal_window (void) |
| void | open_ota_gone (void) |
| void | build_ota_confirm (void) |
| void | open_network_picker (void) |
| void | open_coin_picker (pos_net_t net) |
| lv_obj_t * | make_icon_button (const char *sym, BtnAction act, lv_obj_t *parent=NULL) |
| void | add_test_chip (void) |
| lv_obj_t * | make_title (const char *txt, bool has_icon, lv_obj_t *parent=NULL) |
| Screen title, centred but never underneath the top-left icon button. | |
| void | build_header (const char *title) |
| void | build_welcome (void) |
| void | build_prov (void) |
| void | build_prov_confirm (void) |
| void | build_card_wait (void) |
| void | build_splash (void) |
| void | build_amount (void) |
| void | build_confirm (void) |
| lv_obj_t * | make_numeric_keypad (lv_event_cb_t cb, lv_obj_t *parent=NULL, lv_coord_t w=CODE_KBD_W, lv_coord_t h=210) |
| lv_obj_t * | make_code_row (lv_obj_t *host, lv_obj_t *kb, uint32_t max_len, const char *hint, BtnAction eye_act, lv_obj_t **eye_lbl) |
| void | build_pin (void) |
| uint32_t | admin_penalty_ms (uint8_t fails) |
| void | build_admin_set (void) |
| void | build_admin_unlock (void) |
| void | build_wifi_list (void) |
| void | build_wifi_pass (void) |
| void | build_wifi_connecting (void) |
| void | pop_in (lv_obj_t *obj) |
| void | build_tx_status (void) |
| void | build_boot_error (void) |
| void | signal_init (void) |
| void | render_requested_screen (void) |
Private to the ui*.cpp files: the state and helpers they share.
Definition in file ui_internal.h.
| #define ACT_BTN_H 46 /* bottom action-button height */ |
Definition at line 171 of file ui_internal.h.
Referenced by build_settings(), build_touch_cal(), and build_wifi_list().
| #define ACT_BTN_Y (-8) /* bottom action-button offset */ |
Definition at line 173 of file ui_internal.h.
Referenced by build_settings(), build_touch_cal(), build_wifi_list(), and settings_bottom_bar().
| #define ACT_CHAIN_OF | ( | chain | ) |
The action that selects chain.
Definition at line 267 of file ui_internal.h.
Referenced by btn_event_cb(), and open_coin_picker().
| #define ADMIN_CODE_MAX 9 |
Definition at line 241 of file ui_internal.h.
Referenced by admin_submit(), and build_admin_screen().
| #define ADMIN_CODE_MIN 6 |
Definition at line 237 of file ui_internal.h.
Referenced by admin_submit().
| #define ADMIN_CODE_MIN_STORED 4 /* shortest code an older build could store */ |
Definition at line 239 of file ui_internal.h.
Referenced by admin_submit().
| #define AMOUNT_ROW_GAP 8 |
Definition at line 279 of file ui_internal.h.
Referenced by amount_row_place().
| #define AMOUNT_ROW_MIN_X 4 |
Definition at line 282 of file ui_internal.h.
Referenced by amount_row_place().
| #define AMOUNT_SMALL_CENTS_FROM 10000ULL /* 100.00 in cents */ |
Definition at line 276 of file ui_internal.h.
Referenced by amount_update_display().
| #define ASSET_BTN_H 42 |
Definition at line 194 of file ui_internal.h.
Referenced by amount_row_place(), and make_asset_button().
| #define ASSET_BTN_PAD 8 /* badge inset from the left edge */ |
Definition at line 203 of file ui_internal.h.
Referenced by make_asset_button().
| #define ASSET_BTN_X (-8) /* right edge inset */ |
Definition at line 197 of file ui_internal.h.
Referenced by make_asset_button().
| #define ASSET_BTN_Y 10 /* the figure's row is centred on THIS */ |
Definition at line 199 of file ui_internal.h.
Referenced by amount_row_place(), and make_asset_button().
| #define BAND_Y 3 /* text top: clock and chip */ |
Definition at line 317 of file ui_internal.h.
| #define BTN_RADIUS 6 |
Definition at line 163 of file ui_internal.h.
Referenced by make_button(), and theme_styles_init().
| #define CAL_INSET 20 /* target centre, in from each corner */ |
Definition at line 222 of file ui_internal.h.
Referenced by build_touch_cal(), and cal_apply().
| #define CAL_VERIFY_MS 20000U /* un-confirmed calibration reverts after this */ |
Definition at line 224 of file ui_internal.h.
Referenced by build_touch_cal().
| #define CARD_BTN_H 44 |
Definition at line 302 of file ui_internal.h.
Referenced by build_prov(), build_welcome(), and make_ghost_button().
Definition at line 306 of file ui_internal.h.
Referenced by build_card_wait(), build_prov(), and build_welcome().
| #define CARD_BTN_Y (-10) |
Definition at line 304 of file ui_internal.h.
Referenced by build_card_wait(), build_prov(), and build_welcome().
| #define CARD_H 262 /* 28..290; home bar sits below */ |
Definition at line 297 of file ui_internal.h.
Referenced by make_card().
| #define CARD_PAD 10 |
Definition at line 299 of file ui_internal.h.
Referenced by build_card_wait(), build_prov(), and build_welcome().
Definition at line 295 of file ui_internal.h.
Referenced by build_card_wait(), build_prov(), build_welcome(), and make_card().
| #define CARD_X 8 |
Definition at line 291 of file ui_internal.h.
Referenced by make_card().
| #define CARD_Y 28 |
Definition at line 293 of file ui_internal.h.
Referenced by make_card().
Definition at line 325 of file ui_internal.h.
Referenced by add_test_chip().
| #define CHIP_Y 3 /* 20px tall, so 3 centres it on the band */ |
Definition at line 327 of file ui_internal.h.
Referenced by add_test_chip().
| #define CLOCK_W 42 |
Definition at line 323 of file ui_internal.h.
| #define CLOCK_X 10 |
Definition at line 319 of file ui_internal.h.
Referenced by build_page().
| #define CLOCK_Y BAND_Y |
Definition at line 321 of file ui_internal.h.
Referenced by build_page().
| #define CODE_EYE_GAP 6 |
Definition at line 372 of file ui_internal.h.
Referenced by build_wifi_pass().
| #define CODE_FIELD_W | ( | kbd_w | ) |
Definition at line 374 of file ui_internal.h.
Referenced by build_wifi_pass().
| #define CODE_FIELD_X (-(MENU_BTN_W + CODE_EYE_GAP) / 2) |
Definition at line 376 of file ui_internal.h.
Referenced by build_wifi_pass().
Definition at line 383 of file ui_internal.h.
Referenced by build_admin_screen().
| #define COIN_SZ 30 |
Definition at line 342 of file ui_internal.h.
Referenced by build_settings(), and make_icon_box().
| #define COL_ACCENT lv_color_hex(0x22303D) /* slate — chrome, tabs, controls */ |
Definition at line 136 of file ui_internal.h.
Referenced by build_prov(), build_prov_confirm(), build_settings(), and theme_styles_init().
| #define COL_ACTION lv_color_hex(0x101F2E) /* charcoal blue — Charge, Confirm */ |
Definition at line 141 of file ui_internal.h.
Referenced by build_ota_confirm(), build_prov(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_list(), charge_set_enabled(), make_button(), open_ota_gone(), open_portal_window(), open_reset_confirm(), and theme_styles_init().
| #define COL_BG lv_color_hex(0xFFFFFF) /* white — page background */ |
Definition at line 123 of file ui_internal.h.
Referenced by add_test_chip(), build_ota_confirm(), build_prov(), build_prov_confirm(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_list(), charge_set_enabled(), clear_screen(), make_card(), make_ghost_button(), make_glyph_disc(), open_modal(), open_ota_gone(), open_portal_window(), open_reset_confirm(), sheet_open(), and theme_styles_init().
| #define COL_BORDER lv_color_hex(0xE0E0E0) /* light grey — hairlines */ |
Definition at line 159 of file ui_internal.h.
Referenced by build_settings(), make_button(), make_divider(), make_ghost_button(), open_modal(), and theme_styles_init().
| #define COL_DANGER lv_color_hex(0xD63A3A) /* red — failures / reset */ |
Definition at line 157 of file ui_internal.h.
Referenced by add_test_chip(), build_admin_screen(), build_boot_error(), build_ota_confirm(), build_prov(), build_settings(), build_touch_cal(), build_wifi_list(), cal_target(), and open_reset_confirm().
| #define COL_DIM lv_color_hex(0x9A9A9A) /* grey — secondary labels */ |
Definition at line 129 of file ui_internal.h.
Referenced by build_boot_error(), build_card_wait(), build_ota_confirm(), build_prov(), build_prov_confirm(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_connecting(), build_wifi_list(), charge_set_enabled(), make_asset_button(), make_code_field(), make_field(), make_pill(), open_coin_picker(), open_network_picker(), open_portal_window(), pill_disable(), signal_refresh(), and theme_styles_init().
| #define COL_HOME_BAR COL_DIM /* grey — the swipe handle */ |
Definition at line 151 of file ui_internal.h.
Referenced by build_page().
| #define COL_PAGE lv_color_hex(0xE2F5FF) /* pale sky — head of the ramp */ |
Definition at line 146 of file ui_internal.h.
Referenced by paint_page().
| #define COL_PAGE_GRAD lv_color_hex(0xA8D8F0) /* deeper sky — foot of it */ |
Definition at line 148 of file ui_internal.h.
Referenced by paint_page().
| #define COL_SUCCESS lv_color_hex(0x1E9E50) /* green — "Sent" */ |
Definition at line 155 of file ui_internal.h.
Referenced by build_prov().
| #define COL_SURFACE lv_color_hex(0xF2F2F2) /* light grey — cards/secondary */ |
Definition at line 125 of file ui_internal.h.
Referenced by build_prov(), build_prov_confirm(), build_wifi_list(), charge_set_enabled(), make_asset_button(), make_button(), make_pill(), open_coin_picker(), open_network_picker(), and theme_styles_init().
| #define COL_TEXT lv_color_hex(0x000000) /* black — primary text */ |
Definition at line 127 of file ui_internal.h.
Referenced by build_boot_error(), build_card_wait(), build_ota_confirm(), build_prov(), build_prov_confirm(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_connecting(), build_wifi_list(), build_wifi_pass(), kbd_backspace_draw_cb(), make_asset_button(), make_ghost_button(), make_icon_button(), make_pill(), open_coin_picker(), open_network_picker(), open_ota_gone(), open_portal_window(), open_reset_confirm(), signal_refresh(), theme_styles_init(), and tx_amount_row().
| #define COL_TITLE lv_color_hex(0x424242) /* dark grey — screen titles */ |
Definition at line 131 of file ui_internal.h.
Referenced by build_page(), and make_title().
| #define COL_WARN lv_color_hex(0xE39A2D) /* amber — "not confirmed yet" */ |
Definition at line 153 of file ui_internal.h.
Referenced by signal_refresh().
| #define FIELD_PAD_V 8 |
Definition at line 178 of file ui_internal.h.
Referenced by build_wifi_pass(), and make_code_field().
| #define HDR_DIVIDER_Y 42 /* rule under the title */ |
Definition at line 169 of file ui_internal.h.
Referenced by build_header(), and build_header_back().
| #define HDR_TITLE_Y |
Definition at line 168 of file ui_internal.h.
Referenced by make_title().
| #define LOGO_X_NUDGE (-4) |
Definition at line 118 of file ui_internal.h.
| #define LV_TICK_PERIOD_MS 2 |
Definition at line 212 of file ui_internal.h.
| #define MENU_BTN_H 30 |
Definition at line 182 of file ui_internal.h.
Referenced by make_icon_button().
| #define MENU_BTN_W 42 |
Definition at line 180 of file ui_internal.h.
Referenced by make_icon_button(), and make_title().
| #define MENU_BTN_X 4 |
Definition at line 184 of file ui_internal.h.
Referenced by make_icon_button(), and make_title().
| #define MENU_BTN_Y 6 |
Definition at line 186 of file ui_internal.h.
Referenced by make_icon_button().
| #define OTA_CARD_W 228 |
Definition at line 362 of file ui_internal.h.
Referenced by build_ota_confirm(), build_prov_confirm(), open_ota_gone(), and open_portal_window().
| #define OTA_TEXT_W 200 |
Definition at line 364 of file ui_internal.h.
Referenced by build_ota_confirm(), build_prov_confirm(), open_ota_gone(), open_portal_window(), and ota_text().
| #define PILL_H 52 |
Definition at line 354 of file ui_internal.h.
Referenced by make_pill(), open_coin_picker(), and open_network_picker().
| #define PILL_ICON_X 10 |
Definition at line 356 of file ui_internal.h.
Referenced by build_settings(), open_coin_picker(), and open_network_picker().
| #define SCR_H 320 |
Definition at line 113 of file ui_internal.h.
Referenced by build_settings(), build_touch_cal(), build_wifi_list(), cal_apply(), indev_read(), open_modal(), ota_fit_card(), sheet_open(), sheet_slide_in(), touch_to_screen(), and ui_task().
| #define SCR_W 240 |
Definition at line 111 of file ui_internal.h.
Referenced by build_settings(), build_touch_cal(), build_wifi_connecting(), build_wifi_list(), build_wifi_pass(), cal_apply(), make_divider(), make_title(), open_modal(), sheet_open(), touch_to_screen(), and ui_task().
| #define SETTINGS_TAB_COUNT 4 |
Definition at line 270 of file ui_internal.h.
Referenced by tab_change_cb().
| #define T_CLK 25 |
Definition at line 104 of file ui_internal.h.
Referenced by ui_task().
| #define T_CS 33 |
Definition at line 100 of file ui_internal.h.
| #define T_IRQ 36 |
Definition at line 102 of file ui_internal.h.
Referenced by touch().
| #define T_MISO 39 |
Definition at line 108 of file ui_internal.h.
Referenced by ui_task().
| #define T_MOSI 32 |
Definition at line 106 of file ui_internal.h.
Referenced by ui_task().
| #define TAB_ABOUT 3 |
Definition at line 272 of file ui_internal.h.
Referenced by settings_bottom_bar().
| #define TAB_PAD 12 /* settings tab page padding */ |
Definition at line 205 of file ui_internal.h.
Referenced by build_settings().
Definition at line 207 of file ui_internal.h.
Referenced by build_settings(), and make_field().
| #define TAP_MARK_H 65 |
Definition at line 344 of file ui_internal.h.
Referenced by build_card_wait().
| #define WIFI_MAX_APS 16 |
Definition at line 227 of file ui_internal.h.
Referenced by ui_show_wifi_list().
| anonymous enum |
| Enumerator | |
|---|---|
| PAY_STEP_NONE | |
| PAY_STEP_AMOUNT | |
| PAY_STEP_REVIEW | |
| PAY_STEP_AUTH | |
| PAY_STEP_TAP | |
| PAY_STEP__COUNT | |
Definition at line 330 of file ui_internal.h.
| enum BtnAction |
Definition at line 246 of file ui_internal.h.
| void add_test_chip | ( | void | ) |
Definition at line 561 of file ui_widgets.cpp.
References CHIP_X, CHIP_Y, COL_BG, COL_DANGER, font_inter_14_medium, and settings_get_mainnet().
| uint32_t admin_penalty_ms | ( | uint8_t | fails | ) |
Definition at line 739 of file ui_admin.cpp.
References ADMIN_PENALTY_MAX_S.
Referenced by admin_submit(), open_admin_entry(), and ui_show_prov_auth().
| uint64_t amount_cents_max | ( | void | ) |
Ceiling on what the keypad will accept, for the asset currently selected.
ETH and POL are 18-decimal and the signed value is a uint64 of wei, so a sale stops at 18.44 of either (see POS_AMOUNT_UNITS_MAX_NATIVE). Enforced at the keypad rather than at the confirm step, so the mistake is never keyed.
Definition at line 265 of file ui.cpp.
References amount_cents_cap(), pos_chain_is_native_evm(), and settings_get_chain().
Referenced by amount_kbd_cb(), and btn_event_cb().
| const pos_asset_t * asset | ( | pos_chain_t | c | ) |
An asset's row — ticker, standard, caption, network. Default: the sale's.
Definition at line 189 of file ui.cpp.
References pos_asset_of().
Referenced by asset_caption(), asset_name(), and asset_network().
| void asset_btn_set_compact | ( | bool | compact | ) |
Definition at line 219 of file ui_widgets.cpp.
References s_asset_arrow.
Referenced by amount_update_display().
| const char * asset_caption | ( | pos_chain_t | c | ) |
Caption for the address row above "Send to": TRX has no contract to show.
Definition at line 210 of file ui.cpp.
References asset(), and pos_asset_t::caption.
Referenced by build_settings().
| const char * asset_name | ( | pos_chain_t | c | ) |
Ticker of the asset being charged, for the selector and the amount screens.
Definition at line 194 of file ui.cpp.
References asset(), and pos_asset_t::ticker.
Referenced by build_settings(), make_asset_button(), and tx_amount_row().
| const char * asset_network | ( | pos_chain_t | c | ) |
Which network that asset lives on — the selector's subtitle.
Names the deployment, not just the family ("Ethereum" vs "Ethereum Sepolia"): it decides whether a sale settles in real money.
Definition at line 204 of file ui.cpp.
References asset(), pos_net_info_t::long_main, pos_net_info_t::long_test, pos_net_info(), and settings_net_str().
Referenced by build_settings().
| void backlight_init | ( | uint8_t | pct | ) |
Definition at line 186 of file ui_hal.cpp.
References backlight_set_pct(), BL_GPIO, BL_LEDC_CH, BL_LEDC_MODE, BL_LEDC_RES, BL_LEDC_TIMER, and BL_PWM_HZ.
Referenced by ui_task().
| void backlight_set_pct | ( | uint8_t | pct | ) |
Definition at line 180 of file ui_hal.cpp.
References BL_LEDC_CH, and BL_LEDC_MODE.
Referenced by backlight_init(), and brightness_event_cb().
| void btn_event_cb | ( | lv_event_t * | e | ) |
Definition at line 306 of file ui.cpp.
References ACT_ADMIN_CANCEL, ACT_ADMIN_REVEAL, ACT_CAL_CANCEL, ACT_CAL_SAVE, ACT_CANCEL, ACT_CHAIN_BASE, ACT_CHAIN_OF, ACT_CLOSE, ACT_CONFIRM, ACT_MODAL_CLOSE, ACT_NET_ETH, ACT_NET_PICK, ACT_NET_POLY, ACT_NET_TRON, ACT_NEW, ACT_OTA_NO, ACT_OTA_OK, ACT_PIN_CANCEL, ACT_PIN_REVEAL, ACT_PORTAL, ACT_PORTAL_CLOSE, ACT_PROV_FINISH, ACT_PROV_NO, ACT_PROV_OK, ACT_RESET, ACT_RESET_CONFIRM, ACT_SEND, ACT_TOUCH_CAL, ACT_TX_RECHECK, ACT_WELCOME_OK, ACT_WIFI, ACT_WIFI_CANCEL, ACT_WIFI_PASS_REVEAL, amount_cents_max(), charge_set_busy(), close_modal(), code_field_reveal(), open_coin_picker(), open_network_picker(), open_ota_gone(), open_portal_window(), open_reset_confirm(), ota_commit(), POS_CHAIN__COUNT, POS_NET_ETH, POS_NET_POLY, POS_NET_TRON, prov_auth_resolve(), prov_mode(), PROV_MODE_WIZARD, prov_pending_commit(), request_prov_stop(), request_screen(), s_admin_eye_lbl, s_admin_first, s_admin_for_portal, s_admin_ta, s_amount_cents, s_amount_units, s_cal_pressed, s_cal_prev, s_cal_step, s_cal_xmax, s_cal_xmin, s_cal_ymax, s_cal_ymin, s_cb, s_cb, s_pin, s_pin_eye_lbl, s_pin_for_card, s_pin_len, s_pin_ta, s_req_screen, s_settings_return, s_view_chain, s_welcome_sent, s_wifi_eye_lbl, s_wifi_pass, s_wifi_pass_ta, set_wifi_progress(), settings_factory_reset(), settings_persist(), settings_set_chain(), settings_set_touch_cal(), touch_cal_load(), UI_EVENT_AMOUNT_CONFIRMED, UI_EVENT_CONFIRM_CANCEL, UI_EVENT_PROV_FINISH, UI_EVENT_TX_RECHECK, UI_EVENT_TX_RETRY, UI_EVENT_WELCOME_DONE, UI_EVENT_WIFI_SCAN, ui_refresh_addresses(), UI_SCREEN_AMOUNT, UI_SCREEN_CONFIRM, UI_SCREEN_PIN, UI_SCREEN_PROV, UI_SCREEN_SETTINGS, UI_SCREEN_TOUCH_CAL, and UI_SCREEN_WIFI_CONNECTING.
Referenced by make_asset_button(), make_button(), make_icon_button(), and make_pill().
| void build_admin_set | ( | void | ) |
Definition at line 922 of file ui_admin.cpp.
References build_admin_screen(), and s_admin_confirming.
Referenced by render_requested_screen().
| void build_admin_unlock | ( | void | ) |
Definition at line 929 of file ui_admin.cpp.
References build_admin_screen(), prov_pair_code(), and s_admin_for_portal.
Referenced by render_requested_screen().
| void build_amount | ( | void | ) |
Definition at line 330 of file ui_sale.cpp.
Referenced by render_requested_screen().
| void build_boot_error | ( | void | ) |
Definition at line 871 of file ui_sale.cpp.
References build_header(), clear_screen(), COL_DANGER, COL_DIM, COL_TEXT, font_icons_48, font_inter_14, font_pjs_20_medium, make_label(), pop_in(), s_boot_detail, s_boot_err, UI_BOOT_ERR_CONFIG, UI_BOOT_ERR_NFC, and UI_BOOT_ERR_WALLET.
Referenced by render_requested_screen().
| void build_card_wait | ( | void | ) |
Definition at line 271 of file ui_setup.cpp.
References ACT_CANCEL, build_page(), CARD_BTN_W, CARD_BTN_Y, CARD_PAD, CARD_W, COL_DIM, COL_TEXT, font_inter_14, font_pjs_20_medium, make_ghost_button(), make_label(), make_tap_mark(), PAY_STEP_NONE, s_card_note, and TAP_MARK_H.
Referenced by render_requested_screen().
| void build_confirm | ( | void | ) |
Definition at line 400 of file ui_sale.cpp.
Referenced by render_requested_screen().
| void build_header | ( | const char * | title | ) |
Definition at line 617 of file ui_widgets.cpp.
References HDR_DIVIDER_Y, make_divider(), and make_title().
Referenced by build_boot_error(), build_touch_cal(), and build_wifi_connecting().
| void build_ota_confirm | ( | void | ) |
Definition at line 593 of file ui_admin.cpp.
References ACT_OTA_NO, ACT_OTA_OK, COL_ACTION, COL_BG, COL_DANGER, COL_DIM, COL_TEXT, font_inter_14, font_pjs_20_medium, font_pjs_20_semibold, font_pjs_28_semibold, make_button(), open_modal(), OTA_CARD_W, ota_fit_card(), ota_running_version(), ota_staged(), ota_text(), OTA_TEXT_W, ota_version_display(), OTA_VERSION_SHOWN_MAX, and s_portal_modal.
Referenced by ui_task().
| lv_obj_t * build_page | ( | int | step, |
| bool | band = true ) |
Definition at line 496 of file ui_widgets.cpp.
References clear_screen(), clock_refresh(), CLOCK_X, CLOCK_Y, COL_HOME_BAR, COL_TITLE, font_inter_14_medium, make_card(), make_label(), paint_page(), s_clock_lbl, and s_page_card.
Referenced by build_admin_screen(), build_card_wait(), build_prov(), and build_welcome().
| void build_pin | ( | void | ) |
Definition at line 643 of file ui_sale.cpp.
Referenced by render_requested_screen().
| void build_prov | ( | void | ) |
Definition at line 65 of file ui_setup.cpp.
References ACT_PROV_FINISH, authed(), build_page(), CARD_BTN_H, CARD_BTN_W, CARD_BTN_Y, CARD_PAD, CARD_W, clear_screen(), COL_ACCENT, COL_ACTION, COL_BG, COL_DANGER, COL_DIM, COL_SUCCESS, COL_SURFACE, COL_TEXT, font_icons_48, font_inter_14, font_inter_14_medium, font_pjs_20_medium, font_pjs_20_semibold, make_button(), make_label(), PAY_STEP_NONE, pop_in(), prov_ap_pass(), prov_ap_ssid(), prov_authed(), prov_qr_payload(), PROV_STEP_ADDR, PROV_STEP_AUTH, PROV_STEP_DONE, PROV_STEP_WIFI, prov_wifi_only(), s_prov_msg, and s_prov_step.
Referenced by render_requested_screen().
| void build_prov_confirm | ( | void | ) |
Definition at line 225 of file ui_setup.cpp.
References ACT_PROV_NO, ACT_PROV_OK, COL_ACCENT, COL_BG, COL_DIM, COL_SURFACE, COL_TEXT, font_inter_14, font_inter_14_medium, font_pjs_20_medium, font_pjs_20_semibold, make_button(), open_modal(), OTA_CARD_W, ota_fit_card(), ota_text(), OTA_TEXT_W, PROV_ASK_CONTRACT_ETH, PROV_ASK_CONTRACT_TRON, PROV_ASK_NONE, prov_pending(), and SETTINGS_PAYOUT_MAX.
Referenced by ui_task().
| void build_settings | ( | void | ) |
Definition at line 64 of file ui_admin.cpp.
References ACT_BTN_H, ACT_BTN_Y, ACT_CLOSE, ACT_NET_PICK, ACT_PORTAL, ACT_RESET, ACT_TOUCH_CAL, asset_caption(), asset_name(), asset_network(), brightness_event_cb(), clear_screen(), COIN_SZ, COL_ACCENT, COL_ACTION, COL_BG, COL_BORDER, COL_DANGER, COL_DIM, COL_TEXT, font_inter_14, font_inter_14_medium, font_pjs_20_medium, font_pjs_20_semibold, make_asset_badge(), make_button(), make_field(), make_glyph_disc(), make_label(), make_pill(), net_wifi_rssi(), ota_last_update_failed(), ota_running_version(), ota_version_display(), OTA_VERSION_SHOWN_MAX, PILL_ICON_X, pos_chain_is_tron(), s_addr_dest, s_addr_usdc, s_brightness, s_close_btn, s_fee_max_lbl, s_fee_prio_lbl, s_reset_btn, s_settings_tab, s_view_chain, SCR_H, SCR_W, settings_bottom_bar(), settings_get_max_fee_gwei(), settings_get_priority_fee_gwei(), settings_get_wifi(), settings_has_payout(), tab_change_cb(), TAB_PAD, TAB_W, and ui_refresh_addresses_for().
Referenced by render_requested_screen().
| void build_splash | ( | void | ) |
Definition at line 295 of file ui_sale.cpp.
Referenced by render_requested_screen().
| void build_touch_cal | ( | void | ) |
Definition at line 331 of file ui_admin.cpp.
References ACT_BTN_H, ACT_BTN_Y, ACT_CAL_CANCEL, ACT_CAL_SAVE, build_header(), cal_apply(), CAL_INSET, cal_target(), CAL_VERIFY_MS, clear_screen(), COL_ACTION, COL_BG, COL_DANGER, COL_DIM, COL_TEXT, font_inter_14, font_pjs_20_medium, font_pjs_20_semibold, make_button(), make_label(), s_cal_countdown, s_cal_deadline, s_cal_step, SCR_H, and SCR_W.
Referenced by render_requested_screen().
| void build_tx_status | ( | void | ) |
Definition at line 734 of file ui_sale.cpp.
Referenced by render_requested_screen().
| void build_welcome | ( | void | ) |
Definition at line 17 of file ui_setup.cpp.
References ACT_WELCOME_OK, build_page(), CARD_BTN_H, CARD_BTN_W, CARD_BTN_Y, CARD_PAD, CARD_W, COL_ACTION, COL_BG, COL_DIM, COL_TEXT, font_inter_14, font_pjs_20_medium, font_pjs_20_semibold, logo_mid, make_button(), make_label(), PAY_STEP_NONE, pop_in(), and s_welcome_sub.
Referenced by render_requested_screen().
| void build_wifi_connecting | ( | void | ) |
Definition at line 409 of file ui_setup.cpp.
References build_header(), clear_screen(), COL_DIM, COL_TEXT, font_inter_14, font_pjs_20_medium, make_label(), s_wifi_caption, s_wifi_name, and SCR_W.
Referenced by render_requested_screen().
| void build_wifi_list | ( | void | ) |
Definition at line 314 of file ui_setup.cpp.
References ACT_BTN_H, ACT_BTN_Y, ACT_WIFI, build_header_back(), clear_screen(), COL_ACTION, COL_BG, COL_DANGER, COL_DIM, COL_SURFACE, COL_TEXT, font_inter_14, font_pjs_20_semibold, make_button(), make_label(), s_ap_count, s_aps, s_wifi_note, SCR_H, SCR_W, and wifi_item_cb().
Referenced by render_requested_screen().
| void build_wifi_pass | ( | void | ) |
Definition at line 375 of file ui_setup.cpp.
References ACT_WIFI_PASS_REVEAL, clear_screen(), CODE_EYE_GAP, CODE_FIELD_W, CODE_FIELD_X, COL_TEXT, FIELD_PAD_V, font_inter_14_medium, make_icon_button(), make_label(), s_wifi_eye_lbl, s_wifi_pass_ta, s_wifi_ssid, SCR_W, and wifi_pass_kb_cb().
Referenced by render_requested_screen().
| void charge_set_busy | ( | void | ) |
Charge has been tapped: inert until this screen is next built.
A gate, not a look: it does not repaint the button. It stops a second UI_EVENT_AMOUNT_CONFIRMED queued behind the first, whose echo would otherwise pull an operator who double-tapped Charge back out of the PIN keypad.
Definition at line 100 of file ui_sale.cpp.
References s_charge_btn, and s_charge_busy.
Referenced by btn_event_cb().
| void clear_screen | ( | void | ) |
Definition at line 378 of file ui_widgets.cpp.
References code_field_wipe(), COL_BG, s_admin_note_lbl, s_admin_ta, s_amount_cents_label, s_amount_label, s_amount_row, s_asset_arrow, s_asset_btn, s_boot_step_lbl, s_cal_countdown, s_charge_btn, s_charge_busy, s_clock_lbl, s_close_btn, s_fee_max_lbl, s_fee_prio_lbl, s_page_card, s_pin_eye_lbl, s_pin_ta, s_reset_btn, s_tx_info_lbl, s_wifi_eye_lbl, and s_wifi_pass_ta.
Referenced by build_boot_error(), build_page(), build_prov(), build_settings(), build_touch_cal(), build_wifi_connecting(), build_wifi_list(), and build_wifi_pass().
| void close_modal | ( | void | ) |
Definition at line 424 of file ui_admin.cpp.
References s_modal, and s_portal_modal.
Referenced by btn_event_cb(), open_modal(), render_requested_screen(), and ui_task().
| void code_field_reveal | ( | lv_obj_t * | ta, |
| lv_obj_t * | eye_lbl ) |
Flip a masked field between hidden and shown, and swap its eye glyph to match.
Toggled in place, never via request_screen(): rebuilding the screen would discard what has been typed, which on the PIN keypad costs the operator an attempt the card is counting. The glyph shows what the next tap does. Either argument may be NULL; nothing but convention ties the action to its screen.
Definition at line 286 of file ui_sale.cpp.
Referenced by btn_event_cb().
| void disp_flush | ( | lv_disp_drv_t * | drv, |
| const lv_area_t * | area, | ||
| lv_color_t * | px ) |
| void indev_read | ( | lv_indev_drv_t * | drv, |
| lv_indev_data_t * | data ) |
Definition at line 104 of file ui_hal.cpp.
References s_input_block_until, s_jump, s_jump_logged, s_page_card, s_swipe_admin, s_swipe_armed, s_swipe_y0, s_wait_release, SCR_H, SWIPE_BAND_H, SWIPE_MIN_DY, TAG, touch_jump_filter(), and touch_to_screen().
Referenced by ui_task().
| lv_obj_t * make_asset_badge | ( | lv_obj_t * | parent, |
| pos_chain_t | chain ) |
Definition at line 171 of file ui_widgets.cpp.
References coin_icon(), make_icon_box(), pos_asset_t::native, pos_asset_t::net, NET_CHIP, NET_ICON, and pos_asset_of().
Referenced by build_settings(), make_asset_button(), open_coin_picker(), and tx_amount_row().
| lv_obj_t * make_asset_button | ( | lv_obj_t * | parent | ) |
Definition at line 182 of file ui_widgets.cpp.
References ACT_NET_PICK, ASSET_BTN_H, ASSET_BTN_PAD, ASSET_BTN_X, ASSET_BTN_Y, asset_name(), btn_event_cb(), COL_DIM, COL_SURFACE, COL_TEXT, font_inter_14, font_inter_14_medium, make_asset_badge(), make_label(), s_asset_arrow, s_asset_btn, and settings_get_chain().
| lv_obj_t * make_button | ( | lv_obj_t * | parent, |
| const char * | label, | ||
| lv_color_t | bg, | ||
| lv_color_t | fg, | ||
| lv_coord_t | w, | ||
| lv_coord_t | h, | ||
| lv_align_t | align, | ||
| lv_coord_t | x, | ||
| lv_coord_t | y, | ||
| BtnAction | act, | ||
| const lv_font_t * | font ) |
Definition at line 17 of file ui_widgets.cpp.
References btn_event_cb(), BTN_RADIUS, COL_ACTION, COL_BORDER, and COL_SURFACE.
Referenced by build_ota_confirm(), build_prov(), build_prov_confirm(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_list(), make_ghost_button(), open_coin_picker(), open_network_picker(), open_ota_gone(), open_portal_window(), and open_reset_confirm().
| lv_obj_t * make_card | ( | lv_obj_t * | parent | ) |
Definition at line 481 of file ui_widgets.cpp.
References CARD_H, CARD_W, CARD_X, CARD_Y, and COL_BG.
Referenced by build_admin_screen(), and build_page().
| lv_obj_t * make_code_row | ( | lv_obj_t * | host, |
| lv_obj_t * | kb, | ||
| uint32_t | max_len, | ||
| const char * | hint, | ||
| BtnAction | eye_act, | ||
| lv_obj_t ** | eye_lbl ) |
Definition at line 615 of file ui_sale.cpp.
References make_code_field(), and make_icon_button().
Referenced by build_admin_screen().
| void make_divider | ( | lv_obj_t * | parent, |
| lv_coord_t | y ) |
Definition at line 91 of file ui_widgets.cpp.
References COL_BORDER, and SCR_W.
Referenced by build_header(), and build_header_back().
| lv_obj_t * make_field | ( | lv_obj_t * | parent, |
| const char * | caption, | ||
| const char * | value, | ||
| lv_color_t | col = COL_TEXT ) |
Definition at line 316 of file ui_widgets.cpp.
References COL_DIM, font_inter_14, font_inter_14_medium, make_label(), and TAB_W.
Referenced by build_settings().
| lv_obj_t * make_ghost_button | ( | lv_obj_t * | parent, |
| const char * | label, | ||
| lv_coord_t | w, | ||
| lv_align_t | align, | ||
| lv_coord_t | x, | ||
| lv_coord_t | y, | ||
| BtnAction | act ) |
Definition at line 78 of file ui_widgets.cpp.
References CARD_BTN_H, COL_BG, COL_BORDER, COL_TEXT, font_pjs_20_semibold, and make_button().
Referenced by build_card_wait().
| lv_obj_t * make_glyph_disc | ( | lv_obj_t * | parent, |
| const char * | sym, | ||
| lv_color_t | bg, | ||
| lv_coord_t | sz ) |
Definition at line 103 of file ui_widgets.cpp.
References COL_BG, and font_inter_14.
Referenced by build_settings().
| lv_obj_t * make_icon_button | ( | const char * | sym, |
| BtnAction | act, | ||
| lv_obj_t * | parent = NULL ) |
Definition at line 532 of file ui_widgets.cpp.
References btn_event_cb(), COL_TEXT, font_pjs_20_medium, MENU_BTN_H, MENU_BTN_W, MENU_BTN_X, and MENU_BTN_Y.
Referenced by build_admin_screen(), build_header_back(), build_wifi_pass(), and make_code_row().
| lv_obj_t * make_label | ( | lv_obj_t * | parent, |
| const char * | txt, | ||
| lv_color_t | color, | ||
| const lv_font_t * | font, | ||
| lv_align_t | align, | ||
| lv_coord_t | x, | ||
| lv_coord_t | y ) |
Definition at line 64 of file ui_widgets.cpp.
Referenced by build_admin_screen(), build_boot_error(), build_card_wait(), build_page(), build_prov(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_connecting(), build_wifi_list(), build_wifi_pass(), make_asset_button(), make_code_field(), make_field(), make_pill(), make_title(), open_coin_picker(), open_network_picker(), open_reset_confirm(), ota_text(), and tx_amount_row().
| lv_obj_t * make_net_badge | ( | lv_obj_t * | parent, |
| pos_net_t | net ) |
Definition at line 227 of file ui_widgets.cpp.
References make_icon_box(), and NET_ICON.
Referenced by open_network_picker().
| lv_obj_t * make_numeric_keypad | ( | lv_event_cb_t | cb, |
| lv_obj_t * | parent = NULL, | ||
| lv_coord_t | w = CODE_KBD_W, | ||
| lv_coord_t | h = 210 ) |
Definition at line 576 of file ui_sale.cpp.
Referenced by build_admin_screen().
| lv_obj_t * make_pill | ( | lv_obj_t * | parent, |
| const char * | title, | ||
| const char * | sub, | ||
| lv_coord_t | w, | ||
| lv_coord_t | y, | ||
| BtnAction | act, | ||
| bool | leaf = false ) |
Definition at line 265 of file ui_widgets.cpp.
References btn_event_cb(), COL_DIM, COL_SURFACE, COL_TEXT, font_inter_14, font_pjs_20_medium, make_label(), PILL_H, PILL_TEXT_PAD_R, and PILL_TEXT_X.
Referenced by build_settings(), open_coin_picker(), and open_network_picker().
| void make_tap_mark | ( | lv_obj_t * | parent, |
| lv_coord_t | y ) |
Definition at line 252 of file ui_widgets.cpp.
References COL_TAP_MARK, and tap_icon.
Referenced by build_card_wait().
| lv_obj_t * make_title | ( | const char * | txt, |
| bool | has_icon, | ||
| lv_obj_t * | parent ) |
Screen title, centred but never underneath the top-left icon button.
The title gets the gap between two symmetric gutters; if it does not fit at 20px it drops to the 14px face rather than overlapping the icon or eliding. The width cap and LONG_DOT are the backstop for a title too long even at 14px.
| has_icon | true when make_icon_button() has put a glyph in the top-left. |
Definition at line 586 of file ui_widgets.cpp.
References COL_TITLE, font_inter_14_medium, font_pjs_20_medium, HDR_TITLE_Y, make_label(), MENU_BTN_W, MENU_BTN_X, and SCR_W.
Referenced by build_admin_screen(), build_header(), and build_header_back().
| void open_coin_picker | ( | pos_net_t | net | ) |
Step 2 — the coin on the network chosen in step 1.
Definition at line 692 of file ui_admin.cpp.
References ACT_CHAIN_OF, ACT_NET_PICK, pos_asset_t::chain, COL_DIM, COL_SURFACE, COL_TEXT, font_inter_14, font_pjs_20_semibold, make_asset_badge(), make_button(), make_label(), make_pill(), pos_asset_t::net, open_modal(), PICK_W, PILL_H, PILL_ICON_X, POS_ASSET_COUNT, POS_ASSETS, pos_net_info(), pos_asset_t::standard, and pos_asset_t::ticker.
Referenced by btn_event_cb().
| lv_obj_t * open_modal | ( | lv_coord_t | w, |
| lv_coord_t | h ) |
Definition at line 434 of file ui_admin.cpp.
References close_modal(), COL_BG, COL_BORDER, s_modal, SCR_H, and SCR_W.
Referenced by build_ota_confirm(), build_prov_confirm(), open_coin_picker(), open_network_picker(), open_ota_gone(), open_portal_window(), and open_reset_confirm().
| void open_network_picker | ( | void | ) |
Definition at line 656 of file ui_admin.cpp.
References ACT_MODAL_CLOSE, COL_DIM, COL_SURFACE, COL_TEXT, font_inter_14, font_pjs_20_semibold, make_button(), make_label(), make_net_badge(), make_pill(), pos_net_info_t::name, NET_ACT, open_modal(), PICK_W, pill_disable(), PILL_H, PILL_ICON_X, POS_NET__COUNT, pos_net_info(), POS_NET_TRON, settings_has_payout(), settings_net_str(), pos_net_info_t::sub_main, and pos_net_info_t::sub_test.
Referenced by btn_event_cb().
| void open_ota_gone | ( | void | ) |
Accept or refuse firmware that the update page has uploaded.
The upload is already verified (SHA-256, and the signature on a signed build), so this asks whether the person holding the terminal wants this version, which a browser cannot answer. A downgrade is called out: it is properly signed too, and returning to firmware with a known fault is something to be talked into. Install was tapped and there was nothing left to install.
Says so, so a terminal that stayed on the old firmware does not look updated.
Definition at line 581 of file ui_admin.cpp.
References ACT_MODAL_CLOSE, COL_ACTION, COL_BG, COL_TEXT, font_inter_14, font_pjs_20_semibold, make_button(), open_modal(), OTA_CARD_W, ota_fit_card(), ota_text(), and OTA_TEXT_W.
Referenced by btn_event_cb().
| void open_portal_window | ( | void | ) |
Definition at line 510 of file ui_admin.cpp.
References ACT_MODAL_CLOSE, ACT_PORTAL_CLOSE, COL_ACTION, COL_BG, COL_DIM, COL_TEXT, font_inter_14, font_inter_14_medium, font_pjs_20_semibold, make_button(), open_modal(), OTA_CARD_W, ota_fit_card(), ota_text(), OTA_TEXT_W, prov_ap_pass(), prov_ap_ssid(), PROV_MODE_ADMIN, prov_qr_payload(), prov_start(), prov_window_left_min(), s_cb, and s_portal_modal.
Referenced by btn_event_cb().
| void open_reset_confirm | ( | void | ) |
Definition at line 457 of file ui_admin.cpp.
References ACT_MODAL_CLOSE, ACT_RESET_CONFIRM, COL_ACTION, COL_BG, COL_DANGER, COL_TEXT, font_inter_14, font_pjs_20_semibold, make_button(), make_label(), and open_modal().
Referenced by btn_event_cb().
| void ota_fit_card | ( | lv_obj_t * | card, |
| lv_obj_t * | last, | ||
| lv_coord_t | buttons_h ) |
Resize the card to the text it ended up with, leaving room for the buttons.
buttons_h is how far the button block reaches up from the content bottom — 42 for one 40 px button at -2, 86 for two. Clamped to the screen, so a pathological string elides off the bottom rather than drawing a card taller than the panel.
Definition at line 502 of file ui_admin.cpp.
References OTA_CARD_PAD, OTA_GAP, and SCR_H.
Referenced by build_ota_confirm(), build_prov_confirm(), open_ota_gone(), and open_portal_window().
| lv_obj_t * ota_text | ( | lv_obj_t * | card, |
| lv_obj_t * | above, | ||
| const char * | txt, | ||
| lv_color_t | col, | ||
| const lv_font_t * | font ) |
Wrapped, centred body text stacked under above (or the card top).
Definition at line 477 of file ui_admin.cpp.
References make_label(), OTA_GAP, and OTA_TEXT_W.
Referenced by build_ota_confirm(), build_prov_confirm(), open_ota_gone(), and open_portal_window().
| void paint_page | ( | lv_obj_t * | obj | ) |
Lay the sale-flow chrome and return the white card to build into.
| step | Which step of the sale this is (PAY_STEP_*). Currently unused. |
Definition at line 470 of file ui_widgets.cpp.
References COL_PAGE, and COL_PAGE_GRAD.
Referenced by build_admin_screen(), and build_page().
| void pop_in | ( | lv_obj_t * | obj | ) |
Definition at line 673 of file ui_sale.cpp.
References zoom_anim_cb().
Referenced by build_boot_error(), build_prov(), and build_welcome().
| void render_requested_screen | ( | void | ) |
Definition at line 753 of file ui_widgets.cpp.
References build_admin_set(), build_admin_unlock(), build_amount(), build_boot_error(), build_card_wait(), build_confirm(), build_pin(), build_prov(), build_settings(), build_splash(), build_touch_cal(), build_tx_status(), build_welcome(), build_wifi_connecting(), build_wifi_list(), build_wifi_pass(), close_modal(), s_input_block_until, s_req_screen, s_sheet, s_sheet_pending, s_sig_box, s_tx_state, s_wait_release, sheet_open(), sheet_slide_in(), signal_refresh(), UI_SCREEN_ADMIN_SET, UI_SCREEN_ADMIN_UNLOCK, UI_SCREEN_AMOUNT, UI_SCREEN_BOOT_ERROR, UI_SCREEN_CARD_WAIT, UI_SCREEN_CONFIRM, UI_SCREEN_PIN, UI_SCREEN_PROV, UI_SCREEN_SETTINGS, UI_SCREEN_SPLASH, UI_SCREEN_TOUCH_CAL, UI_SCREEN_TX_STATUS, UI_SCREEN_WELCOME, UI_SCREEN_WIFI_CONNECTING, UI_SCREEN_WIFI_LIST, UI_SCREEN_WIFI_PASS, and UI_TX_STATE_PLACE_CARD.
Referenced by ui_task().
| void request_screen | ( | ui_screen_t | s | ) |
Definition at line 241 of file ui.cpp.
References s_req_screen, and s_screen_dirty.
Referenced by admin_submit(), btn_event_cb(), open_admin_entry(), pin_submit(), touch_cal_poll(), ui_show_admin_set(), ui_show_amount_entry(), ui_show_boot_error(), ui_show_card_pin(), ui_show_card_wait(), ui_show_confirm(), ui_show_prov(), ui_show_prov_auth(), ui_show_splash(), ui_show_tx_status(), ui_show_welcome(), ui_show_wifi_connecting(), ui_show_wifi_list(), ui_task(), wifi_item_cb(), and wifi_pass_kb_cb().
| void set_wifi_progress | ( | const char * | caption, |
| const char * | name ) |
Definition at line 247 of file ui.cpp.
References s_wifi_caption, and s_wifi_name.
Referenced by admin_submit(), btn_event_cb(), ui_show_wifi_connecting(), and wifi_pass_kb_cb().
| void settings_persist | ( | void | ) |
Definition at line 19 of file ui_admin.cpp.
References s_brightness, and settings_set_brightness().
Referenced by btn_event_cb().
| void signal_init | ( | void | ) |
| void theme_init | ( | void | ) |
Install the theme. After lv_disp_drv_register(), before any object.
Copied from the active theme and parented to it, so the default styling still runs first and this only adds on top.
Definition at line 157 of file ui_theme.cpp.
References font_inter_14, s_theme, theme_apply(), and theme_styles_init().
Referenced by ui_task().
| void tick_cb | ( | void * | arg | ) |
| void touch_cal_load | ( | void | ) |
Definition at line 43 of file ui_hal.cpp.
References s_cal_xmax, s_cal_xmin, s_cal_ymax, s_cal_ymin, and settings_get_touch_cal().
Referenced by btn_event_cb(), and ui_task().
| void touch_cal_poll | ( | void | ) |
Definition at line 397 of file ui_admin.cpp.
References request_screen(), s_cal_last_x, s_cal_last_y, s_cal_pressed, s_cal_raw, s_cal_step, touch_raw(), and UI_SCREEN_TOUCH_CAL.
Referenced by ui_task().
| bool touch_raw | ( | int16_t * | rx, |
| int16_t * | ry ) |
|
extern |
Definition at line 444 of file font_icons_48.c.
Referenced by build_boot_error(), and build_prov().
|
extern |
Definition at line 1863 of file font_inter_14.c.
Referenced by build_admin_screen(), build_boot_error(), build_card_wait(), build_ota_confirm(), build_prov(), build_prov_confirm(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_connecting(), build_wifi_list(), make_asset_button(), make_code_field(), make_field(), make_glyph_disc(), make_pill(), open_coin_picker(), open_network_picker(), open_ota_gone(), open_portal_window(), open_reset_confirm(), and theme_init().
|
extern |
Definition at line 1898 of file font_inter_14_medium.c.
Referenced by add_test_chip(), build_page(), build_prov(), build_prov_confirm(), build_settings(), build_wifi_pass(), make_asset_button(), make_field(), make_title(), open_portal_window(), theme_styles_init(), and tx_amount_row().
|
extern |
Definition at line 2997 of file font_pjs_20_medium.c.
Referenced by build_boot_error(), build_card_wait(), build_ota_confirm(), build_prov(), build_prov_confirm(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_connecting(), make_icon_button(), make_pill(), and make_title().
|
extern |
Definition at line 3028 of file font_pjs_20_semibold.c.
Referenced by build_ota_confirm(), build_prov(), build_prov_confirm(), build_settings(), build_touch_cal(), build_welcome(), build_wifi_list(), make_ghost_button(), open_coin_picker(), open_network_picker(), open_ota_gone(), open_portal_window(), and open_reset_confirm().
|
extern |
Definition at line 4807 of file font_pjs_28_light.c.
|
extern |
Definition at line 5019 of file font_pjs_28_semibold.c.
Referenced by amount_row_place(), and build_ota_confirm().
|
extern |
Definition at line 168 of file ui.cpp.
Referenced by build_settings(), and ui_set_addresses().
|
extern |
Definition at line 167 of file ui.cpp.
Referenced by build_settings(), and ui_set_addresses().
|
extern |
Definition at line 149 of file ui.cpp.
Referenced by admin_submit(), build_admin_set(), open_admin_entry(), ui_show_admin_set(), and ui_show_prov_auth().
|
extern |
Definition at line 109 of file ui.cpp.
Referenced by btn_event_cb(), and build_admin_screen().
|
extern |
Definition at line 147 of file ui.cpp.
Referenced by admin_submit(), btn_event_cb(), and ui_show_admin_set().
|
extern |
Definition at line 159 of file ui.cpp.
Referenced by admin_submit(), btn_event_cb(), build_admin_unlock(), open_admin_entry(), and ui_show_prov_auth().
|
extern |
Definition at line 156 of file ui.cpp.
Referenced by admin_lock_remaining_s(), admin_submit(), open_admin_entry(), and ui_show_prov_auth().
|
extern |
Definition at line 155 of file ui.cpp.
Referenced by admin_lock_remaining_s(), admin_submit(), open_admin_entry(), and ui_show_prov_auth().
|
extern |
Definition at line 148 of file ui.cpp.
Referenced by admin_set_note(), admin_submit(), build_admin_screen(), open_admin_entry(), ui_show_admin_set(), and ui_show_prov_auth().
|
extern |
Definition at line 146 of file ui.cpp.
Referenced by admin_set_note(), build_admin_screen(), and clear_screen().
|
extern |
Definition at line 145 of file ui.cpp.
Referenced by admin_kbd_cb(), admin_submit(), btn_event_cb(), build_admin_screen(), and clear_screen().
|
extern |
Definition at line 77 of file ui.cpp.
Referenced by amount_kbd_cb(), amount_update_display(), btn_event_cb(), and ui_show_amount_entry().
|
extern |
Definition at line 73 of file ui.cpp.
Referenced by amount_update_display(), and clear_screen().
|
extern |
Definition at line 72 of file ui.cpp.
Referenced by amount_update_display(), and clear_screen().
|
extern |
Definition at line 76 of file ui.cpp.
Referenced by amount_row_place(), and clear_screen().
|
extern |
Definition at line 37 of file ui.cpp.
Referenced by amount_update_display(), btn_event_cb(), and ui_show_amount_entry().
|
extern |
|
extern |
Definition at line 82 of file ui.cpp.
Referenced by asset_btn_set_compact(), clear_screen(), and make_asset_button().
|
extern |
Definition at line 81 of file ui.cpp.
Referenced by amount_row_place(), clear_screen(), and make_asset_button().
|
extern |
Definition at line 144 of file ui.cpp.
Referenced by build_boot_error(), and ui_show_boot_error().
|
extern |
Definition at line 143 of file ui.cpp.
Referenced by build_boot_error(), and ui_show_boot_error().
|
extern |
Definition at line 119 of file ui.cpp.
Referenced by ui_set_boot_status(), and ui_task().
|
extern |
Definition at line 120 of file ui.cpp.
Referenced by clear_screen(), and ui_task().
|
extern |
Definition at line 179 of file ui_hal.cpp.
Referenced by brightness_event_cb(), build_settings(), settings_persist(), and ui_task().
|
extern |
Definition at line 18 of file ui_hal.cpp.
Referenced by ui_task().
|
extern |
Definition at line 57 of file ui.cpp.
Referenced by build_touch_cal(), clear_screen(), and ui_task().
|
extern |
Definition at line 56 of file ui.cpp.
Referenced by build_touch_cal(), and ui_task().
|
extern |
Definition at line 53 of file ui.cpp.
Referenced by touch_cal_poll().
|
extern |
Definition at line 54 of file ui.cpp.
Referenced by touch_cal_poll().
|
extern |
Definition at line 52 of file ui.cpp.
Referenced by btn_event_cb(), and touch_cal_poll().
|
extern |
Definition at line 51 of file ui.cpp.
Referenced by cal_apply(), and touch_cal_poll().
|
extern |
Definition at line 50 of file ui.cpp.
Referenced by btn_event_cb(), build_touch_cal(), touch_cal_poll(), and ui_task().
|
extern |
Definition at line 40 of file ui_hal.cpp.
Referenced by btn_event_cb(), cal_apply(), touch_cal_load(), touch_to_screen(), and ui_task().
|
extern |
Definition at line 39 of file ui_hal.cpp.
Referenced by btn_event_cb(), cal_apply(), touch_cal_load(), touch_to_screen(), and ui_task().
|
extern |
Definition at line 42 of file ui_hal.cpp.
Referenced by btn_event_cb(), cal_apply(), touch_cal_load(), touch_to_screen(), and ui_task().
|
extern |
Definition at line 41 of file ui_hal.cpp.
Referenced by btn_event_cb(), cal_apply(), touch_cal_load(), touch_to_screen(), and ui_task().
|
extern |
Definition at line 67 of file ui.cpp.
Referenced by build_card_wait(), pin_submit(), and ui_show_card_wait().
|
extern |
Definition at line 31 of file ui.cpp.
Referenced by btn_event_cb(), and request_prov_stop().
|
extern |
Definition at line 86 of file ui.cpp.
Referenced by charge_set_busy(), charge_set_enabled(), and clear_screen().
|
extern |
Definition at line 94 of file ui.cpp.
Referenced by amount_update_display(), charge_set_busy(), and clear_screen().
|
extern |
Definition at line 90 of file ui.cpp.
Referenced by build_page(), clear_screen(), and clock_refresh().
|
extern |
Definition at line 172 of file ui.cpp.
Referenced by build_settings(), clear_screen(), and settings_bottom_bar().
|
extern |
Definition at line 41 of file ui.cpp.
Referenced by ui_show_confirm().
|
extern |
Definition at line 40 of file ui.cpp.
Referenced by ui_show_confirm().
|
extern |
Definition at line 42 of file ui.cpp.
Referenced by ui_show_confirm().
|
extern |
Definition at line 20 of file ui_hal.cpp.
Referenced by ui_task().
|
extern |
Definition at line 19 of file ui_hal.cpp.
Referenced by ui_task().
|
extern |
Definition at line 126 of file ui.cpp.
Referenced by build_settings(), clear_screen(), and ui_task().
|
extern |
Definition at line 127 of file ui.cpp.
Referenced by build_settings(), clear_screen(), and ui_task().
|
extern |
Definition at line 21 of file ui_hal.cpp.
Referenced by ui_task().
|
extern |
Definition at line 79 of file ui_hal.cpp.
Referenced by indev_read(), and render_requested_screen().
|
extern |
Definition at line 84 of file ui_hal.cpp.
Referenced by build_page(), clear_screen(), and indev_read().
|
extern |
Definition at line 99 of file ui.cpp.
Referenced by btn_event_cb(), pin_submit(), and ui_take_pin().
|
extern |
Definition at line 108 of file ui.cpp.
Referenced by btn_event_cb(), and clear_screen().
|
extern |
Definition at line 164 of file ui.cpp.
Referenced by btn_event_cb(), pin_submit(), signal_refresh(), and ui_show_card_pin().
|
extern |
Definition at line 100 of file ui.cpp.
Referenced by btn_event_cb(), pin_submit(), and ui_take_pin().
|
extern |
Definition at line 98 of file ui.cpp.
Referenced by btn_event_cb(), clear_screen(), pin_kbd_cb(), and pin_submit().
|
extern |
Definition at line 423 of file ui_admin.cpp.
Referenced by build_ota_confirm(), close_modal(), open_portal_window(), and ui_task().
|
extern |
Definition at line 136 of file ui.cpp.
Referenced by build_prov(), ui_set_prov_note(), and ui_show_card_pin().
|
extern |
Definition at line 132 of file ui.cpp.
Referenced by build_prov(), and ui_show_prov().
|
extern |
Definition at line 34 of file ui.cpp.
Referenced by admin_submit(), btn_event_cb(), open_admin_entry(), render_requested_screen(), request_screen(), signal_refresh(), ui_init(), and ui_task().
|
extern |
Definition at line 171 of file ui.cpp.
Referenced by build_settings(), clear_screen(), and settings_bottom_bar().
|
extern |
Definition at line 180 of file ui.cpp.
Referenced by build_settings(), open_admin_entry(), and tab_change_cb().
|
extern |
Definition at line 62 of file ui.cpp.
Referenced by build_admin_screen(), and render_requested_screen().
|
extern |
Definition at line 63 of file ui.cpp.
Referenced by open_admin_entry(), and render_requested_screen().
|
extern |
Definition at line 103 of file ui_hal.cpp.
Referenced by indev_read(), and ui_task().
|
extern |
Definition at line 47 of file ui.cpp.
Referenced by pin_submit(), ui_set_tx_info(), ui_show_tx_status(), and ui_task().
|
extern |
Definition at line 48 of file ui.cpp.
Referenced by clear_screen(), and ui_task().
|
extern |
Definition at line 46 of file ui.cpp.
Referenced by pin_submit(), render_requested_screen(), and ui_show_tx_status().
|
extern |
Definition at line 419 of file ui_widgets.cpp.
Referenced by clock_refresh(), and ui_clock_changed().
|
extern |
Definition at line 186 of file ui.cpp.
Referenced by admin_submit(), btn_event_cb(), build_settings(), and open_admin_entry().
|
extern |
Definition at line 80 of file ui_hal.cpp.
Referenced by indev_read(), and render_requested_screen().
|
extern |
Definition at line 151 of file ui.cpp.
Referenced by build_welcome(), and ui_show_welcome().
|
extern |
Definition at line 114 of file ui.cpp.
Referenced by build_wifi_connecting(), and set_wifi_progress().
|
extern |
Definition at line 107 of file ui.cpp.
Referenced by btn_event_cb(), build_wifi_pass(), and clear_screen().
|
extern |
Definition at line 115 of file ui.cpp.
Referenced by build_wifi_connecting(), and set_wifi_progress().
|
extern |
Definition at line 105 of file ui.cpp.
Referenced by build_wifi_list(), and ui_show_wifi_list().
|
extern |
Definition at line 104 of file ui.cpp.
Referenced by btn_event_cb(), ui_stage_wifi_creds(), ui_take_wifi_creds(), and wifi_pass_kb_cb().
|
extern |
Definition at line 106 of file ui.cpp.
Referenced by btn_event_cb(), build_wifi_pass(), clear_screen(), and wifi_pass_kb_cb().
|
extern |
Definition at line 103 of file ui.cpp.
Referenced by build_wifi_pass(), ui_stage_wifi_creds(), ui_take_wifi_creds(), wifi_item_cb(), and wifi_pass_kb_cb().
|
extern |
Definition at line 14 of file ui_hal.cpp.
Referenced by disp_flush(), and ui_task().
|
extern |
Referenced by touch_raw(), touch_to_screen(), and ui_task().
|
extern |
Referenced by ui_task().