|
cryptnox-pos 1.0.0
Standalone USDC payment terminal firmware (ESP32 + Cryptnox smart card)
|
The sale flow: amount, confirm, PIN, transaction status, and their page chrome. More...
#include "ui_internal.h"Go to the source code of this file.
Macros | |
| #define | CHIP_W 56 |
| #define | BSP_W |
| #define | BSP_H 9 |
| #define | BSP_NOSE 6 |
| #define | BSP_CROSS 4 |
| #define | BSP_LINE 2 |
| #define | BSP_R 3 |
| #define | BSP_R45 2 /* round(BSP_R * sin 45) — the fillet's middle point */ |
| #define | BSP_NOSE_DX 2 /* the nose's cut, one third of its run... */ |
| #define | BSP_NOSE_DY 3 /* ...and one third of its rise */ |
Functions | |
| static lv_coord_t | amount_ink_shift (const lv_font_t *f) |
| static void | amount_row_place (void) |
| static void | charge_set_enabled (bool on) |
| void | charge_set_busy (void) |
| static void | amount_update_display (void) |
| static void | kbd_fill_rows (lv_obj_t *kb) |
| static void | kbd_backspace_draw_cb (lv_event_t *e) |
| static void | amount_kbd_cb (lv_event_t *e) |
| void | code_field_reveal (lv_obj_t *ta, lv_obj_t *eye_lbl) |
| void | build_splash (void) |
| void | build_amount (void) |
| void | build_confirm (void) |
| static void | pin_submit (void) |
| static void | pin_kbd_cb (lv_event_t *e) |
| static void | code_hint_cb (lv_event_t *e) |
| static lv_obj_t * | make_code_field (uint32_t max_len, lv_coord_t x1, lv_coord_t y, const char *hint, lv_coord_t w, lv_obj_t *parent=NULL) |
| lv_obj_t * | make_numeric_keypad (lv_event_cb_t cb, lv_obj_t *parent, lv_coord_t w, lv_coord_t h) |
| 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) |
| static void | zoom_anim_cb (void *obj, int32_t v) |
| void | pop_in (lv_obj_t *obj) |
| static void | hash_short (const char *h, char *out, size_t n) |
| static void | tx_amount_row (lv_obj_t *parent, const char *amt, const lv_font_t *font, lv_coord_t y, bool ticker) |
| void | build_tx_status (void) |
| void | build_boot_error (void) |
The sale flow: amount, confirm, PIN, transaction status, and their page chrome.
Definition in file ui_sale.cpp.
| #define BSP_CROSS 4 |
Definition at line 149 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_H 9 |
Definition at line 147 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_LINE 2 |
Definition at line 150 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_NOSE 6 |
Definition at line 148 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_NOSE_DX 2 /* the nose's cut, one third of its run... */ |
Definition at line 163 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_NOSE_DY 3 /* ...and one third of its rise */ |
Definition at line 164 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_R 3 |
Definition at line 161 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_R45 2 /* round(BSP_R * sin 45) — the fillet's middle point */ |
Definition at line 162 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define BSP_W |
Definition at line 146 of file ui_sale.cpp.
Referenced by kbd_backspace_draw_cb().
| #define CHIP_W 56 |
Definition at line 14 of file ui_sale.cpp.
|
static |
Place the figure's row: on the screen's centre line, and on the coin's.
Vertically: the row's measured height against the selector's, so the digits' ink middle (amount_ink_shift(), read off the font's '0') lands on the coin's.
Horizontally: the screen's centre, which the keypad and Charge button share. The row slides left only as far as it must to clear the selector, so a typical amount stays centred. Both widths are measured, never predicted. Nothing on this row is dropped to make it fit: the figure is money.
Definition at line 28 of file ui_sale.cpp.
Referenced by amount_row_place().
|
static |
Definition at line 261 of file ui_sale.cpp.
References amount_cents_max(), amount_key_00(), amount_key_back(), amount_key_digit(), amount_update_display(), and s_amount_cents.
|
static |
Definition at line 35 of file ui_sale.cpp.
References amount_ink_shift(), AMOUNT_ROW_GAP, AMOUNT_ROW_MIN_X, ASSET_BTN_H, ASSET_BTN_Y, font_pjs_28_semibold, s_amount_row, and s_asset_btn.
Referenced by amount_update_display().
|
static |
Definition at line 107 of file ui_sale.cpp.
References amount_cents_to_units(), amount_row_place(), AMOUNT_SMALL_CENTS_FROM, asset_btn_set_compact(), charge_set_enabled(), s_amount_cents, s_amount_cents_label, s_amount_label, s_amount_units, and s_charge_busy.
Referenced by amount_kbd_cb().
| 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_confirm | ( | void | ) |
Definition at line 400 of file ui_sale.cpp.
Referenced by render_requested_screen().
| void build_pin | ( | void | ) |
Definition at line 643 of file ui_sale.cpp.
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_tx_status | ( | void | ) |
Definition at line 734 of file ui_sale.cpp.
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().
|
static |
Charge is available only once there is something to charge.
0.00 is not a sale; a lit button that ignores the tap reads as a missed touch on a resistive panel. btn_event_cb drops the event; this makes that visible.
LV_STATE_DISABLED rather than hiding: LVGL's hit test drops taps on a disabled object (lv_obj_pos.c), so the state is the whole gate. The label is recoloured by hand because make_button() styles the label itself, out of the state's reach.
Definition at line 79 of file ui_sale.cpp.
References COL_ACTION, COL_BG, COL_DIM, COL_SURFACE, and s_charge_btn.
Referenced by amount_update_display().
| 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().
|
static |
Definition at line 532 of file ui_sale.cpp.
Referenced by make_code_field().
|
static |
Definition at line 694 of file ui_sale.cpp.
|
static |
Draw the keypad's backspace as an outline rather than a solid glyph.
LV_SYMBOL_BACKSPACE is a filled slab at 28px, the heaviest mark beside thin numerals. It keeps the digits' colour: grey would read as disabled.
Drawn because a btnmatrix key holds text and the symbol font has no outline backspace: DRAW_PART_BEGIN hides the glyph, END draws in the key's own area. Used on the amount, PIN and admin pads; matched on the key's text, not index.
Definition at line 183 of file ui_sale.cpp.
References BSP_CROSS, BSP_H, BSP_LINE, BSP_NOSE, BSP_NOSE_DX, BSP_NOSE_DY, BSP_R, BSP_R45, BSP_W, and COL_TEXT.
|
static |
Definition at line 168 of file ui_sale.cpp.
|
static |
Definition at line 544 of file ui_sale.cpp.
References code_hint_cb(), COL_DIM, FIELD_PAD_V, font_inter_14, and make_label().
Referenced by make_code_row().
| 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().
| lv_obj_t * make_numeric_keypad | ( | lv_event_cb_t | cb, |
| lv_obj_t * | parent, | ||
| lv_coord_t | w, | ||
| lv_coord_t | h ) |
Definition at line 576 of file ui_sale.cpp.
Referenced by build_admin_screen().
|
static |
Definition at line 515 of file ui_sale.cpp.
References pin_submit(), and s_pin_ta.
|
static |
Definition at line 485 of file ui_sale.cpp.
References request_screen(), s_card_note, s_cb, s_pin, s_pin_for_card, s_pin_len, s_pin_ta, s_tx_info, s_tx_state, UI_EVENT_CARD_PIN, UI_EVENT_PIN_ENTERED, UI_SCREEN_CARD_WAIT, UI_SCREEN_TX_STATUS, and UI_TX_STATE_PLACE_CARD.
Referenced by pin_kbd_cb().
| 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().
|
static |
Definition at line 712 of file ui_sale.cpp.
References asset_name(), COL_TEXT, font_inter_14_medium, make_asset_badge(), make_label(), and settings_get_chain().
|
static |
Definition at line 668 of file ui_sale.cpp.
Referenced by pop_in().