|
cryptnox-pos 1.0.0
Standalone USDC payment terminal firmware (ESP32 + Cryptnox smart card)
|
Panel and touch hardware: TFT_eSPI flush, XPT2046 reads, the LVGL display and input drivers, backlight PWM. More...
#include "ui_internal.h"Go to the source code of this file.
Macros | |
| #define | SWIPE_BAND_H 44 /* press must START in this bottom band */ |
| #define | SWIPE_MIN_DY 58 /* ...and travel at least this far up */ |
| #define | BL_GPIO 21 |
| #define | BL_LEDC_MODE LEDC_LOW_SPEED_MODE |
| #define | BL_LEDC_TIMER LEDC_TIMER_0 |
| #define | BL_LEDC_CH LEDC_CHANNEL_0 |
| #define | BL_LEDC_RES LEDC_TIMER_10_BIT /* duty 0..1023 */ |
| #define | BL_PWM_HZ 5000 /* above the audible range */ |
Functions | |
| SPIClass | touchSPI (VSPI) |
| XPT2046_Touchscreen | touch (T_CS, T_IRQ) |
| 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) |
| static bool | touch_to_screen (int16_t *sx, int16_t *sy, int16_t *sz) |
| 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) |
Variables | |
| TFT_eSPI | tft |
| lv_color_t | s_buf [SCR_W *40] |
| lv_disp_draw_buf_t | s_draw_buf |
| lv_disp_drv_t | s_disp_drv |
| lv_indev_drv_t | s_indev_drv |
| uint16_t | s_cal_xmin = 200U |
| uint16_t | s_cal_xmax = 3800U |
| uint16_t | s_cal_ymin = 200U |
| uint16_t | s_cal_ymax = 3800U |
| uint32_t | s_input_block_until = 0 |
| bool | s_wait_release = false |
| lv_obj_t * | s_page_card = NULL |
| static touch_jump_t | s_jump = { 0, 0, 0, false } |
| static bool | s_jump_logged = false |
| static bool | s_swipe_armed = false |
| static int16_t | s_swipe_y0 = 0 |
| volatile bool | s_swipe_admin = false |
| uint8_t | s_brightness = 80 |
Panel and touch hardware: TFT_eSPI flush, XPT2046 reads, the LVGL display and input drivers, backlight PWM.
Definition in file ui_hal.cpp.
| #define BL_GPIO 21 |
Definition at line 173 of file ui_hal.cpp.
Referenced by backlight_init().
| #define BL_LEDC_CH LEDC_CHANNEL_0 |
Definition at line 176 of file ui_hal.cpp.
Referenced by backlight_init(), and backlight_set_pct().
| #define BL_LEDC_MODE LEDC_LOW_SPEED_MODE |
Definition at line 174 of file ui_hal.cpp.
Referenced by backlight_init(), and backlight_set_pct().
| #define BL_LEDC_RES LEDC_TIMER_10_BIT /* duty 0..1023 */ |
Definition at line 177 of file ui_hal.cpp.
Referenced by backlight_init().
| #define BL_LEDC_TIMER LEDC_TIMER_0 |
Definition at line 175 of file ui_hal.cpp.
Referenced by backlight_init().
| #define BL_PWM_HZ 5000 /* above the audible range */ |
Definition at line 178 of file ui_hal.cpp.
Referenced by backlight_init().
| #define SWIPE_BAND_H 44 /* press must START in this bottom band */ |
Definition at line 99 of file ui_hal.cpp.
Referenced by indev_read().
| #define SWIPE_MIN_DY 58 /* ...and travel at least this far up */ |
Definition at line 100 of file ui_hal.cpp.
Referenced by indev_read().
| 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 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().
| 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().
| bool touch_raw | ( | int16_t * | rx, |
| int16_t * | ry ) |
|
static |
Definition at line 59 of file ui_hal.cpp.
References s_cal_xmax, s_cal_xmin, s_cal_ymax, s_cal_ymin, SCR_H, SCR_W, and touch.
Referenced by indev_read().
| SPIClass touchSPI | ( | VSPI | ) |
| uint8_t s_brightness = 80 |
Definition at line 179 of file ui_hal.cpp.
Referenced by brightness_event_cb(), build_settings(), settings_persist(), and ui_task().
| lv_color_t s_buf[SCR_W *40] |
Definition at line 18 of file ui_hal.cpp.
Referenced by ui_task().
| uint16_t s_cal_xmax = 3800U |
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().
| uint16_t s_cal_xmin = 200U |
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().
| uint16_t s_cal_ymax = 3800U |
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().
| uint16_t s_cal_ymin = 200U |
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().
| lv_disp_drv_t s_disp_drv |
Definition at line 20 of file ui_hal.cpp.
Referenced by ui_task().
| lv_disp_draw_buf_t s_draw_buf |
Definition at line 19 of file ui_hal.cpp.
Referenced by ui_task().
| lv_indev_drv_t s_indev_drv |
Definition at line 21 of file ui_hal.cpp.
Referenced by ui_task().
| uint32_t s_input_block_until = 0 |
Definition at line 79 of file ui_hal.cpp.
Referenced by indev_read(), and render_requested_screen().
|
static |
Definition at line 89 of file ui_hal.cpp.
Referenced by indev_read().
|
static |
Definition at line 90 of file ui_hal.cpp.
Referenced by indev_read().
| lv_obj_t* s_page_card = NULL |
Definition at line 84 of file ui_hal.cpp.
Referenced by build_page(), clear_screen(), and indev_read().
| volatile bool s_swipe_admin = false |
Definition at line 103 of file ui_hal.cpp.
Referenced by indev_read(), and ui_task().
|
static |
Definition at line 101 of file ui_hal.cpp.
Referenced by indev_read().
|
static |
Definition at line 102 of file ui_hal.cpp.
Referenced by indev_read().
| bool s_wait_release = false |
Definition at line 80 of file ui_hal.cpp.
Referenced by indev_read(), and render_requested_screen().
| TFT_eSPI tft |
Definition at line 14 of file ui_hal.cpp.
Referenced by disp_flush(), and ui_task().