Merge pull request #11809 from s-hadinger/lvgl_screenshot

LVGL add screenshot
This commit is contained in:
s-hadinger 2021-04-20 14:20:15 +02:00 committed by GitHub
commit 7f9bbaaa87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 4905 additions and 6786 deletions

View File

@ -20,6 +20,7 @@ extern int lv0_layer_top(bvm *vm);
extern int lv0_layer_sys(bvm *vm);
extern int lv0_get_hor_res(bvm *vm);
extern int lv0_get_ver_res(bvm *vm);
extern int lv0_screenshot(bvm *vm);
#if !BE_USE_PRECOMPILED_OBJECT
@ -617,6 +618,7 @@ be_native_module_attr_table(lvgl) {
be_native_module_function("layer_sys", lv0_layer_sys),
be_native_module_function("get_hor_res", lv0_get_hor_res),
be_native_module_function("get_ver_res", lv0_get_ver_res),
be_native_module_function("screenshot", lv0_screenshot),
};
@ -1152,6 +1154,7 @@ module lvgl (scope: global) {
layer_sys, func(lv0_layer_sys)
get_hor_res, func(lv0_get_hor_res)
get_ver_res, func(lv0_get_ver_res)
screenshot, func(lv0_screenshot)

View File

@ -20,6 +20,7 @@ extern int lv0_layer_top(bvm *vm);
extern int lv0_layer_sys(bvm *vm);
extern int lv0_get_hor_res(bvm *vm);
extern int lv0_get_ver_res(bvm *vm);
extern int lv0_screenshot(bvm *vm);
extern int lco_init(bvm *vm);
extern int lco_tostring(bvm *vm);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,467 +1,468 @@
#include "be_constobj.h"
static be_define_const_map_slots(m_liblvgl_map) {
{ be_const_key(SYMBOL_RIGHT, 114), be_const_str(&be_local_const_str_SYMBOL_RIGHT) },
{ be_const_key(CALENDAR_PART_BG, -1), be_const_int(0) },
{ be_const_key(FS_RES_LOCKED, 106), be_const_int(5) },
{ be_const_key(STYLE_PAD_INNER, 28), be_const_int(20) },
{ be_const_key(DISP_SIZE_MEDIUM, 96), be_const_int(1) },
{ be_const_key(BTNMATRIX_CTRL_CHECKABLE, -1), be_const_int(64) },
{ be_const_key(OPA_40, 53), be_const_int(102) },
{ be_const_key(SYMBOL_IMAGE, 277), be_const_str(&be_local_const_str_SYMBOL_IMAGE) },
{ be_const_key(STYLE_TRANSITION_PROP_6, -1), be_const_int(183) },
{ be_const_key(RED, 270), be_const_int(16711680) },
{ be_const_key(BTN_STATE_RELEASED, -1), be_const_int(0) },
{ be_const_key(FIT_TIGHT, -1), be_const_int(1) },
{ be_const_key(ALIGN_IN_TOP_LEFT, 396), be_const_int(1) },
{ be_const_key(STYLE_BG_GRAD_DIR, 323), be_const_int(35) },
{ be_const_key(OPA_100, -1), be_const_int(255) },
{ be_const_key(LABEL_ALIGN_LEFT, 10), be_const_int(0) },
{ be_const_key(SYMBOL_BATTERY_FULL, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_FULL) },
{ be_const_key(EVENT_FOCUSED, 376), be_const_int(13) },
{ be_const_key(SYMBOL_DUMMY, -1), be_const_str(&be_local_const_str_SYMBOL_DUMMY) },
{ be_const_key(OPA_10, -1), be_const_int(25) },
{ be_const_key(ALIGN_IN_RIGHT_MID, -1), be_const_int(8) },
{ be_const_key(STYLE_BG_OPA, -1), be_const_int(44) },
{ be_const_key(KEY_END, 85), be_const_int(3) },
{ be_const_key(SYMBOL_BATTERY_1, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_1) },
{ be_const_key(CHART_CURSOR_RIGHT, -1), be_const_int(1) },
{ be_const_key(KEY_ESC, -1), be_const_int(27) },
{ be_const_key(OPA_70, 255), be_const_int(178) },
{ be_const_key(LAYOUT_PRETTY_TOP, -1), be_const_int(8) },
{ be_const_key(I2C, -1), be_const_int(1) },
{ be_const_key(CALENDAR_PART_DAY_NAMES, -1), be_const_int(2) },
{ be_const_key(ALIGN_OUT_RIGHT_BOTTOM, -1), be_const_int(20) },
{ be_const_key(KEYBOARD_MODE_TEXT_LOWER, -1), be_const_int(0) },
{ be_const_key(TABVIEW_TAB_POS_TOP, -1), be_const_int(1) },
{ be_const_key(YELLOW, -1), be_const_int(16776960) },
{ be_const_key(SYMBOL_BATTERY_2, 82), be_const_str(&be_local_const_str_SYMBOL_BATTERY_2) },
{ be_const_key(ALIGN_OUT_TOP_RIGHT, 435), be_const_int(11) },
{ be_const_key(LABEL_LONG_SROLL_CIRC, -1), be_const_int(4) },
{ be_const_key(LAYOUT_PRETTY_MID, 254), be_const_int(9) },
{ be_const_key(KEY_PREV, 170), be_const_int(11) },
{ be_const_key(OPA_50, -1), be_const_int(127) },
{ be_const_key(EVENT_INSERT, -1), be_const_int(17) },
{ be_const_key(FS_RES_INV_PARAM, -1), be_const_int(11) },
{ be_const_key(KEYBOARD_MODE_SPECIAL, 384), be_const_int(2) },
{ be_const_key(KEYBOARD_MODE_TEXT_UPPER, -1), be_const_int(1) },
{ be_const_key(EVENT_DEFOCUSED, -1), be_const_int(14) },
{ be_const_key(SYMBOL_BATTERY_3, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_3) },
{ be_const_key(TXT_FLAG_FIT, 299), be_const_int(16) },
{ be_const_key(LABEL_LONG_SROLL, -1), be_const_int(3) },
{ be_const_key(ALIGN_OUT_RIGHT_TOP, -1), be_const_int(18) },
{ be_const_key(ARC_TYPE_REVERSE, -1), be_const_int(2) },
{ be_const_key(FS_RES_NOT_IMP, 212), be_const_int(9) },
{ be_const_key(STYLE_SHADOW_COLOR, 140), be_const_int(89) },
{ be_const_key(STYLE_TEXT_LETTER_SPACE, 256), be_const_int(32896) },
{ be_const_key(SYMBOL_MINUS, 74), be_const_str(&be_local_const_str_SYMBOL_MINUS) },
{ be_const_key(TABVIEW_TAB_POS_BOTTOM, -1), be_const_int(2) },
{ be_const_key(SLIDER_TYPE_RANGE, -1), be_const_int(2) },
{ be_const_key(LAYOUT_CENTER, -1), be_const_int(1) },
{ be_const_key(SYMBOL_DIRECTORY, -1), be_const_str(&be_local_const_str_SYMBOL_DIRECTORY) },
{ be_const_key(STATE_HOVERED, -1), be_const_int(8) },
{ be_const_key(ALIGN_IN_BOTTOM_MID, -1), be_const_int(5) },
{ be_const_key(CHART_AXIS_PRIMARY_Y, -1), be_const_int(0) },
{ be_const_key(SCROLLBAR_MODE_HIDE, 25), be_const_int(4) },
{ be_const_key(CHART_AXIS_SKIP_LAST_TICK, 322), be_const_int(0) },
{ be_const_key(ALIGN_OUT_LEFT_BOTTOM, -1), be_const_int(17) },
{ be_const_key(layer_sys, -1), be_const_func(lv0_layer_sys) },
{ be_const_key(FS_RES_FULL, 400), be_const_int(4) },
{ be_const_key(SYMBOL_STOP, -1), be_const_str(&be_local_const_str_SYMBOL_STOP) },
{ be_const_key(BLEND_MODE_ADDITIVE, -1), be_const_int(1) },
{ be_const_key(DROPDOWN_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(CHART_AXIS_DRAW_LAST_TICK, 362), be_const_int(1) },
{ be_const_key(OPA_0, -1), be_const_int(0) },
{ be_const_key(STYLE_TEXT_BLEND_MODE, 193), be_const_int(32899) },
{ be_const_key(STYLE_VALUE_STR, 202), be_const_int(127) },
{ be_const_key(GRAD_DIR_VER, 291), be_const_int(1) },
{ be_const_key(CHART_UPDATE_MODE_SHIFT, 269), be_const_int(0) },
{ be_const_key(TEXTAREA_CURSOR_LAST, 157), be_const_int(32767) },
{ be_const_key(CPICKER_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(CPICKER_PART_KNOB, -1), be_const_int(1) },
{ be_const_key(LAYOUT_ROW_BOTTOM, 205), be_const_int(7) },
{ be_const_key(SCROLLBAR_MODE_OFF, -1), be_const_int(0) },
{ be_const_key(BTN_STATE_CHECKED_DISABLED, -1), be_const_int(5) },
{ be_const_key(EVENT_PRESSING, 280), be_const_int(1) },
{ be_const_key(GESTURE_DIR_BOTTOM, -1), be_const_int(1) },
{ be_const_key(EVENT_RELEASED, -1), be_const_int(7) },
{ be_const_key(GAUGE_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(EVENT_PRESS_LOST, 300), be_const_int(2) },
{ be_const_key(FS_RES_OK, -1), be_const_int(0) },
{ be_const_key(CHART_AXIS_INVERSE_LABELS_ORDER, 389), be_const_int(2) },
{ be_const_key(STYLE_TEXT_FONT, -1), be_const_int(32910) },
{ be_const_key(STYLE_VALUE_OFS_Y, -1), be_const_int(116) },
{ be_const_key(CPICKER_COLOR_MODE_VALUE, 194), be_const_int(2) },
{ be_const_key(STYLE_PATTERN_REPEAT, -1), be_const_int(97) },
{ be_const_key(OPA_80, -1), be_const_int(204) },
{ be_const_key(PROTECT_POS, 265), be_const_int(4) },
{ be_const_key(OBJMASK_PART_MAIN, 6), be_const_int(0) },
{ be_const_key(STYLE_PATTERN_IMAGE, 455), be_const_int(110) },
{ be_const_key(STYLE_TEXT_SEL_COLOR, -1), be_const_int(32906) },
{ be_const_key(DROPDOWN_DIR_UP, -1), be_const_int(1) },
{ be_const_key(STYLE_TRANSFORM_HEIGHT, -1), be_const_int(5) },
{ be_const_key(OBJ_PART_VIRTUAL_FIRST, -1), be_const_int(1) },
{ be_const_key(STYLE_TRANSITION_DELAY, 148), be_const_int(177) },
{ be_const_key(STYLE_TRANSFORM_ZOOM, -1), be_const_int(7) },
{ be_const_key(BAR_TYPE_CUSTOM, 375), be_const_int(2) },
{ be_const_key(ALIGN_OUT_BOTTOM_LEFT, -1), be_const_int(12) },
{ be_const_key(scr_act, 50), be_const_func(lv0_scr_act) },
{ be_const_key(OPA_COVER, -1), be_const_int(255) },
{ be_const_key(GRAY, -1), be_const_int(8421504) },
{ be_const_key(BORDER_SIDE_FULL, 36), be_const_int(15) },
{ be_const_key(BLACK, -1), be_const_int(0) },
{ be_const_key(MAROON, 98), be_const_int(8388608) },
{ be_const_key(FS_RES_UNKNOWN, -1), be_const_int(12) },
{ be_const_key(CALENDAR_PART_HEADER, -1), be_const_int(1) },
{ be_const_key(ALIGN_OUT_TOP_MID, -1), be_const_int(10) },
{ be_const_key(STYLE_IMAGE_OPA, 95), be_const_int(32940) },
{ be_const_key(FS_MODE_WR, -1), be_const_int(1) },
{ be_const_key(BAR_TYPE_SYMMETRICAL, -1), be_const_int(1) },
{ be_const_key(PROTECT_CLICK_FOCUS, 97), be_const_int(32) },
{ be_const_key(SYMBOL_PASTE, -1), be_const_str(&be_local_const_str_SYMBOL_PASTE) },
{ be_const_key(OBJ_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(STYLE_OUTLINE_BLEND_MODE, -1), be_const_int(66) },
{ be_const_key(DROPDOWN_DIR_DOWN, -1), be_const_int(0) },
{ be_const_key(SYMBOL_VIDEO, -1), be_const_str(&be_local_const_str_SYMBOL_VIDEO) },
{ be_const_key(LAYOUT_PRETTY_BOTTOM, -1), be_const_int(10) },
{ be_const_key(SYMBOL_POWER, -1), be_const_str(&be_local_const_str_SYMBOL_POWER) },
{ be_const_key(BTNMATRIX_CTRL_CLICK_TRIG, -1), be_const_int(256) },
{ be_const_key(BTNMATRIX_CTRL_DISABLED, -1), be_const_int(32) },
{ be_const_key(CHART_CURSOR_UP, -1), be_const_int(2) },
{ be_const_key(LINEMETER_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(SYMBOL_EYE_OPEN, 309), be_const_str(&be_local_const_str_SYMBOL_EYE_OPEN) },
{ be_const_key(OPA_30, 107), be_const_int(76) },
{ be_const_key(STYLE_SIZE, -1), be_const_int(3) },
{ be_const_key(ALIGN_IN_BOTTOM_RIGHT, -1), be_const_int(6) },
{ be_const_key(STATE_FOCUSED, -1), be_const_int(2) },
{ be_const_key(DRAG_DIR_BOTH, -1), be_const_int(3) },
{ be_const_key(STYLE_TEXT_DECOR, -1), be_const_int(32898) },
{ be_const_key(TEXT_DECOR_UNDERLINE, -1), be_const_int(1) },
{ be_const_key(LABEL_ALIGN_RIGHT, 290), be_const_int(2) },
{ be_const_key(TXT_FLAG_NONE, -1), be_const_int(0) },
{ be_const_key(STYLE_IMAGE_BLEND_MODE, 258), be_const_int(32928) },
{ be_const_key(STATE_PRESSED, -1), be_const_int(16) },
{ be_const_key(BTNMATRIX_CTRL_CHECK_STATE, -1), be_const_int(128) },
{ be_const_key(ARC_PART_BG, 392), be_const_int(0) },
{ be_const_key(STYLE_SHADOW_OPA, 208), be_const_int(92) },
{ be_const_key(EVENT_DRAG_THROW_BEGIN, -1), be_const_int(10) },
{ be_const_key(LABEL_LONG_DOT, -1), be_const_int(2) },
{ be_const_key(TABVIEW_TAB_POS_RIGHT, 242), be_const_int(4) },
{ be_const_key(CHART_PART_SERIES, 51), be_const_int(2) },
{ be_const_key(STYLE_MARGIN_LEFT, 83), be_const_int(23) },
{ be_const_key(GREEN, -1), be_const_int(32768) },
{ be_const_key(STYLE_BORDER_SIDE, 286), be_const_int(49) },
{ be_const_key(SYMBOL_DRIVE, -1), be_const_str(&be_local_const_str_SYMBOL_DRIVE) },
{ be_const_key(SYMBOL_UP, -1), be_const_str(&be_local_const_str_SYMBOL_UP) },
{ be_const_key(STYLE_PAD_BOTTOM, -1), be_const_int(17) },
{ be_const_key(SCROLLBAR_MODE_UNHIDE, 369), be_const_int(8) },
{ be_const_key(DISP_ROT_90, -1), be_const_int(1) },
{ be_const_key(STYLE_SHADOW_BLEND_MODE, 43), be_const_int(84) },
{ be_const_key(SCROLLBAR_MODE_DRAG, -1), be_const_int(2) },
{ be_const_key(EVENT_DELETE, -1), be_const_int(21) },
{ be_const_key(SYMBOL_PLUS, -1), be_const_str(&be_local_const_str_SYMBOL_PLUS) },
{ be_const_key(PAGE_EDGE_RIGHT, -1), be_const_int(4) },
{ be_const_key(ANIM_ON, -1), be_const_int(1) },
{ be_const_key(FS_RES_BUSY, 16), be_const_int(7) },
{ be_const_key(PAGE_EDGE_TOP, 395), be_const_int(2) },
{ be_const_key(SPINNER_TYPE_CONSTANT_ARC, 146), be_const_int(2) },
{ be_const_key(STYLE_SCALE_GRAD_COLOR, -1), be_const_int(201) },
{ be_const_key(BTN_STATE_CHECKED_PRESSED, -1), be_const_int(4) },
{ be_const_key(KEY_UP, 222), be_const_int(17) },
{ be_const_key(FS_MODE_RD, 213), be_const_int(2) },
{ be_const_key(LABEL_LONG_BREAK, 333), be_const_int(1) },
{ be_const_key(KEY_DOWN, 246), be_const_int(18) },
{ be_const_key(ALIGN_OUT_BOTTOM_RIGHT, -1), be_const_int(14) },
{ be_const_key(LAYOUT_COLUMN_RIGHT, 211), be_const_int(4) },
{ be_const_key(ALIGN_OUT_BOTTOM_MID, -1), be_const_int(13) },
{ be_const_key(DROPDOWN_PART_LIST, 37), be_const_int(64) },
{ be_const_key(KEY_DEL, 31), be_const_int(127) },
{ be_const_key(SYMBOL_SETTINGS, -1), be_const_str(&be_local_const_str_SYMBOL_SETTINGS) },
{ be_const_key(SYMBOL_USB, -1), be_const_str(&be_local_const_str_SYMBOL_USB) },
{ be_const_key(CALENDAR_PART_DATE, 346), be_const_int(3) },
{ be_const_key(layer_top, 342), be_const_func(lv0_layer_top) },
{ be_const_key(STYLE_PATTERN_BLEND_MODE, -1), be_const_int(96) },
{ be_const_key(ARC_TYPE_SYMMETRIC, 38), be_const_int(1) },
{ be_const_key(GESTURE_DIR_RIGHT, 47), be_const_int(3) },
{ be_const_key(BTN_STATE_DISABLED, 71), be_const_int(2) },
{ be_const_key(EVENT_KEY, -1), be_const_int(12) },
{ be_const_key(TEMPL_STYLE_X, 326), be_const_int(0) },
{ be_const_key(SLIDER_TYPE_NORMAL, -1), be_const_int(0) },
{ be_const_key(LIST_PART_SCROLLBAR, -1), be_const_int(1) },
{ be_const_key(CPICKER_COLOR_MODE_SATURATION, -1), be_const_int(1) },
{ be_const_key(STYLE_TEXT_LINE_SPACE, -1), be_const_int(32897) },
{ be_const_key(SYMBOL_HOME, -1), be_const_str(&be_local_const_str_SYMBOL_HOME) },
{ be_const_key(STYLE_BG_GRAD_STOP, 315), be_const_int(34) },
{ be_const_key(TEAL, -1), be_const_int(32896) },
{ be_const_key(LIST_PART_EDGE_FLASH, -1), be_const_int(2) },
{ be_const_key(STYLE_LINE_WIDTH, 427), be_const_int(144) },
{ be_const_key(LIME, -1), be_const_int(65280) },
{ be_const_key(TEMPL_STYLE_Y, 125), be_const_int(1) },
{ be_const_key(EVENT_CANCEL, -1), be_const_int(20) },
{ be_const_key(STYLE_MARGIN_BOTTOM, -1), be_const_int(22) },
{ be_const_key(SYMBOL_EDIT, 426), be_const_str(&be_local_const_str_SYMBOL_EDIT) },
{ be_const_key(SYMBOL_KEYBOARD, 69), be_const_str(&be_local_const_str_SYMBOL_KEYBOARD) },
{ be_const_key(LAYOUT_GRID, 447), be_const_int(11) },
{ be_const_key(SPINNER_DIR_BACKWARD, 252), be_const_int(1) },
{ be_const_key(SILVER, 365), be_const_int(12632256) },
{ be_const_key(SYMBOL_SHUFFLE, -1), be_const_str(&be_local_const_str_SYMBOL_SHUFFLE) },
{ be_const_key(OPA_TRANSP, -1), be_const_int(0) },
{ be_const_key(STYLE_VALUE_OFS_X, 436), be_const_int(115) },
{ be_const_key(STYLE_TRANSITION_PROP_3, -1), be_const_int(180) },
{ be_const_key(SPINNER_DIR_FORWARD, 27), be_const_int(0) },
{ be_const_key(SPINNER_TYPE_FILLSPIN_ARC, -1), be_const_int(1) },
{ be_const_key(STYLE_MARGIN_TOP, 454), be_const_int(21) },
{ be_const_key(SYMBOL_BULLET, -1), be_const_str(&be_local_const_str_SYMBOL_BULLET) },
{ be_const_key(LAYOUT_COLUMN_MID, -1), be_const_int(3) },
{ be_const_key(SSPI, 397), be_const_int(2) },
{ be_const_key(STYLE_IMAGE_RECOLOR, 284), be_const_int(32937) },
{ be_const_key(KEYBOARD_PART_BG, -1), be_const_int(0) },
{ be_const_key(SYMBOL_COPY, 282), be_const_str(&be_local_const_str_SYMBOL_COPY) },
{ be_const_key(STYLE_BG_BLEND_MODE, 273), be_const_int(32) },
{ be_const_key(STYLE_TRANSITION_PROP_2, 388), be_const_int(179) },
{ be_const_key(TXT_FLAG_CENTER, -1), be_const_int(4) },
{ be_const_key(OPA_90, -1), be_const_int(229) },
{ be_const_key(PAGE_EDGE_BOTTOM, 166), be_const_int(8) },
{ be_const_key(FIT_MAX, 26), be_const_int(3) },
{ be_const_key(CHART_AXIS_SECONDARY_Y, -1), be_const_int(1) },
{ be_const_key(LIST_PART_BG, 237), be_const_int(0) },
{ be_const_key(EVENT_DRAG_BEGIN, 35), be_const_int(8) },
{ be_const_key(FIT_PARENT, 424), be_const_int(2) },
{ be_const_key(CHART_CURSOR_LEFT, 177), be_const_int(4) },
{ be_const_key(PROTECT_PRESS_LOST, -1), be_const_int(16) },
{ be_const_key(STYLE_TRANSITION_PROP_5, -1), be_const_int(182) },
{ be_const_key(DROPDOWN_PART_SCROLLBAR, 243), be_const_int(65) },
{ be_const_key(GAUGE_PART_NEEDLE, -1), be_const_int(2) },
{ be_const_key(LABEL_LONG_CROP, -1), be_const_int(5) },
{ be_const_key(SYMBOL_TRASH, 127), be_const_str(&be_local_const_str_SYMBOL_TRASH) },
{ be_const_key(STYLE_LINE_BLEND_MODE, 81), be_const_int(145) },
{ be_const_key(STYLE_TRANSFORM_WIDTH, 196), be_const_int(4) },
{ be_const_key(TXT_FLAG_RIGHT, -1), be_const_int(8) },
{ be_const_key(STYLE_LINE_OPA, -1), be_const_int(156) },
{ be_const_key(ALIGN_OUT_LEFT_TOP, -1), be_const_int(15) },
{ be_const_key(ARC_TYPE_NORMAL, 210), be_const_int(0) },
{ be_const_key(STYLE_TRANSITION_PROP_4, -1), be_const_int(181) },
{ be_const_key(CHART_PART_CURSOR, 356), be_const_int(3) },
{ be_const_key(STYLE_PATTERN_RECOLOR_OPA, -1), be_const_int(109) },
{ be_const_key(STYLE_BG_MAIN_STOP, 301), be_const_int(33) },
{ be_const_key(AQUA, -1), be_const_int(65535) },
{ be_const_key(STATE_CHECKED, 90), be_const_int(1) },
{ be_const_key(CHART_PART_BG, -1), be_const_int(0) },
{ be_const_key(STYLE_LINE_DASH_GAP, 321), be_const_int(147) },
{ be_const_key(SYMBOL_NEXT, -1), be_const_str(&be_local_const_str_SYMBOL_NEXT) },
{ be_const_key(STYLE_SCALE_WIDTH, -1), be_const_int(192) },
{ be_const_key(STYLE_RADIUS, -1), be_const_int(1) },
{ be_const_key(montserrat_font, -1), be_const_func(lv0_load_montserrat_font) },
{ be_const_key(EVENT_LONG_PRESSED_REPEAT, -1), be_const_int(5) },
{ be_const_key(SYMBOL_CHARGE, 316), be_const_str(&be_local_const_str_SYMBOL_CHARGE) },
{ be_const_key(ALIGN_IN_LEFT_MID, -1), be_const_int(7) },
{ be_const_key(STYLE_LINE_COLOR, -1), be_const_int(153) },
{ be_const_key(BORDER_SIDE_LEFT, -1), be_const_int(4) },
{ be_const_key(STYLE_BG_COLOR, 298), be_const_int(41) },
{ be_const_key(PROTECT_PARENT, -1), be_const_int(2) },
{ be_const_key(STYLE_OPA_SCALE, -1), be_const_int(32780) },
{ be_const_key(STYLE_SHADOW_SPREAD, -1), be_const_int(83) },
{ be_const_key(SYMBOL_OK, 337), be_const_str(&be_local_const_str_SYMBOL_OK) },
{ be_const_key(STYLE_TEXT_OPA, 8), be_const_int(32908) },
{ be_const_key(STYLE_PATTERN_OPA, -1), be_const_int(108) },
{ be_const_key(TXT_FLAG_EXPAND, 410), be_const_int(2) },
{ be_const_key(DRAG_DIR_ONE, -1), be_const_int(4) },
{ be_const_key(STYLE_OUTLINE_PAD, -1), be_const_int(65) },
{ be_const_key(STYLE_BORDER_WIDTH, 201), be_const_int(48) },
{ be_const_key(EVENT_LONG_PRESSED, 73), be_const_int(4) },
{ be_const_key(CPICKER_TYPE_RECT, 409), be_const_int(0) },
{ be_const_key(BORDER_SIDE_RIGHT, -1), be_const_int(8) },
{ be_const_key(STYLE_OUTLINE_WIDTH, -1), be_const_int(64) },
{ be_const_key(ARC_PART_INDIC, -1), be_const_int(1) },
{ be_const_key(STYLE_PATTERN_RECOLOR, -1), be_const_int(105) },
{ be_const_key(TXT_CMD_STATE_PAR, 115), be_const_int(1) },
{ be_const_key(STYLE_SCALE_BORDER_WIDTH, -1), be_const_int(193) },
{ be_const_key(SYMBOL_MUTE, 102), be_const_str(&be_local_const_str_SYMBOL_MUTE) },
{ be_const_key(BTN_STATE_PRESSED, 353), be_const_int(1) },
{ be_const_key(STYLE_SCALE_END_BORDER_WIDTH, -1), be_const_int(194) },
{ be_const_key(STATE_EDITED, -1), be_const_int(4) },
{ be_const_key(SYMBOL_LEFT, -1), be_const_str(&be_local_const_str_SYMBOL_LEFT) },
{ be_const_key(LABEL_ALIGN_CENTER, -1), be_const_int(1) },
{ be_const_key(STYLE_BG_GRAD_COLOR, 274), be_const_int(42) },
{ be_const_key(STYLE_SCALE_END_LINE_WIDTH, -1), be_const_int(195) },
{ be_const_key(DISP_ROT_180, 103), be_const_int(2) },
{ be_const_key(FIT_NONE, -1), be_const_int(0) },
{ be_const_key(LAYOUT_OFF, 40), be_const_int(0) },
{ be_const_key(DISP_SIZE_MEDIUM, -1), be_const_int(1) },
{ be_const_key(BORDER_SIDE_INTERNAL, -1), be_const_int(16) },
{ be_const_key(BORDER_SIDE_TOP, -1), be_const_int(2) },
{ be_const_key(BLEND_MODE_NORMAL, -1), be_const_int(0) },
{ be_const_key(KEY_RIGHT, 154), be_const_int(19) },
{ be_const_key(CHECKBOX_PART_BG, -1), be_const_int(0) },
{ be_const_key(CHART_UPDATE_MODE_CIRCULAR, -1), be_const_int(1) },
{ be_const_key(TEXT_DECOR_STRIKETHROUGH, -1), be_const_int(2) },
{ be_const_key(ROLLER_MODE_INFINITE, -1), be_const_int(1) },
{ be_const_key(SYMBOL_PAUSE, -1), be_const_str(&be_local_const_str_SYMBOL_PAUSE) },
{ be_const_key(FS_RES_DENIED, 215), be_const_int(6) },
{ be_const_key(SLIDER_TYPE_SYMMETRICAL, -1), be_const_int(1) },
{ be_const_key(SYMBOL_REFRESH, -1), be_const_str(&be_local_const_str_SYMBOL_REFRESH) },
{ be_const_key(SYMBOL_AUDIO, -1), be_const_str(&be_local_const_str_SYMBOL_AUDIO) },
{ be_const_key(FS_RES_OUT_OF_MEM, 293), be_const_int(10) },
{ be_const_key(PROTECT_EVENT_TO_DISABLED, -1), be_const_int(64) },
{ be_const_key(DRAG_DIR_HOR, -1), be_const_int(1) },
{ be_const_key(STYLE_VALUE_ALIGN, -1), be_const_int(117) },
{ be_const_key(KEY_BACKSPACE, -1), be_const_int(8) },
{ be_const_key(EVENT_LEAVE, -1), be_const_int(15) },
{ be_const_key(DRAG_DIR_VER, -1), be_const_int(2) },
{ be_const_key(TXT_CMD_STATE_WAIT, -1), be_const_int(0) },
{ be_const_key(SCROLLBAR_MODE_ON, 442), be_const_int(1) },
{ be_const_key(STYLE_MARGIN_RIGHT, 207), be_const_int(24) },
{ be_const_key(DROPDOWN_DIR_LEFT, -1), be_const_int(2) },
{ be_const_key(STYLE_TEXT_COLOR, -1), be_const_int(32905) },
{ be_const_key(KEYBOARD_PART_BTN, 370), be_const_int(1) },
{ be_const_key(STYLE_TRANSITION_TIME, 272), be_const_int(176) },
{ be_const_key(EVENT_CLICKED, -1), be_const_int(6) },
{ be_const_key(SYMBOL_GPS, 92), be_const_str(&be_local_const_str_SYMBOL_GPS) },
{ be_const_key(DISP_SIZE_EXTRA_LARGE, -1), be_const_int(3) },
{ be_const_key(KEY_HOME, -1), be_const_int(2) },
{ be_const_key(SYMBOL_BATTERY_EMPTY, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_EMPTY) },
{ be_const_key(STYLE_VALUE_COLOR, -1), be_const_int(121) },
{ be_const_key(FS_RES_FS_ERR, 390), be_const_int(2) },
{ be_const_key(MAGENTA, 303), be_const_int(16711935) },
{ be_const_key(ROLLER_MODE_NORMAL, -1), be_const_int(0) },
{ be_const_key(GAUGE_PART_MAJOR, -1), be_const_int(1) },
{ be_const_key(SYMBOL_VOLUME_MAX, -1), be_const_str(&be_local_const_str_SYMBOL_VOLUME_MAX) },
{ be_const_key(STYLE_PAD_LEFT, 310), be_const_int(18) },
{ be_const_key(BLUE, -1), be_const_int(255) },
{ be_const_key(STYLE_TRANSITION_PROP_1, -1), be_const_int(178) },
{ be_const_key(STYLE_OUTLINE_COLOR, -1), be_const_int(73) },
{ be_const_key(TXT_CMD_STATE_IN, 329), be_const_int(2) },
{ be_const_key(GRAD_DIR_NONE, 318), be_const_int(0) },
{ be_const_key(STYLE_SHADOW_OFS_Y, 61), be_const_int(82) },
{ be_const_key(EVENT_GESTURE, -1), be_const_int(11) },
{ be_const_key(EVENT_DRAG_END, 294), be_const_int(9) },
{ be_const_key(STYLE_BORDER_POST, 48), be_const_int(51) },
{ be_const_key(SYMBOL_CALL, 152), be_const_str(&be_local_const_str_SYMBOL_CALL) },
{ be_const_key(PURPLE, 382), be_const_int(8388736) },
{ be_const_key(DROPDOWN_PART_SELECTED, -1), be_const_int(66) },
{ be_const_key(FS_RES_TOUT, -1), be_const_int(8) },
{ be_const_key(OBJ_PART_ALL, -1), be_const_int(255) },
{ be_const_key(CPICKER_TYPE_DISC, -1), be_const_int(1) },
{ be_const_key(CYAN, -1), be_const_int(65535) },
{ be_const_key(STYLE_SHADOW_OFS_X, 317), be_const_int(81) },
{ be_const_key(PAGE_EDGE_LEFT, -1), be_const_int(1) },
{ be_const_key(ALIGN_OUT_TOP_LEFT, -1), be_const_int(9) },
{ be_const_key(PROTECT_NONE, -1), be_const_int(0) },
{ be_const_key(KEY_ENTER, 120), be_const_int(10) },
{ be_const_key(DISP_ROT_NONE, -1), be_const_int(0) },
{ be_const_key(GRAD_DIR_HOR, -1), be_const_int(2) },
{ be_const_key(OPA_60, -1), be_const_int(153) },
{ be_const_key(CHART_CURSOR_NONE, -1), be_const_int(0) },
{ be_const_key(WHITE, -1), be_const_int(16777215) },
{ be_const_key(SYMBOL_EJECT, 304), be_const_str(&be_local_const_str_SYMBOL_EJECT) },
{ be_const_key(STYLE_SHADOW_WIDTH, -1), be_const_int(80) },
{ be_const_key(GESTURE_DIR_TOP, -1), be_const_int(0) },
{ be_const_key(STYLE_IMAGE_RECOLOR_OPA, -1), be_const_int(32941) },
{ be_const_key(CHART_TYPE_LINE, 29), be_const_int(1) },
{ be_const_key(GESTURE_DIR_LEFT, -1), be_const_int(2) },
{ be_const_key(SPI, -1), be_const_int(0) },
{ be_const_key(LAYOUT_COLUMN_LEFT, 367), be_const_int(2) },
{ be_const_key(HSPI, -1), be_const_int(0) },
{ be_const_key(SYMBOL_EYE_CLOSE, 124), be_const_str(&be_local_const_str_SYMBOL_EYE_CLOSE) },
{ be_const_key(KEYBOARD_MODE_NUM, 56), be_const_int(3) },
{ be_const_key(SYMBOL_BELL, -1), be_const_str(&be_local_const_str_SYMBOL_BELL) },
{ be_const_key(STYLE_TEXT_SEL_BG_COLOR, -1), be_const_int(32907) },
{ be_const_key(STATE_DEFAULT, 60), be_const_int(0) },
{ be_const_key(LAYOUT_ROW_TOP, -1), be_const_int(5) },
{ be_const_key(ALIGN_OUT_LEFT_MID, 216), be_const_int(16) },
{ be_const_key(SYMBOL_CLOSE, -1), be_const_str(&be_local_const_str_SYMBOL_CLOSE) },
{ be_const_key(STYLE_VALUE_LETTER_SPACE, -1), be_const_int(112) },
{ be_const_key(NAVY, 414), be_const_int(128) },
{ be_const_key(SYMBOL_SAVE, 420), be_const_str(&be_local_const_str_SYMBOL_SAVE) },
{ be_const_key(SYMBOL_NEW_LINE, -1), be_const_str(&be_local_const_str_SYMBOL_NEW_LINE) },
{ be_const_key(SYMBOL_FILE, -1), be_const_str(&be_local_const_str_SYMBOL_FILE) },
{ be_const_key(SYMBOL_DOWNLOAD, -1), be_const_str(&be_local_const_str_SYMBOL_DOWNLOAD) },
{ be_const_key(ARC_PART_KNOB, -1), be_const_int(2) },
{ be_const_key(BAR_TYPE_NORMAL, -1), be_const_int(0) },
{ be_const_key(VSPI, -1), be_const_int(1) },
{ be_const_key(STYLE_VALUE_OPA, 14), be_const_int(124) },
{ be_const_key(SYMBOL_DOWN, -1), be_const_str(&be_local_const_str_SYMBOL_DOWN) },
{ be_const_key(EVENT_REFRESH, -1), be_const_int(18) },
{ be_const_key(EVENT_APPLY, -1), be_const_int(19) },
{ be_const_key(STYLE_BORDER_BLEND_MODE, -1), be_const_int(50) },
{ be_const_key(CPICKER_COLOR_MODE_HUE, 429), be_const_int(0) },
{ be_const_key(start, -1), be_const_func(lv0_start) },
{ be_const_key(ANIM_OFF, -1), be_const_int(0) },
{ be_const_key(STYLE_CLIP_CORNER, -1), be_const_int(2) },
{ be_const_key(BTNMATRIX_CTRL_NO_REPEAT, -1), be_const_int(16) },
{ be_const_key(TEXT_DECOR_NONE, -1), be_const_int(0) },
{ be_const_key(ALIGN_IN_TOP_RIGHT, -1), be_const_int(3) },
{ be_const_key(BLEND_MODE_SUBTRACTIVE, 439), be_const_int(2) },
{ be_const_key(BORDER_SIDE_BOTTOM, 143), be_const_int(1) },
{ be_const_key(CHART_TYPE_NONE, 344), be_const_int(0) },
{ be_const_key(FS_RES_HW_ERR, -1), be_const_int(1) },
{ be_const_key(LABEL_LONG_EXPAND, -1), be_const_int(0) },
{ be_const_key(SYMBOL_CUT, 340), be_const_str(&be_local_const_str_SYMBOL_CUT) },
{ be_const_key(STYLE_OUTLINE_OPA, -1), be_const_int(76) },
{ be_const_key(SYMBOL_SD_CARD, 448), be_const_str(&be_local_const_str_SYMBOL_SD_CARD) },
{ be_const_key(EVENT_SHORT_CLICKED, 405), be_const_int(3) },
{ be_const_key(BORDER_SIDE_NONE, -1), be_const_int(0) },
{ be_const_key(CHART_CURSOR_DOWN, -1), be_const_int(8) },
{ be_const_key(ALIGN_OUT_RIGHT_MID, -1), be_const_int(19) },
{ be_const_key(SYMBOL_BACKSPACE, 15), be_const_str(&be_local_const_str_SYMBOL_BACKSPACE) },
{ be_const_key(STYLE_TRANSITION_PATH, 188), be_const_int(190) },
{ be_const_key(STYLE_LINE_ROUNDED, -1), be_const_int(148) },
{ be_const_key(OLIVE, 9), be_const_int(8421376) },
{ be_const_key(SYMBOL_LOOP, -1), be_const_str(&be_local_const_str_SYMBOL_LOOP) },
{ be_const_key(STYLE_VALUE_LINE_SPACE, -1), be_const_int(113) },
{ be_const_key(CHART_PART_SERIES_BG, 4), be_const_int(1) },
{ be_const_key(STYLE_VALUE_FONT, -1), be_const_int(126) },
{ be_const_key(FS_RES_FS_ERR, 193), be_const_int(2) },
{ be_const_key(ANIM_ON, -1), be_const_int(1) },
{ be_const_key(OPA_40, -1), be_const_int(102) },
{ be_const_key(SCROLLBAR_MODE_OFF, 400), be_const_int(0) },
{ be_const_key(STYLE_VALUE_FONT, 280), be_const_int(126) },
{ be_const_key(STYLE_TRANSFORM_HEIGHT, -1), be_const_int(5) },
{ be_const_key(ARC_PART_INDIC, -1), be_const_int(1) },
{ be_const_key(DISP_ROT_NONE, 395), be_const_int(0) },
{ be_const_key(scr_act, 433), be_const_func(lv0_scr_act) },
{ be_const_key(STYLE_PAD_BOTTOM, -1), be_const_int(17) },
{ be_const_key(SYMBOL_BATTERY_FULL, 278), be_const_str(&be_local_const_str_SYMBOL_BATTERY_FULL) },
{ be_const_key(RED, -1), be_const_int(16711680) },
{ be_const_key(TXT_CMD_STATE_IN, 130), be_const_int(2) },
{ be_const_key(GRAD_DIR_NONE, -1), be_const_int(0) },
{ be_const_key(OPA_100, -1), be_const_int(255) },
{ be_const_key(SLIDER_TYPE_RANGE, 370), be_const_int(2) },
{ be_const_key(SYMBOL_BATTERY_2, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_2) },
{ be_const_key(STYLE_VALUE_OFS_X, 434), be_const_int(115) },
{ be_const_key(STYLE_SCALE_WIDTH, -1), be_const_int(192) },
{ be_const_key(STYLE_SCALE_END_BORDER_WIDTH, -1), be_const_int(194) },
{ be_const_key(ALIGN_OUT_TOP_RIGHT, -1), be_const_int(11) },
{ be_const_key(ALIGN_OUT_LEFT_TOP, -1), be_const_int(15) },
{ be_const_key(SYMBOL_SD_CARD, -1), be_const_str(&be_local_const_str_SYMBOL_SD_CARD) },
{ be_const_key(EVENT_INSERT, -1), be_const_int(17) },
{ be_const_key(SYMBOL_PLAY, -1), be_const_str(&be_local_const_str_SYMBOL_PLAY) },
{ be_const_key(DISP_SIZE_LARGE, -1), be_const_int(2) },
{ be_const_key(BTN_STATE_CHECKED_RELEASED, 133), be_const_int(3) },
{ be_const_key(SYMBOL_BLUETOOTH, -1), be_const_str(&be_local_const_str_SYMBOL_BLUETOOTH) },
{ be_const_key(STYLE_SCALE_END_COLOR, -1), be_const_int(202) },
{ be_const_key(SPINNER_TYPE_SPINNING_ARC, 443), be_const_int(0) },
{ be_const_key(SYMBOL_WIFI, 24), be_const_str(&be_local_const_str_SYMBOL_WIFI) },
{ be_const_key(STYLE_BORDER_OPA, -1), be_const_int(60) },
{ be_const_key(STYLE_PAD_RIGHT, -1), be_const_int(19) },
{ be_const_key(OBJ_PART_REAL_FIRST, 136), be_const_int(64) },
{ be_const_key(STATE_DISABLED, -1), be_const_int(32) },
{ be_const_key(SYMBOL_UPLOAD, -1), be_const_str(&be_local_const_str_SYMBOL_UPLOAD) },
{ be_const_key(STYLE_TRANSFORM_ANGLE, -1), be_const_int(6) },
{ be_const_key(EVENT_VALUE_CHANGED, -1), be_const_int(16) },
{ be_const_key(TABVIEW_TAB_POS_NONE, -1), be_const_int(0) },
{ be_const_key(SYMBOL_VOLUME_MID, -1), be_const_str(&be_local_const_str_SYMBOL_VOLUME_MID) },
{ be_const_key(STYLE_LINE_DASH_WIDTH, -1), be_const_int(146) },
{ be_const_key(SYMBOL_WARNING, -1), be_const_str(&be_local_const_str_SYMBOL_WARNING) },
{ be_const_key(ALIGN_IN_BOTTOM_LEFT, -1), be_const_int(4) },
{ be_const_key(TABVIEW_TAB_POS_LEFT, 88), be_const_int(3) },
{ be_const_key(DISP_SIZE_SMALL, -1), be_const_int(0) },
{ be_const_key(ALIGN_CENTER, -1), be_const_int(0) },
{ be_const_key(SYMBOL_PREV, 385), be_const_str(&be_local_const_str_SYMBOL_PREV) },
{ be_const_key(get_hor_res, -1), be_const_func(lv0_get_hor_res) },
{ be_const_key(DISP_ROT_270, -1), be_const_int(3) },
{ be_const_key(PROTECT_CHILD_CHG, -1), be_const_int(1) },
{ be_const_key(OPA_20, -1), be_const_int(51) },
{ be_const_key(LED_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(CHECKBOX_PART_BULLET, -1), be_const_int(64) },
{ be_const_key(EVENT_PRESSED, -1), be_const_int(0) },
{ be_const_key(LABEL_ALIGN_AUTO, -1), be_const_int(3) },
{ be_const_key(get_ver_res, -1), be_const_func(lv0_get_ver_res) },
{ be_const_key(STYLE_BORDER_COLOR, -1), be_const_int(57) },
{ be_const_key(BTNMATRIX_CTRL_HIDDEN, 453), be_const_int(8) },
{ be_const_key(TXT_FLAG_RECOLOR, -1), be_const_int(1) },
{ be_const_key(KEY_LEFT, -1), be_const_int(20) },
{ be_const_key(SCROLLBAR_MODE_AUTO, -1), be_const_int(3) },
{ be_const_key(SYMBOL_LIST, 165), be_const_str(&be_local_const_str_SYMBOL_LIST) },
{ be_const_key(STYLE_PAD_TOP, -1), be_const_int(16) },
{ be_const_key(PROTECT_FOLLOW, -1), be_const_int(8) },
{ be_const_key(VSPI, -1), be_const_int(1) },
{ be_const_key(STYLE_SHADOW_WIDTH, 376), be_const_int(80) },
{ be_const_key(LABEL_LONG_CROP, -1), be_const_int(5) },
{ be_const_key(ALIGN_IN_TOP_RIGHT, -1), be_const_int(3) },
{ be_const_key(LAYOUT_ROW_MID, -1), be_const_int(6) },
{ be_const_key(STYLE_VALUE_BLEND_MODE, 373), be_const_int(114) },
{ be_const_key(CHART_TYPE_COLUMN, 91), be_const_int(2) },
{ be_const_key(KEY_NEXT, 128), be_const_int(9) },
{ be_const_key(FS_RES_NOT_EX, -1), be_const_int(3) },
{ be_const_key(OPA_70, -1), be_const_int(178) },
{ be_const_key(SYMBOL_SHUFFLE, -1), be_const_str(&be_local_const_str_SYMBOL_SHUFFLE) },
{ be_const_key(EVENT_APPLY, 66), be_const_int(19) },
{ be_const_key(layer_top, -1), be_const_func(lv0_layer_top) },
{ be_const_key(OBJ_PART_ALL, -1), be_const_int(255) },
{ be_const_key(STYLE_BG_GRAD_STOP, 8), be_const_int(34) },
{ be_const_key(STYLE_VALUE_STR, -1), be_const_int(127) },
{ be_const_key(LABEL_ALIGN_LEFT, -1), be_const_int(0) },
{ be_const_key(CHART_CURSOR_DOWN, -1), be_const_int(8) },
{ be_const_key(OBJ_PART_VIRTUAL_FIRST, 41), be_const_int(1) },
{ be_const_key(GRAD_DIR_HOR, 44), be_const_int(2) },
{ be_const_key(LAYOUT_PRETTY_MID, 183), be_const_int(9) },
{ be_const_key(STYLE_VALUE_BLEND_MODE, -1), be_const_int(114) },
{ be_const_key(CHART_PART_CURSOR, 243), be_const_int(3) },
{ be_const_key(BAR_TYPE_SYMMETRICAL, 308), be_const_int(1) },
{ be_const_key(EVENT_FOCUSED, 122), be_const_int(13) },
{ be_const_key(ROLLER_MODE_NORMAL, 177), be_const_int(0) },
{ be_const_key(WHITE, 281), be_const_int(16777215) },
{ be_const_key(KEY_PREV, -1), be_const_int(11) },
{ be_const_key(SYMBOL_BATTERY_1, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_1) },
{ be_const_key(STYLE_PAD_RIGHT, -1), be_const_int(19) },
{ be_const_key(LABEL_LONG_SROLL, -1), be_const_int(3) },
{ be_const_key(FS_RES_NOT_IMP, -1), be_const_int(9) },
{ be_const_key(STYLE_TRANSITION_DELAY, -1), be_const_int(177) },
{ be_const_key(STYLE_VALUE_ALIGN, 276), be_const_int(117) },
{ be_const_key(SYMBOL_FILE, -1), be_const_str(&be_local_const_str_SYMBOL_FILE) },
{ be_const_key(STYLE_BORDER_BLEND_MODE, -1), be_const_int(50) },
{ be_const_key(OPA_80, 59), be_const_int(204) },
{ be_const_key(LAYOUT_CENTER, -1), be_const_int(1) },
{ be_const_key(KEY_END, -1), be_const_int(3) },
{ be_const_key(KEY_NEXT, -1), be_const_int(9) },
{ be_const_key(STYLE_LINE_ROUNDED, 420), be_const_int(148) },
{ be_const_key(CHART_AXIS_PRIMARY_Y, 427), be_const_int(0) },
{ be_const_key(SYMBOL_BULLET, -1), be_const_str(&be_local_const_str_SYMBOL_BULLET) },
{ be_const_key(BORDER_SIDE_TOP, -1), be_const_int(2) },
{ be_const_key(SCROLLBAR_MODE_HIDE, -1), be_const_int(4) },
{ be_const_key(TXT_FLAG_RIGHT, 238), be_const_int(8) },
{ be_const_key(FIT_TIGHT, 20), be_const_int(1) },
{ be_const_key(KEY_BACKSPACE, -1), be_const_int(8) },
{ be_const_key(GAUGE_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(SPI, 178), be_const_int(0) },
{ be_const_key(STYLE_TEXT_BLEND_MODE, 430), be_const_int(32899) },
{ be_const_key(EVENT_DRAG_THROW_BEGIN, 121), be_const_int(10) },
{ be_const_key(KEYBOARD_MODE_SPECIAL, -1), be_const_int(2) },
{ be_const_key(SYMBOL_BACKSPACE, 187), be_const_str(&be_local_const_str_SYMBOL_BACKSPACE) },
{ be_const_key(TABVIEW_TAB_POS_RIGHT, 0), be_const_int(4) },
{ be_const_key(STYLE_PATTERN_BLEND_MODE, 233), be_const_int(96) },
{ be_const_key(BTN_STATE_CHECKED_RELEASED, -1), be_const_int(3) },
{ be_const_key(EVENT_LONG_PRESSED, -1), be_const_int(4) },
{ be_const_key(PROTECT_CLICK_FOCUS, -1), be_const_int(32) },
{ be_const_key(CHART_CURSOR_LEFT, 300), be_const_int(4) },
{ be_const_key(PROTECT_FOLLOW, 53), be_const_int(8) },
{ be_const_key(FS_RES_OUT_OF_MEM, -1), be_const_int(10) },
{ be_const_key(FS_RES_INV_PARAM, -1), be_const_int(11) },
{ be_const_key(STYLE_BORDER_COLOR, -1), be_const_int(57) },
{ be_const_key(FS_MODE_RD, -1), be_const_int(2) },
{ be_const_key(LAYOUT_OFF, 263), be_const_int(0) },
{ be_const_key(CHART_PART_SERIES, -1), be_const_int(2) },
{ be_const_key(STYLE_TRANSITION_PROP_1, 388), be_const_int(178) },
{ be_const_key(EVENT_DEFOCUSED, -1), be_const_int(14) },
{ be_const_key(GESTURE_DIR_BOTTOM, 284), be_const_int(1) },
{ be_const_key(ALIGN_OUT_LEFT_BOTTOM, -1), be_const_int(17) },
{ be_const_key(DISP_SIZE_LARGE, 348), be_const_int(2) },
{ be_const_key(STATE_DEFAULT, -1), be_const_int(0) },
{ be_const_key(EVENT_RELEASED, -1), be_const_int(7) },
{ be_const_key(STYLE_TRANSITION_PROP_2, -1), be_const_int(179) },
{ be_const_key(BLEND_MODE_NORMAL, -1), be_const_int(0) },
{ be_const_key(STYLE_LINE_OPA, 402), be_const_int(156) },
{ be_const_key(ARC_PART_KNOB, -1), be_const_int(2) },
{ be_const_key(ARC_TYPE_NORMAL, 70), be_const_int(0) },
{ be_const_key(EVENT_CLICKED, -1), be_const_int(6) },
{ be_const_key(LAYOUT_COLUMN_LEFT, 229), be_const_int(2) },
{ be_const_key(BLACK, 258), be_const_int(0) },
{ be_const_key(SYMBOL_IMAGE, 68), be_const_str(&be_local_const_str_SYMBOL_IMAGE) },
{ be_const_key(ALIGN_OUT_RIGHT_TOP, 180), be_const_int(18) },
{ be_const_key(STYLE_VALUE_COLOR, -1), be_const_int(121) },
{ be_const_key(SYMBOL_CLOSE, 378), be_const_str(&be_local_const_str_SYMBOL_CLOSE) },
{ be_const_key(DISP_ROT_270, -1), be_const_int(3) },
{ be_const_key(STYLE_TRANSITION_PROP_4, -1), be_const_int(181) },
{ be_const_key(STATE_HOVERED, -1), be_const_int(8) },
{ be_const_key(CPICKER_COLOR_MODE_VALUE, 410), be_const_int(2) },
{ be_const_key(TEXT_DECOR_NONE, -1), be_const_int(0) },
{ be_const_key(SYMBOL_MINUS, -1), be_const_str(&be_local_const_str_SYMBOL_MINUS) },
{ be_const_key(BLEND_MODE_SUBTRACTIVE, 246), be_const_int(2) },
{ be_const_key(LAYOUT_PRETTY_BOTTOM, -1), be_const_int(10) },
{ be_const_key(STYLE_IMAGE_RECOLOR_OPA, -1), be_const_int(32941) },
{ be_const_key(SYMBOL_DOWN, 114), be_const_str(&be_local_const_str_SYMBOL_DOWN) },
{ be_const_key(SYMBOL_LIST, -1), be_const_str(&be_local_const_str_SYMBOL_LIST) },
{ be_const_key(LAYOUT_PRETTY_TOP, -1), be_const_int(8) },
{ be_const_key(BORDER_SIDE_BOTTOM, 358), be_const_int(1) },
{ be_const_key(DROPDOWN_DIR_UP, -1), be_const_int(1) },
{ be_const_key(STYLE_TRANSITION_PROP_6, -1), be_const_int(183) },
{ be_const_key(KEY_ESC, -1), be_const_int(27) },
{ be_const_key(LABEL_LONG_SROLL_CIRC, -1), be_const_int(4) },
{ be_const_key(SYMBOL_DOWNLOAD, -1), be_const_str(&be_local_const_str_SYMBOL_DOWNLOAD) },
{ be_const_key(ALIGN_OUT_BOTTOM_LEFT, 218), be_const_int(12) },
{ be_const_key(LINEMETER_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(GRAY, -1), be_const_int(8421504) },
{ be_const_key(SYMBOL_USB, 404), be_const_str(&be_local_const_str_SYMBOL_USB) },
{ be_const_key(ALIGN_OUT_RIGHT_BOTTOM, -1), be_const_int(20) },
{ be_const_key(BTN_STATE_DISABLED, 216), be_const_int(2) },
{ be_const_key(LIME, -1), be_const_int(65280) },
{ be_const_key(CPICKER_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(DISP_ROT_90, 166), be_const_int(1) },
{ be_const_key(SYMBOL_VOLUME_MID, -1), be_const_str(&be_local_const_str_SYMBOL_VOLUME_MID) },
{ be_const_key(LABEL_LONG_EXPAND, -1), be_const_int(0) },
{ be_const_key(FS_RES_FULL, -1), be_const_int(4) },
{ be_const_key(BLEND_MODE_ADDITIVE, -1), be_const_int(1) },
{ be_const_key(KEY_UP, -1), be_const_int(17) },
{ be_const_key(ALIGN_IN_BOTTOM_MID, -1), be_const_int(5) },
{ be_const_key(BAR_TYPE_CUSTOM, -1), be_const_int(2) },
{ be_const_key(STYLE_BG_BLEND_MODE, -1), be_const_int(32) },
{ be_const_key(CPICKER_COLOR_MODE_HUE, -1), be_const_int(0) },
{ be_const_key(LAYOUT_COLUMN_MID, -1), be_const_int(3) },
{ be_const_key(ALIGN_IN_BOTTOM_RIGHT, 207), be_const_int(6) },
{ be_const_key(LED_PART_MAIN, 425), be_const_int(0) },
{ be_const_key(ARC_PART_BG, -1), be_const_int(0) },
{ be_const_key(HSPI, -1), be_const_int(0) },
{ be_const_key(EVENT_VALUE_CHANGED, 51), be_const_int(16) },
{ be_const_key(CHART_AXIS_INVERSE_LABELS_ORDER, 305), be_const_int(2) },
{ be_const_key(STYLE_OUTLINE_COLOR, 103), be_const_int(73) },
{ be_const_key(FS_MODE_WR, -1), be_const_int(1) },
{ be_const_key(CPICKER_PART_KNOB, 221), be_const_int(1) },
{ be_const_key(LAYOUT_ROW_BOTTOM, -1), be_const_int(7) },
{ be_const_key(CHART_TYPE_LINE, 353), be_const_int(1) },
{ be_const_key(LABEL_ALIGN_RIGHT, -1), be_const_int(2) },
{ be_const_key(ALIGN_IN_RIGHT_MID, -1), be_const_int(8) },
{ be_const_key(CHECKBOX_PART_BG, -1), be_const_int(0) },
{ be_const_key(CPICKER_TYPE_RECT, -1), be_const_int(0) },
{ be_const_key(PURPLE, 127), be_const_int(8388736) },
{ be_const_key(STYLE_PATTERN_REPEAT, 182), be_const_int(97) },
{ be_const_key(SYMBOL_EYE_OPEN, 371), be_const_str(&be_local_const_str_SYMBOL_EYE_OPEN) },
{ be_const_key(FIT_MAX, -1), be_const_int(3) },
{ be_const_key(DROPDOWN_DIR_DOWN, -1), be_const_int(0) },
{ be_const_key(ANIM_OFF, 226), be_const_int(0) },
{ be_const_key(SYMBOL_DIRECTORY, -1), be_const_str(&be_local_const_str_SYMBOL_DIRECTORY) },
{ be_const_key(STYLE_BG_OPA, -1), be_const_int(44) },
{ be_const_key(PAGE_EDGE_LEFT, 14), be_const_int(1) },
{ be_const_key(STYLE_SCALE_BORDER_WIDTH, -1), be_const_int(193) },
{ be_const_key(STYLE_SHADOW_OPA, -1), be_const_int(92) },
{ be_const_key(screenshot, 128), be_const_func(lv0_screenshot) },
{ be_const_key(CPICKER_TYPE_DISC, -1), be_const_int(1) },
{ be_const_key(SYMBOL_PREV, 155), be_const_str(&be_local_const_str_SYMBOL_PREV) },
{ be_const_key(DRAG_DIR_BOTH, 184), be_const_int(3) },
{ be_const_key(PROTECT_PARENT, -1), be_const_int(2) },
{ be_const_key(ALIGN_OUT_BOTTOM_MID, -1), be_const_int(13) },
{ be_const_key(FS_RES_TOUT, -1), be_const_int(8) },
{ be_const_key(STATE_EDITED, 264), be_const_int(4) },
{ be_const_key(SYMBOL_BATTERY_3, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_3) },
{ be_const_key(GREEN, 16), be_const_int(32768) },
{ be_const_key(STYLE_SHADOW_COLOR, -1), be_const_int(89) },
{ be_const_key(STYLE_SHADOW_OFS_Y, 310), be_const_int(82) },
{ be_const_key(GAUGE_PART_MAJOR, -1), be_const_int(1) },
{ be_const_key(SYMBOL_MUTE, -1), be_const_str(&be_local_const_str_SYMBOL_MUTE) },
{ be_const_key(SLIDER_TYPE_NORMAL, 325), be_const_int(0) },
{ be_const_key(STYLE_BG_GRAD_DIR, 176), be_const_int(35) },
{ be_const_key(AQUA, -1), be_const_int(65535) },
{ be_const_key(SYMBOL_WARNING, 150), be_const_str(&be_local_const_str_SYMBOL_WARNING) },
{ be_const_key(STYLE_OUTLINE_BLEND_MODE, -1), be_const_int(66) },
{ be_const_key(STYLE_TEXT_LINE_SPACE, -1), be_const_int(32897) },
{ be_const_key(STYLE_OUTLINE_PAD, 451), be_const_int(65) },
{ be_const_key(STYLE_VALUE_LINE_SPACE, -1), be_const_int(113) },
{ be_const_key(STYLE_RADIUS, 222), be_const_int(1) },
{ be_const_key(EVENT_PRESSING, -1), be_const_int(1) },
{ be_const_key(STYLE_MARGIN_BOTTOM, -1), be_const_int(22) },
{ be_const_key(STYLE_SHADOW_SPREAD, -1), be_const_int(83) },
{ be_const_key(KEY_DEL, -1), be_const_int(127) },
{ be_const_key(SCROLLBAR_MODE_AUTO, -1), be_const_int(3) },
{ be_const_key(STYLE_VALUE_OPA, 54), be_const_int(124) },
{ be_const_key(ALIGN_OUT_RIGHT_MID, 60), be_const_int(19) },
{ be_const_key(BAR_TYPE_NORMAL, 61), be_const_int(0) },
{ be_const_key(OBJ_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(STYLE_IMAGE_RECOLOR, -1), be_const_int(32937) },
{ be_const_key(KEYBOARD_MODE_TEXT_UPPER, -1), be_const_int(1) },
{ be_const_key(EVENT_CANCEL, 298), be_const_int(20) },
{ be_const_key(STYLE_MARGIN_LEFT, -1), be_const_int(23) },
{ be_const_key(STYLE_PAD_LEFT, -1), be_const_int(18) },
{ be_const_key(SYMBOL_REFRESH, 453), be_const_str(&be_local_const_str_SYMBOL_REFRESH) },
{ be_const_key(SYMBOL_KEYBOARD, -1), be_const_str(&be_local_const_str_SYMBOL_KEYBOARD) },
{ be_const_key(DISP_SIZE_SMALL, 86), be_const_int(0) },
{ be_const_key(DROPDOWN_PART_SCROLLBAR, 296), be_const_int(65) },
{ be_const_key(CHART_AXIS_DRAW_LAST_TICK, -1), be_const_int(1) },
{ be_const_key(SYMBOL_UPLOAD, 356), be_const_str(&be_local_const_str_SYMBOL_UPLOAD) },
{ be_const_key(LABEL_LONG_DOT, 446), be_const_int(2) },
{ be_const_key(OPA_20, 364), be_const_int(51) },
{ be_const_key(SYMBOL_NEXT, -1), be_const_str(&be_local_const_str_SYMBOL_NEXT) },
{ be_const_key(KEY_RIGHT, -1), be_const_int(19) },
{ be_const_key(LABEL_ALIGN_AUTO, -1), be_const_int(3) },
{ be_const_key(ALIGN_OUT_TOP_LEFT, 242), be_const_int(9) },
{ be_const_key(STYLE_PAD_INNER, 279), be_const_int(20) },
{ be_const_key(SPINNER_TYPE_FILLSPIN_ARC, -1), be_const_int(1) },
{ be_const_key(montserrat_font, 259), be_const_func(lv0_load_montserrat_font) },
{ be_const_key(TEMPL_STYLE_Y, 257), be_const_int(1) },
{ be_const_key(SSPI, -1), be_const_int(2) },
{ be_const_key(STYLE_LINE_BLEND_MODE, -1), be_const_int(145) },
{ be_const_key(GAUGE_PART_NEEDLE, -1), be_const_int(2) },
{ be_const_key(MAGENTA, -1), be_const_int(16711935) },
{ be_const_key(LABEL_LONG_BREAK, -1), be_const_int(1) },
{ be_const_key(CHART_CURSOR_UP, -1), be_const_int(2) },
{ be_const_key(OPA_90, -1), be_const_int(229) },
{ be_const_key(STATE_FOCUSED, -1), be_const_int(2) },
{ be_const_key(LIST_PART_EDGE_FLASH, -1), be_const_int(2) },
{ be_const_key(ALIGN_OUT_LEFT_MID, -1), be_const_int(16) },
{ be_const_key(PROTECT_PRESS_LOST, -1), be_const_int(16) },
{ be_const_key(PROTECT_CHILD_CHG, 389), be_const_int(1) },
{ be_const_key(CHART_UPDATE_MODE_SHIFT, -1), be_const_int(0) },
{ be_const_key(STYLE_LINE_DASH_WIDTH, -1), be_const_int(146) },
{ be_const_key(FS_RES_UNKNOWN, -1), be_const_int(12) },
{ be_const_key(STYLE_BORDER_OPA, 52), be_const_int(60) },
{ be_const_key(layer_sys, 185), be_const_func(lv0_layer_sys) },
{ be_const_key(STYLE_BG_MAIN_STOP, 328), be_const_int(33) },
{ be_const_key(STYLE_LINE_DASH_GAP, -1), be_const_int(147) },
{ be_const_key(CHART_CURSOR_RIGHT, -1), be_const_int(1) },
{ be_const_key(CALENDAR_PART_BG, 26), be_const_int(0) },
{ be_const_key(OPA_30, 382), be_const_int(76) },
{ be_const_key(CHART_PART_BG, 32), be_const_int(0) },
{ be_const_key(BTNMATRIX_CTRL_CHECK_STATE, 208), be_const_int(128) },
{ be_const_key(FIT_PARENT, -1), be_const_int(2) },
{ be_const_key(STYLE_SIZE, -1), be_const_int(3) },
{ be_const_key(CHART_TYPE_NONE, -1), be_const_int(0) },
{ be_const_key(SYMBOL_WIFI, -1), be_const_str(&be_local_const_str_SYMBOL_WIFI) },
{ be_const_key(ALIGN_IN_BOTTOM_LEFT, 181), be_const_int(4) },
{ be_const_key(get_hor_res, 416), be_const_func(lv0_get_hor_res) },
{ be_const_key(ALIGN_IN_LEFT_MID, 304), be_const_int(7) },
{ be_const_key(SYMBOL_SETTINGS, -1), be_const_str(&be_local_const_str_SYMBOL_SETTINGS) },
{ be_const_key(FS_RES_LOCKED, -1), be_const_int(5) },
{ be_const_key(KEYBOARD_MODE_TEXT_LOWER, -1), be_const_int(0) },
{ be_const_key(STYLE_TEXT_DECOR, -1), be_const_int(32898) },
{ be_const_key(STYLE_TEXT_FONT, -1), be_const_int(32910) },
{ be_const_key(OPA_50, -1), be_const_int(127) },
{ be_const_key(STYLE_OPA_SCALE, -1), be_const_int(32780) },
{ be_const_key(ALIGN_OUT_BOTTOM_RIGHT, -1), be_const_int(14) },
{ be_const_key(BTN_STATE_CHECKED_PRESSED, -1), be_const_int(4) },
{ be_const_key(BORDER_SIDE_RIGHT, -1), be_const_int(8) },
{ be_const_key(STYLE_TEXT_LETTER_SPACE, 159), be_const_int(32896) },
{ be_const_key(STYLE_OUTLINE_WIDTH, -1), be_const_int(64) },
{ be_const_key(SPINNER_DIR_FORWARD, -1), be_const_int(0) },
{ be_const_key(STYLE_PATTERN_OPA, 343), be_const_int(108) },
{ be_const_key(KEY_HOME, 113), be_const_int(2) },
{ be_const_key(MAROON, -1), be_const_int(8388608) },
{ be_const_key(STYLE_PATTERN_RECOLOR_OPA, 169), be_const_int(109) },
{ be_const_key(LAYOUT_GRID, 260), be_const_int(11) },
{ be_const_key(TXT_CMD_STATE_PAR, -1), be_const_int(1) },
{ be_const_key(STYLE_SCALE_END_COLOR, -1), be_const_int(202) },
{ be_const_key(DISP_SIZE_EXTRA_LARGE, 198), be_const_int(3) },
{ be_const_key(LABEL_ALIGN_CENTER, -1), be_const_int(1) },
{ be_const_key(STYLE_SCALE_END_LINE_WIDTH, -1), be_const_int(195) },
{ be_const_key(FIT_NONE, -1), be_const_int(0) },
{ be_const_key(TEXT_DECOR_STRIKETHROUGH, 312), be_const_int(2) },
{ be_const_key(FS_RES_NOT_EX, 168), be_const_int(3) },
{ be_const_key(SYMBOL_DUMMY, 299), be_const_str(&be_local_const_str_SYMBOL_DUMMY) },
{ be_const_key(EVENT_LONG_PRESSED_REPEAT, 228), be_const_int(5) },
{ be_const_key(KEYBOARD_MODE_NUM, 27), be_const_int(3) },
{ be_const_key(LAYOUT_COLUMN_RIGHT, -1), be_const_int(4) },
{ be_const_key(DRAG_DIR_VER, -1), be_const_int(2) },
{ be_const_key(DROPDOWN_PART_LIST, -1), be_const_int(64) },
{ be_const_key(CHART_PART_SERIES_BG, -1), be_const_int(1) },
{ be_const_key(PROTECT_NONE, 266), be_const_int(0) },
{ be_const_key(DROPDOWN_DIR_RIGHT, -1), be_const_int(3) },
{ be_const_key(ALIGN_IN_TOP_MID, -1), be_const_int(2) },
{ be_const_key(YELLOW, -1), be_const_int(16776960) },
{ be_const_key(SYMBOL_COPY, -1), be_const_str(&be_local_const_str_SYMBOL_COPY) },
{ be_const_key(SYMBOL_EDIT, 74), be_const_str(&be_local_const_str_SYMBOL_EDIT) },
{ be_const_key(STATE_CHECKED, -1), be_const_int(1) },
{ be_const_key(DRAG_DIR_HOR, -1), be_const_int(1) },
{ be_const_key(BTN_STATE_RELEASED, -1), be_const_int(0) },
{ be_const_key(EVENT_LEAVE, 322), be_const_int(15) },
{ be_const_key(ROLLER_MODE_INFINITE, -1), be_const_int(1) },
{ be_const_key(GESTURE_DIR_RIGHT, -1), be_const_int(3) },
{ be_const_key(BTNMATRIX_CTRL_NO_REPEAT, -1), be_const_int(16) },
{ be_const_key(KEYBOARD_PART_BTN, -1), be_const_int(1) },
{ be_const_key(FS_RES_DENIED, -1), be_const_int(6) },
{ be_const_key(DROPDOWN_DIR_LEFT, 117), be_const_int(2) },
{ be_const_key(STYLE_TEXT_COLOR, -1), be_const_int(32905) },
{ be_const_key(SYMBOL_GPS, -1), be_const_str(&be_local_const_str_SYMBOL_GPS) },
{ be_const_key(SYMBOL_EYE_CLOSE, 91), be_const_str(&be_local_const_str_SYMBOL_EYE_CLOSE) },
{ be_const_key(STYLE_TEXT_SEL_BG_COLOR, -1), be_const_int(32907) },
{ be_const_key(FS_RES_OK, -1), be_const_int(0) },
{ be_const_key(TXT_FLAG_FIT, 313), be_const_int(16) },
{ be_const_key(SYMBOL_BATTERY_EMPTY, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_EMPTY) },
{ be_const_key(SYMBOL_TRASH, -1), be_const_str(&be_local_const_str_SYMBOL_TRASH) },
{ be_const_key(TXT_FLAG_RECOLOR, -1), be_const_int(1) },
{ be_const_key(STYLE_BORDER_POST, 5), be_const_int(51) },
{ be_const_key(TABVIEW_TAB_POS_BOTTOM, -1), be_const_int(2) },
{ be_const_key(CHECKBOX_PART_BULLET, -1), be_const_int(64) },
{ be_const_key(OBJ_PART_REAL_FIRST, 335), be_const_int(64) },
{ be_const_key(KEY_DOWN, 450), be_const_int(18) },
{ be_const_key(DRAG_DIR_ONE, 82), be_const_int(4) },
{ be_const_key(STYLE_TRANSITION_PROP_3, -1), be_const_int(180) },
{ be_const_key(STYLE_OUTLINE_OPA, 275), be_const_int(76) },
{ be_const_key(STYLE_TRANSFORM_WIDTH, -1), be_const_int(4) },
{ be_const_key(BORDER_SIDE_LEFT, 143), be_const_int(4) },
{ be_const_key(KEY_LEFT, -1), be_const_int(20) },
{ be_const_key(SYMBOL_VOLUME_MAX, -1), be_const_str(&be_local_const_str_SYMBOL_VOLUME_MAX) },
{ be_const_key(STYLE_IMAGE_BLEND_MODE, -1), be_const_int(32928) },
{ be_const_key(CHART_AXIS_SECONDARY_Y, 17), be_const_int(1) },
{ be_const_key(CPICKER_COLOR_MODE_SATURATION, -1), be_const_int(1) },
{ be_const_key(BORDER_SIDE_FULL, -1), be_const_int(15) },
{ be_const_key(SPINNER_TYPE_SPINNING_ARC, -1), be_const_int(0) },
{ be_const_key(ARC_TYPE_SYMMETRIC, -1), be_const_int(1) },
{ be_const_key(BTN_STATE_PRESSED, 93), be_const_int(1) },
{ be_const_key(STYLE_TRANSITION_PROP_5, -1), be_const_int(182) },
{ be_const_key(SYMBOL_NEW_LINE, 33), be_const_str(&be_local_const_str_SYMBOL_NEW_LINE) },
{ be_const_key(CALENDAR_PART_DAY_NAMES, -1), be_const_int(2) },
{ be_const_key(STYLE_BG_GRAD_COLOR, -1), be_const_int(42) },
{ be_const_key(STYLE_VALUE_OFS_Y, 71), be_const_int(116) },
{ be_const_key(DROPDOWN_PART_SELECTED, 441), be_const_int(66) },
{ be_const_key(STYLE_PATTERN_IMAGE, 97), be_const_int(110) },
{ be_const_key(BLUE, -1), be_const_int(255) },
{ be_const_key(CALENDAR_PART_DATE, -1), be_const_int(3) },
{ be_const_key(SYMBOL_CHARGE, 154), be_const_str(&be_local_const_str_SYMBOL_CHARGE) },
{ be_const_key(PROTECT_POS, -1), be_const_int(4) },
{ be_const_key(SYMBOL_STOP, 436), be_const_str(&be_local_const_str_SYMBOL_STOP) },
{ be_const_key(LAYOUT_ROW_TOP, 101), be_const_int(5) },
{ be_const_key(CALENDAR_PART_HEADER, -1), be_const_int(1) },
{ be_const_key(CHART_CURSOR_NONE, -1), be_const_int(0) },
{ be_const_key(STYLE_VALUE_LETTER_SPACE, -1), be_const_int(112) },
{ be_const_key(SYMBOL_PLUS, -1), be_const_str(&be_local_const_str_SYMBOL_PLUS) },
{ be_const_key(STATE_PRESSED, -1), be_const_int(16) },
{ be_const_key(ALIGN_IN_TOP_MID, 255), be_const_int(2) },
{ be_const_key(STYLE_CLIP_CORNER, 311), be_const_int(2) },
{ be_const_key(SYMBOL_HOME, -1), be_const_str(&be_local_const_str_SYMBOL_HOME) },
{ be_const_key(OPA_60, -1), be_const_int(153) },
{ be_const_key(KEYBOARD_PART_BG, -1), be_const_int(0) },
{ be_const_key(CHART_AXIS_SKIP_LAST_TICK, -1), be_const_int(0) },
{ be_const_key(SYMBOL_RIGHT, -1), be_const_str(&be_local_const_str_SYMBOL_RIGHT) },
{ be_const_key(SYMBOL_LOOP, -1), be_const_str(&be_local_const_str_SYMBOL_LOOP) },
{ be_const_key(STYLE_MARGIN_TOP, -1), be_const_int(21) },
{ be_const_key(STYLE_SCALE_GRAD_COLOR, -1), be_const_int(201) },
{ be_const_key(EVENT_DRAG_END, 227), be_const_int(9) },
{ be_const_key(OPA_0, -1), be_const_int(0) },
{ be_const_key(EVENT_PRESSED, 123), be_const_int(0) },
{ be_const_key(GESTURE_DIR_LEFT, -1), be_const_int(2) },
{ be_const_key(ALIGN_CENTER, -1), be_const_int(0) },
{ be_const_key(ALIGN_OUT_TOP_MID, -1), be_const_int(10) },
{ be_const_key(STYLE_PATTERN_RECOLOR, 92), be_const_int(105) },
{ be_const_key(TXT_FLAG_EXPAND, -1), be_const_int(2) },
{ be_const_key(STYLE_BORDER_WIDTH, 306), be_const_int(48) },
{ be_const_key(SYMBOL_BELL, -1), be_const_str(&be_local_const_str_SYMBOL_BELL) },
{ be_const_key(EVENT_KEY, -1), be_const_int(12) },
{ be_const_key(SYMBOL_BLUETOOTH, 55), be_const_str(&be_local_const_str_SYMBOL_BLUETOOTH) },
{ be_const_key(BTNMATRIX_CTRL_HIDDEN, -1), be_const_int(8) },
{ be_const_key(OPA_10, -1), be_const_int(25) },
{ be_const_key(EVENT_GESTURE, -1), be_const_int(11) },
{ be_const_key(SYMBOL_CALL, -1), be_const_str(&be_local_const_str_SYMBOL_CALL) },
{ be_const_key(BTN_STATE_CHECKED_DISABLED, -1), be_const_int(5) },
{ be_const_key(STYLE_BORDER_SIDE, -1), be_const_int(49) },
{ be_const_key(STATE_DISABLED, 289), be_const_int(32) },
{ be_const_key(PAGE_EDGE_TOP, -1), be_const_int(2) },
{ be_const_key(BTNMATRIX_CTRL_CLICK_TRIG, 37), be_const_int(256) },
{ be_const_key(NAVY, -1), be_const_int(128) },
{ be_const_key(SYMBOL_SAVE, 414), be_const_str(&be_local_const_str_SYMBOL_SAVE) },
{ be_const_key(STYLE_TRANSITION_PATH, 407), be_const_int(190) },
{ be_const_key(TABVIEW_TAB_POS_LEFT, 35), be_const_int(3) },
{ be_const_key(CYAN, -1), be_const_int(65535) },
{ be_const_key(EVENT_DRAG_BEGIN, 94), be_const_int(8) },
{ be_const_key(EVENT_PRESS_LOST, -1), be_const_int(2) },
{ be_const_key(SYMBOL_DRIVE, -1), be_const_str(&be_local_const_str_SYMBOL_DRIVE) },
{ be_const_key(SYMBOL_EJECT, -1), be_const_str(&be_local_const_str_SYMBOL_EJECT) },
{ be_const_key(SYMBOL_UP, -1), be_const_str(&be_local_const_str_SYMBOL_UP) },
{ be_const_key(OPA_COVER, -1), be_const_int(255) },
{ be_const_key(ALIGN_IN_TOP_LEFT, -1), be_const_int(1) },
{ be_const_key(SYMBOL_AUDIO, -1), be_const_str(&be_local_const_str_SYMBOL_AUDIO) },
{ be_const_key(PROTECT_EVENT_TO_DISABLED, 438), be_const_int(64) },
{ be_const_key(STYLE_TEXT_OPA, -1), be_const_int(32908) },
{ be_const_key(TXT_CMD_STATE_WAIT, -1), be_const_int(0) },
{ be_const_key(TEXTAREA_CURSOR_LAST, -1), be_const_int(32767) },
{ be_const_key(SPINNER_DIR_BACKWARD, -1), be_const_int(1) },
{ be_const_key(BORDER_SIDE_NONE, -1), be_const_int(0) },
{ be_const_key(TEAL, -1), be_const_int(32896) },
{ be_const_key(FS_RES_HW_ERR, -1), be_const_int(1) },
{ be_const_key(STYLE_LINE_WIDTH, -1), be_const_int(144) },
{ be_const_key(EVENT_SHORT_CLICKED, -1), be_const_int(3) },
{ be_const_key(LIST_PART_SCROLLBAR, 72), be_const_int(1) },
{ be_const_key(STYLE_TEXT_SEL_COLOR, -1), be_const_int(32906) },
{ be_const_key(SYMBOL_LEFT, -1), be_const_str(&be_local_const_str_SYMBOL_LEFT) },
{ be_const_key(GRAD_DIR_VER, -1), be_const_int(1) },
{ be_const_key(EVENT_REFRESH, -1), be_const_int(18) },
{ be_const_key(KEY_ENTER, -1), be_const_int(10) },
{ be_const_key(TABVIEW_TAB_POS_TOP, 390), be_const_int(1) },
{ be_const_key(STYLE_SHADOW_BLEND_MODE, -1), be_const_int(84) },
{ be_const_key(SILVER, -1), be_const_int(12632256) },
{ be_const_key(SYMBOL_OK, -1), be_const_str(&be_local_const_str_SYMBOL_OK) },
{ be_const_key(TABVIEW_TAB_POS_NONE, -1), be_const_int(0) },
{ be_const_key(SYMBOL_PASTE, -1), be_const_str(&be_local_const_str_SYMBOL_PASTE) },
{ be_const_key(get_ver_res, 270), be_const_func(lv0_get_ver_res) },
{ be_const_key(STYLE_TRANSITION_TIME, -1), be_const_int(176) },
{ be_const_key(STYLE_PAD_TOP, -1), be_const_int(16) },
{ be_const_key(STYLE_TRANSFORM_ZOOM, -1), be_const_int(7) },
{ be_const_key(PAGE_EDGE_BOTTOM, -1), be_const_int(8) },
{ be_const_key(STYLE_LINE_COLOR, -1), be_const_int(153) },
{ be_const_key(STYLE_SHADOW_OFS_X, -1), be_const_int(81) },
{ be_const_key(SLIDER_TYPE_SYMMETRICAL, -1), be_const_int(1) },
{ be_const_key(OLIVE, -1), be_const_int(8421376) },
{ be_const_key(LIST_PART_BG, 223), be_const_int(0) },
{ be_const_key(SYMBOL_CUT, -1), be_const_str(&be_local_const_str_SYMBOL_CUT) },
{ be_const_key(STYLE_BG_COLOR, 244), be_const_int(41) },
{ be_const_key(SCROLLBAR_MODE_ON, 273), be_const_int(1) },
{ be_const_key(SYMBOL_VIDEO, -1), be_const_str(&be_local_const_str_SYMBOL_VIDEO) },
{ be_const_key(CHART_UPDATE_MODE_CIRCULAR, -1), be_const_int(1) },
{ be_const_key(STYLE_MARGIN_RIGHT, 287), be_const_int(24) },
{ be_const_key(DROPDOWN_PART_MAIN, 455), be_const_int(0) },
{ be_const_key(DISP_ROT_180, -1), be_const_int(2) },
{ be_const_key(SPINNER_TYPE_CONSTANT_ARC, -1), be_const_int(2) },
{ be_const_key(TEXT_DECOR_UNDERLINE, 444), be_const_int(1) },
{ be_const_key(TXT_FLAG_CENTER, 164), be_const_int(4) },
{ be_const_key(SYMBOL_POWER, -1), be_const_str(&be_local_const_str_SYMBOL_POWER) },
{ be_const_key(STYLE_TRANSFORM_ANGLE, -1), be_const_int(6) },
{ be_const_key(ARC_TYPE_REVERSE, -1), be_const_int(2) },
{ be_const_key(TXT_FLAG_NONE, -1), be_const_int(0) },
{ be_const_key(STYLE_IMAGE_OPA, -1), be_const_int(32940) },
{ be_const_key(EVENT_DELETE, -1), be_const_int(21) },
{ be_const_key(SCROLLBAR_MODE_UNHIDE, 36), be_const_int(8) },
{ be_const_key(OBJMASK_PART_MAIN, -1), be_const_int(0) },
{ be_const_key(GESTURE_DIR_TOP, -1), be_const_int(0) },
{ be_const_key(TEMPL_STYLE_X, -1), be_const_int(0) },
{ be_const_key(BTNMATRIX_CTRL_DISABLED, -1), be_const_int(32) },
{ be_const_key(I2C, -1), be_const_int(1) },
{ be_const_key(CHART_TYPE_COLUMN, -1), be_const_int(2) },
{ be_const_key(start, -1), be_const_func(lv0_start) },
{ be_const_key(SCROLLBAR_MODE_DRAG, -1), be_const_int(2) },
{ be_const_key(FS_RES_BUSY, -1), be_const_int(7) },
{ be_const_key(BTNMATRIX_CTRL_CHECKABLE, 65), be_const_int(64) },
{ be_const_key(OPA_TRANSP, -1), be_const_int(0) },
{ be_const_key(PAGE_EDGE_RIGHT, -1), be_const_int(4) },
};
static be_define_const_map(
m_liblvgl_map,
456
457
);
static be_define_const_module(

View File

@ -0,0 +1,354 @@
#include "Adafruit_LvGL_Glue.h"
#include <lvgl.h>
// ARCHITECTURE-SPECIFIC TIMER STUFF ---------------------------------------
// Tick interval for LittlevGL internal timekeeping; 1 to 10 ms recommended
static const int lv_tick_interval_ms = 10;
static void lv_tick_handler(void) { lv_tick_inc(lv_tick_interval_ms); }
// TOUCHSCREEN STUFF -------------------------------------------------------
// STMPE610 calibration for raw touch data
#define TS_MINX 100
#define TS_MAXX 3800
#define TS_MINY 100
#define TS_MAXY 3750
// Same, for ADC touchscreen
#define ADC_XMIN 325
#define ADC_XMAX 750
#define ADC_YMIN 240
#define ADC_YMAX 840
static bool touchscreen_read(struct _lv_indev_drv_t *indev_drv, lv_indev_data_t *data) {
// static lv_coord_t last_x = 0, last_y = 0;
// static uint8_t release_count = 0;
// // Get pointer to glue object from indev user data
// Adafruit_LvGL_Glue *glue = (Adafruit_LvGL_Glue *)indev_drv->user_data;
// uDisplay_lvgl *disp = glue->display;
// if (glue->is_adc_touch) {
// TouchScreen *touch = (TouchScreen *)glue->touchscreen;
// TSPoint p = touch->getPoint();
// // Serial.printf("%d %d %d\r\n", p.x, p.y, p.z);
// // Having an issue with spurious z=0 results from TouchScreen lib.
// // Since touch is polled periodically, workaround is to watch for
// // several successive z=0 results, and only then regard it as
// // a release event (otherwise still touched).
// if (p.z < touch->pressureThreshhold) { // A zero-ish value
// release_count += (release_count < 255);
// if (release_count >= 4) {
// data->state = LV_INDEV_STATE_REL; // Is REALLY RELEASED
// } else {
// data->state = LV_INDEV_STATE_PR; // Is STILL PRESSED
// }
// } else {
// release_count = 0; // Reset release counter
// data->state = LV_INDEV_STATE_PR; // Is PRESSED
// switch (glue->display->getRotation()) {
// case 0:
// last_x = map(p.x, ADC_XMIN, ADC_XMAX, 0, disp->width() - 1);
// last_y = map(p.y, ADC_YMAX, ADC_YMIN, 0, disp->height() - 1);
// break;
// case 1:
// last_x = map(p.y, ADC_YMAX, ADC_YMIN, 0, disp->width() - 1);
// last_y = map(p.x, ADC_XMAX, ADC_XMIN, 0, disp->height() - 1);
// break;
// case 2:
// last_x = map(p.x, ADC_XMAX, ADC_XMIN, 0, disp->width() - 1);
// last_y = map(p.y, ADC_YMIN, ADC_YMAX, 0, disp->height() - 1);
// break;
// case 3:
// last_x = map(p.y, ADC_YMIN, ADC_YMAX, 0, disp->width() - 1);
// last_y = map(p.x, ADC_XMIN, ADC_XMAX, 0, disp->height() - 1);
// break;
// }
// }
// data->point.x = last_x; // Last-pressed coordinates
// data->point.y = last_y;
// return false; // No buffering of ADC touch data
// } else {
// uint8_t fifo; // Number of points in touchscreen FIFO
// bool moar = false;
// Adafruit_STMPE610 *touch = (Adafruit_STMPE610 *)glue->touchscreen;
// // Before accessing SPI touchscreen, wait on any in-progress
// // DMA screen transfer to finish (shared bus).
// //disp->dmaWait();
// // disp->endWrite();
// if ((fifo = touch->bufferSize())) { // 1 or more points await
// data->state = LV_INDEV_STATE_PR; // Is PRESSED
// TS_Point p = touch->getPoint();
// // Serial.printf("%d %d %d\r\n", p.x, p.y, p.z);
// // On big TFT FeatherWing, raw X axis is flipped??
// if ((glue->display->width() == 480) || (glue->display->height() == 480)) {
// p.x = (TS_MINX + TS_MAXX) - p.x;
// }
// switch (glue->display->getRotation()) {
// case 0:
// last_x = map(p.x, TS_MAXX, TS_MINX, 0, disp->width() - 1);
// last_y = map(p.y, TS_MINY, TS_MAXY, 0, disp->height() - 1);
// break;
// case 1:
// last_x = map(p.y, TS_MINY, TS_MAXY, 0, disp->width() - 1);
// last_y = map(p.x, TS_MINX, TS_MAXX, 0, disp->height() - 1);
// break;
// case 2:
// last_x = map(p.x, TS_MINX, TS_MAXX, 0, disp->width() - 1);
// last_y = map(p.y, TS_MAXY, TS_MINY, 0, disp->height() - 1);
// break;
// case 3:
// last_x = map(p.y, TS_MAXY, TS_MINY, 0, disp->width() - 1);
// last_y = map(p.x, TS_MAXX, TS_MINX, 0, disp->height() - 1);
// break;
// }
// moar = (fifo > 1); // true if more in FIFO, false if last point
// #if defined(NRF52_SERIES)
// // Not sure what's up here, but nRF doesn't seem to always poll
// // the FIFO size correctly, causing false release events. If it
// // looks like we've read the last point from the FIFO, pause
// // briefly to allow any more FIFO events to pile up. This
// // doesn't seem to be necessary on SAMD or ESP32. ???
// if (!moar) {
// delay(50);
// }
// #endif
// } else { // FIFO empty
// data->state = LV_INDEV_STATE_REL; // Is RELEASED
// }
// data->point.x = last_x; // Last-pressed coordinates
// data->point.y = last_y;
// return moar;
// }
return false; /*No buffering now so no more data read*/
}
// OTHER LITTLEVGL VITALS --------------------------------------------------
#if LV_COLOR_DEPTH != 16
#pragma error("LV_COLOR_DEPTH must be 16")
#endif
// This isn't necessarily true, don't mention it for now. See notes later.
//#if LV_COLOR_16_SWAP != 0
// #pragma message("Set LV_COLOR_16_SWAP to 0 for best display performance")
//#endif
// Actual RAM usage will be 2X these figures, since using 2 DMA buffers...
#define LV_BUFFER_ROWS 60 // Most others have a bit more space
// This is the flush function required for LittlevGL screen updates.
// It receives a bounding rect and an array of pixel data (conveniently
// already in 565 format, so the Earth was lucky there).
static void lv_flush_callback(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) {
// Get pointer to glue object from indev user data
Adafruit_LvGL_Glue *glue = (Adafruit_LvGL_Glue *)disp->user_data;
uint16_t width = (area->x2 - area->x1 + 1);
uint16_t height = (area->y2 - area->y1 + 1);
if (glue->getScreenshotFile() != nullptr) {
// save pixels to file
int32_t btw = (width * height * LV_COLOR_DEPTH + 7) / 8;
while (btw > 0) {
int32_t ret = glue->getScreenshotFile()->write((const uint8_t*) color_p, btw);
//Serial.printf(">>> btw %d, written %d\n", btw, ret);
if (ret >= 0) {
btw -= ret;
} else {
btw = 0; // abort
}
}
lv_disp_flush_ready(disp);
return; // ok
}
uDisplay_lvgl *display = glue->display;
if (!glue->first_frame) {
//display->dmaWait(); // Wait for prior DMA transfer to complete
//display->endWrite(); // End transaction from any prior call
} else {
glue->first_frame = false;
}
// display->startWrite();
// display->setAddrWindow(area->x1, area->y1, width, height);
display->writePixels(area->x1, area->y1, width, height,
(uint16_t *)color_p, width * height);
// display->pushColors((uint16_t *)color_p, width * height, false);
lv_disp_flush_ready(disp);
}
#if (LV_USE_LOG)
// Optional LittlevGL debug print function, writes to Serial if debug is
// enabled when calling glue begin() function.
static void lv_debug(lv_log_level_t level, const char *file, uint32_t line, const char *fname,
const char *dsc) {
Serial.print(file);
Serial.write('@');
Serial.print(line);
Serial.print(":");
Serial.print(fname);
Serial.write("->");
Serial.println(dsc);
}
#endif
// GLUE LIB FUNCTIONS ------------------------------------------------------
// Constructor
/**
* @brief Construct a new Adafruit_LvGL_Glue::Adafruit_LvGL_Glue object,
* initializing minimal variables
*
*/
Adafruit_LvGL_Glue::Adafruit_LvGL_Glue(void)
: first_frame(true), lv_pixel_buf(NULL) {
#if defined(ARDUINO_ARCH_SAMD)
zerotimer = NULL;
#endif
}
// Destructor
/**
* @brief Destroy the Adafruit_LvGL_Glue::Adafruit_LvGL_Glue object, freeing any
* memory previously allocated within this library.
*
*/
Adafruit_LvGL_Glue::~Adafruit_LvGL_Glue(void) {
delete[] lv_pixel_buf;
#if defined(ARDUINO_ARCH_SAMD)
delete zerotimer;
#endif
// Probably other stuff that could be deallocated here
}
// begin() function is overloaded for STMPE610 touch, ADC touch, or none.
// Pass in POINTERS to ALREADY INITIALIZED display & touch objects (user code
// should have previously called corresponding begin() functions and checked
// return states before invoking this),
// they are NOT initialized here. Debug arg is
// touch arg can be NULL (or left off) if using LittlevGL as a passive widget
// display.
/**
* @brief Configure the glue layer and the underlying LvGL code to use the given
* TFT display driver instance and touchscreen controller
*
* @param tft Pointer to an **already initialized** display object instance
* @param touch Pointer to an **already initialized** `Adafruit_STMPE610`
* touchscreen controller object instance
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
* configured in LittleLVGL's lv_conf.h
* @return LvGLStatus The status of the initialization:
* * LVGL_OK : Success
* * LVGL_ERR_TIMER : Failure to set up timers
* * LVGL_ERR_ALLOC : Failure to allocate memory
*/
// LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft,
// Adafruit_STMPE610 *touch, bool debug) {
// is_adc_touch = false;
// return begin(tft, (void *)touch, debug);
// }
/**
* @brief Configure the glue layer and the underlying LvGL code to use the given
* TFT display driver and touchscreen controller instances
*
* @param tft Pointer to an **already initialized** display object instance
* @param touch Pointer to an **already initialized** `TouchScreen` touchscreen
* controller object instance
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
* configured in LittleLVGL's lv_conf.h
* @return LvGLStatus The status of the initialization:
* * LVGL_OK : Success
* * LVGL_ERR_TIMER : Failure to set up timers
* * LVGL_ERR_ALLOC : Failure to allocate memory
*/
// LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, TouchScreen *touch,
// bool debug) {
// is_adc_touch = true;
// return begin(tft, (void *)touch, debug);
// }
/**
* @brief Configure the glue layer and the underlying LvGL code to use the given
* TFT display driver and touchscreen controller instances
*
* @param tft Pointer to an **already initialized** display object instance
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
* configured in LittleLVGL's lv_conf.h
* @return LvGLStatus The status of the initialization:
* * LVGL_OK : Success
* * LVGL_ERR_TIMER : Failure to set up timers
* * LVGL_ERR_ALLOC : Failure to allocate memory
*/
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, bool debug) {
return begin(tft, (void *)NULL, debug);
}
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, void *touch, bool debug) {
lv_init();
// #if (LV_USE_LOG)
// if (debug) {
// lv_log_register_print_cb(lv_debug); // Register debug print function
// }
// #endif
// Allocate LvGL display buffer (x2 because DMA double buffering)
LvGLStatus status = LVGL_ERR_ALLOC;
// if ((lv_pixel_buf = new lv_color_t[LV_HOR_RES_MAX * LV_BUFFER_ROWS * 2])) {
if ((lv_pixel_buf = new lv_color_t[LV_HOR_RES_MAX * LV_BUFFER_ROWS])) {
display = tft;
touchscreen = (void *)touch;
// // Initialize LvGL display buffers
// lv_disp_buf_init(
// &lv_disp_buf, lv_pixel_buf, // 1st half buf
// &lv_pixel_buf[LV_HOR_RES_MAX * LV_BUFFER_ROWS], // 2nd half buf
// LV_HOR_RES_MAX * LV_BUFFER_ROWS);
// Initialize LvGL display buffers
lv_disp_buf_init(
&lv_disp_buf, lv_pixel_buf, // 1st half buf
nullptr, // 2nd half buf
LV_HOR_RES_MAX * LV_BUFFER_ROWS);
// Initialize LvGL display driver
lv_disp_drv_init(&lv_disp_drv);
lv_disp_drv.hor_res = tft->width();
lv_disp_drv.ver_res = tft->height();
lv_disp_drv.flush_cb = lv_flush_callback;
lv_disp_drv.buffer = &lv_disp_buf;
lv_disp_drv.user_data = (lv_disp_drv_user_data_t)this;
lv_disp_drv_register(&lv_disp_drv);
// Initialize LvGL input device (touchscreen already started)
if ((touch)) { // Can also pass NULL if passive widget display
lv_indev_drv_init(&lv_indev_drv); // Basic init
lv_indev_drv.type = LV_INDEV_TYPE_POINTER; // Is pointer dev
lv_indev_drv.read_cb = touchscreen_read; // Read callback
lv_indev_drv.user_data = (lv_indev_drv_user_data_t)this;
lv_input_dev_ptr = lv_indev_drv_register(&lv_indev_drv);
}
// TIMER SETUP is architecture-specific ----------------------------
// ESP 32------------------------------------------------
tick.attach_ms(lv_tick_interval_ms, lv_tick_handler);
status = LVGL_OK;
// -----------------------------------------
}
if (status != LVGL_OK) {
delete[] lv_pixel_buf;
lv_pixel_buf = NULL;
}
return status;
}

View File

@ -1,16 +1,10 @@
#ifndef _ADAFRUIT_LVGL_GLUE_H_
#define _ADAFRUIT_LVGL_GLUE_H_
#include <Adafruit_SPITFT.h> // GFX lib for SPI and parallel displays
#include <Adafruit_STMPE610.h> // SPI Touchscreen lib
#include <TouchScreen.h> // ADC touchscreen lib
#include <lvgl.h> // LittlevGL core lib
#include <uDisplay_lvgl.h>
#if defined(ARDUINO_ARCH_SAMD)
#include <Adafruit_ZeroTimer.h> // SAMD-specific timer lib
#elif defined(ESP32)
#include <Ticker.h> // ESP32-specific timer lib
#endif
#include <FS.h>
typedef enum {
LVGL_OK,
@ -23,15 +17,16 @@ typedef enum {
* most of Adafruit's TFT displays
*
*/
class Adafruit_LvGL_Glue {
public:
Adafruit_LvGL_Glue(void);
~Adafruit_LvGL_Glue(void);
// Different begin() funcs for STMPE610, ADC or no touch
LvGLStatus begin(uDisplay_lvgl *tft, Adafruit_STMPE610 *touch,
bool debug = false);
LvGLStatus begin(uDisplay_lvgl *tft, TouchScreen *touch,
bool debug = false);
// LvGLStatus begin(uDisplay_lvgl *tft, Adafruit_STMPE610 *touch,
// bool debug = false);
// LvGLStatus begin(uDisplay_lvgl *tft, TouchScreen *touch,
// bool debug = false);
LvGLStatus begin(uDisplay_lvgl *tft, bool debug = false);
// These items need to be public for some internal callbacks,
// but should be avoided by user code please!
@ -40,6 +35,9 @@ public:
bool is_adc_touch; ///< determines if the touchscreen controlelr is ADC based
bool first_frame; ///< Tracks if a call to `lv_flush_callback` needs to wait
///< for DMA transfer to complete
void setScreenshotFile(File *f) { screenshot = f; }
File * getScreenshotFile(void) const { return screenshot; }
void stopScreenshot(void) { screenshot = nullptr; }
private:
LvGLStatus begin(uDisplay_lvgl *tft, void *touch, bool debug);
@ -48,12 +46,8 @@ private:
lv_color_t *lv_pixel_buf;
lv_indev_drv_t lv_indev_drv;
lv_indev_t *lv_input_dev_ptr;
#if defined(ARDUINO_ARCH_SAMD)
Adafruit_ZeroTimer *zerotimer;
#elif defined(ESP32)
Ticker tick;
#elif defined(NRF52_SERIES)
#endif
File * screenshot = nullptr;
};
#endif // _ADAFRUIT_LVGL_GLUE_H_

View File

@ -1,447 +0,0 @@
#include "Adafruit_LvGL_Glue.h"
#include <lvgl.h>
// ARCHITECTURE-SPECIFIC TIMER STUFF ---------------------------------------
// Tick interval for LittlevGL internal timekeeping; 1 to 10 ms recommended
static const int lv_tick_interval_ms = 10;
#if defined(ARDUINO_ARCH_SAMD) // --------------------------------------
// Because of the way timer/counters are paired, and because parallel TFT
// uses timer 2 for write strobe, this needs to use timer 4 or above...
#define TIMER_NUM 4
#define TIMER_ISR TC4_Handler
// Interrupt service routine for zerotimer object
void TIMER_ISR(void) { Adafruit_ZeroTimer::timerHandler(TIMER_NUM); }
// Timer compare match 0 callback -- invokes LittlevGL timekeeper.
static void timerCallback0(void) { lv_tick_inc(lv_tick_interval_ms); }
#elif defined(ESP32) // ------------------------------------------------
static void lv_tick_handler(void) { lv_tick_inc(lv_tick_interval_ms); }
#elif defined(NRF52_SERIES) // -----------------------------------------
#define TIMER_ID NRF_TIMER4
#define TIMER_IRQN TIMER4_IRQn
#define TIMER_ISR TIMER4_IRQHandler
#define TIMER_FREQ 16000000
extern "C" {
// Timer interrupt service routine
void TIMER_ISR(void) {
if (TIMER_ID->EVENTS_COMPARE[0]) {
TIMER_ID->EVENTS_COMPARE[0] = 0;
}
lv_tick_inc(lv_tick_interval_ms);
}
}
#endif
// TOUCHSCREEN STUFF -------------------------------------------------------
// STMPE610 calibration for raw touch data
#define TS_MINX 100
#define TS_MAXX 3800
#define TS_MINY 100
#define TS_MAXY 3750
// Same, for ADC touchscreen
#define ADC_XMIN 325
#define ADC_XMAX 750
#define ADC_YMIN 240
#define ADC_YMAX 840
static bool touchscreen_read(struct _lv_indev_drv_t *indev_drv,
lv_indev_data_t *data) {
static lv_coord_t last_x = 0, last_y = 0;
static uint8_t release_count = 0;
// Get pointer to glue object from indev user data
Adafruit_LvGL_Glue *glue = (Adafruit_LvGL_Glue *)indev_drv->user_data;
uDisplay_lvgl *disp = glue->display;
if (glue->is_adc_touch) {
TouchScreen *touch = (TouchScreen *)glue->touchscreen;
TSPoint p = touch->getPoint();
// Serial.printf("%d %d %d\r\n", p.x, p.y, p.z);
// Having an issue with spurious z=0 results from TouchScreen lib.
// Since touch is polled periodically, workaround is to watch for
// several successive z=0 results, and only then regard it as
// a release event (otherwise still touched).
if (p.z < touch->pressureThreshhold) { // A zero-ish value
release_count += (release_count < 255);
if (release_count >= 4) {
data->state = LV_INDEV_STATE_REL; // Is REALLY RELEASED
} else {
data->state = LV_INDEV_STATE_PR; // Is STILL PRESSED
}
} else {
release_count = 0; // Reset release counter
data->state = LV_INDEV_STATE_PR; // Is PRESSED
switch (glue->display->getRotation()) {
case 0:
last_x = map(p.x, ADC_XMIN, ADC_XMAX, 0, disp->width() - 1);
last_y = map(p.y, ADC_YMAX, ADC_YMIN, 0, disp->height() - 1);
break;
case 1:
last_x = map(p.y, ADC_YMAX, ADC_YMIN, 0, disp->width() - 1);
last_y = map(p.x, ADC_XMAX, ADC_XMIN, 0, disp->height() - 1);
break;
case 2:
last_x = map(p.x, ADC_XMAX, ADC_XMIN, 0, disp->width() - 1);
last_y = map(p.y, ADC_YMIN, ADC_YMAX, 0, disp->height() - 1);
break;
case 3:
last_x = map(p.y, ADC_YMIN, ADC_YMAX, 0, disp->width() - 1);
last_y = map(p.x, ADC_XMIN, ADC_XMAX, 0, disp->height() - 1);
break;
}
}
data->point.x = last_x; // Last-pressed coordinates
data->point.y = last_y;
return false; // No buffering of ADC touch data
} else {
uint8_t fifo; // Number of points in touchscreen FIFO
bool moar = false;
Adafruit_STMPE610 *touch = (Adafruit_STMPE610 *)glue->touchscreen;
// Before accessing SPI touchscreen, wait on any in-progress
// DMA screen transfer to finish (shared bus).
//disp->dmaWait();
disp->endWrite();
if ((fifo = touch->bufferSize())) { // 1 or more points await
data->state = LV_INDEV_STATE_PR; // Is PRESSED
TS_Point p = touch->getPoint();
// Serial.printf("%d %d %d\r\n", p.x, p.y, p.z);
// On big TFT FeatherWing, raw X axis is flipped??
if ((glue->display->width() == 480) || (glue->display->height() == 480)) {
p.x = (TS_MINX + TS_MAXX) - p.x;
}
switch (glue->display->getRotation()) {
case 0:
last_x = map(p.x, TS_MAXX, TS_MINX, 0, disp->width() - 1);
last_y = map(p.y, TS_MINY, TS_MAXY, 0, disp->height() - 1);
break;
case 1:
last_x = map(p.y, TS_MINY, TS_MAXY, 0, disp->width() - 1);
last_y = map(p.x, TS_MINX, TS_MAXX, 0, disp->height() - 1);
break;
case 2:
last_x = map(p.x, TS_MINX, TS_MAXX, 0, disp->width() - 1);
last_y = map(p.y, TS_MAXY, TS_MINY, 0, disp->height() - 1);
break;
case 3:
last_x = map(p.y, TS_MAXY, TS_MINY, 0, disp->width() - 1);
last_y = map(p.x, TS_MAXX, TS_MINX, 0, disp->height() - 1);
break;
}
moar = (fifo > 1); // true if more in FIFO, false if last point
#if defined(NRF52_SERIES)
// Not sure what's up here, but nRF doesn't seem to always poll
// the FIFO size correctly, causing false release events. If it
// looks like we've read the last point from the FIFO, pause
// briefly to allow any more FIFO events to pile up. This
// doesn't seem to be necessary on SAMD or ESP32. ???
if (!moar) {
delay(50);
}
#endif
} else { // FIFO empty
data->state = LV_INDEV_STATE_REL; // Is RELEASED
}
data->point.x = last_x; // Last-pressed coordinates
data->point.y = last_y;
return moar;
}
}
// OTHER LITTLEVGL VITALS --------------------------------------------------
#if LV_COLOR_DEPTH != 16
#pragma error("LV_COLOR_DEPTH must be 16")
#endif
// This isn't necessarily true, don't mention it for now. See notes later.
//#if LV_COLOR_16_SWAP != 0
// #pragma message("Set LV_COLOR_16_SWAP to 0 for best display performance")
//#endif
// Actual RAM usage will be 2X these figures, since using 2 DMA buffers...
#define LV_BUFFER_ROWS 60 // Most others have a bit more space
// This is the flush function required for LittlevGL screen updates.
// It receives a bounding rect and an array of pixel data (conveniently
// already in 565 format, so the Earth was lucky there).
static void lv_flush_callback(lv_disp_drv_t *disp, const lv_area_t *area,
lv_color_t *color_p) {
// Get pointer to glue object from indev user data
Adafruit_LvGL_Glue *glue = (Adafruit_LvGL_Glue *)disp->user_data;
uDisplay_lvgl *display = glue->display;
if (!glue->first_frame) {
//display->dmaWait(); // Wait for prior DMA transfer to complete
display->endWrite(); // End transaction from any prior call
} else {
glue->first_frame = false;
}
uint16_t width = (area->x2 - area->x1 + 1);
uint16_t height = (area->y2 - area->y1 + 1);
// display->startWrite();
// display->setAddrWindow(area->x1, area->y1, width, height);
display->writePixels(area->x1, area->y1, width, height,
(uint16_t *)color_p, width * height);
// display->pushColors((uint16_t *)color_p, width * height, false);
lv_disp_flush_ready(disp);
}
#if (LV_USE_LOG)
// Optional LittlevGL debug print function, writes to Serial if debug is
// enabled when calling glue begin() function.
static void lv_debug(lv_log_level_t level, const char *file, uint32_t line, const char *fname,
const char *dsc) {
Serial.print(file);
Serial.write('@');
Serial.print(line);
Serial.print(":");
Serial.print(fname);
Serial.write("->");
Serial.println(dsc);
}
#endif
// GLUE LIB FUNCTIONS ------------------------------------------------------
// Constructor
/**
* @brief Construct a new Adafruit_LvGL_Glue::Adafruit_LvGL_Glue object,
* initializing minimal variables
*
*/
Adafruit_LvGL_Glue::Adafruit_LvGL_Glue(void)
: first_frame(true), lv_pixel_buf(NULL) {
#if defined(ARDUINO_ARCH_SAMD)
zerotimer = NULL;
#endif
}
// Destructor
/**
* @brief Destroy the Adafruit_LvGL_Glue::Adafruit_LvGL_Glue object, freeing any
* memory previously allocated within this library.
*
*/
Adafruit_LvGL_Glue::~Adafruit_LvGL_Glue(void) {
delete[] lv_pixel_buf;
#if defined(ARDUINO_ARCH_SAMD)
delete zerotimer;
#endif
// Probably other stuff that could be deallocated here
}
// begin() function is overloaded for STMPE610 touch, ADC touch, or none.
// Pass in POINTERS to ALREADY INITIALIZED display & touch objects (user code
// should have previously called corresponding begin() functions and checked
// return states before invoking this),
// they are NOT initialized here. Debug arg is
// touch arg can be NULL (or left off) if using LittlevGL as a passive widget
// display.
/**
* @brief Configure the glue layer and the underlying LvGL code to use the given
* TFT display driver instance and touchscreen controller
*
* @param tft Pointer to an **already initialized** display object instance
* @param touch Pointer to an **already initialized** `Adafruit_STMPE610`
* touchscreen controller object instance
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
* configured in LittleLVGL's lv_conf.h
* @return LvGLStatus The status of the initialization:
* * LVGL_OK : Success
* * LVGL_ERR_TIMER : Failure to set up timers
* * LVGL_ERR_ALLOC : Failure to allocate memory
*/
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft,
Adafruit_STMPE610 *touch, bool debug) {
is_adc_touch = false;
return begin(tft, (void *)touch, debug);
}
/**
* @brief Configure the glue layer and the underlying LvGL code to use the given
* TFT display driver and touchscreen controller instances
*
* @param tft Pointer to an **already initialized** display object instance
* @param touch Pointer to an **already initialized** `TouchScreen` touchscreen
* controller object instance
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
* configured in LittleLVGL's lv_conf.h
* @return LvGLStatus The status of the initialization:
* * LVGL_OK : Success
* * LVGL_ERR_TIMER : Failure to set up timers
* * LVGL_ERR_ALLOC : Failure to allocate memory
*/
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, TouchScreen *touch,
bool debug) {
is_adc_touch = true;
return begin(tft, (void *)touch, debug);
}
/**
* @brief Configure the glue layer and the underlying LvGL code to use the given
* TFT display driver and touchscreen controller instances
*
* @param tft Pointer to an **already initialized** display object instance
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
* configured in LittleLVGL's lv_conf.h
* @return LvGLStatus The status of the initialization:
* * LVGL_OK : Success
* * LVGL_ERR_TIMER : Failure to set up timers
* * LVGL_ERR_ALLOC : Failure to allocate memory
*/
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, bool debug) {
return begin(tft, (void *)NULL, debug);
}
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, void *touch,
bool debug) {
lv_init();
// #if (LV_USE_LOG)
// if (debug) {
// lv_log_register_print_cb(lv_debug); // Register debug print function
// }
// #endif
// Allocate LvGL display buffer (x2 because DMA double buffering)
LvGLStatus status = LVGL_ERR_ALLOC;
// if ((lv_pixel_buf = new lv_color_t[LV_HOR_RES_MAX * LV_BUFFER_ROWS * 2])) {
if ((lv_pixel_buf = new lv_color_t[LV_HOR_RES_MAX * LV_BUFFER_ROWS])) {
display = tft;
touchscreen = (void *)touch;
// // Initialize LvGL display buffers
// lv_disp_buf_init(
// &lv_disp_buf, lv_pixel_buf, // 1st half buf
// &lv_pixel_buf[LV_HOR_RES_MAX * LV_BUFFER_ROWS], // 2nd half buf
// LV_HOR_RES_MAX * LV_BUFFER_ROWS);
// Initialize LvGL display buffers
lv_disp_buf_init(
&lv_disp_buf, lv_pixel_buf, // 1st half buf
nullptr, // 2nd half buf
LV_HOR_RES_MAX * LV_BUFFER_ROWS);
// Initialize LvGL display driver
lv_disp_drv_init(&lv_disp_drv);
lv_disp_drv.hor_res = tft->width();
lv_disp_drv.ver_res = tft->height();
lv_disp_drv.flush_cb = lv_flush_callback;
lv_disp_drv.buffer = &lv_disp_buf;
lv_disp_drv.user_data = (lv_disp_drv_user_data_t)this;
lv_disp_drv_register(&lv_disp_drv);
// Initialize LvGL input device (touchscreen already started)
if ((touch)) { // Can also pass NULL if passive widget display
lv_indev_drv_init(&lv_indev_drv); // Basic init
lv_indev_drv.type = LV_INDEV_TYPE_POINTER; // Is pointer dev
lv_indev_drv.read_cb = touchscreen_read; // Read callback
lv_indev_drv.user_data = (lv_indev_drv_user_data_t)this;
lv_input_dev_ptr = lv_indev_drv_register(&lv_indev_drv);
}
// TIMER SETUP is architecture-specific ----------------------------
#if defined(ARDUINO_ARCH_SAMD) // --------------------------------------
// status is still ERR_ALLOC until proven otherwise...
if ((zerotimer = new Adafruit_ZeroTimer(TIMER_NUM))) {
uint8_t divider = 1;
uint16_t compare = 0;
tc_clock_prescaler prescaler = TC_CLOCK_PRESCALER_DIV1;
status = LVGL_OK; // We're prob good now, but one more test...
int freq = 1000 / lv_tick_interval_ms;
if ((freq < (48000000 / 2)) && (freq > (48000000 / 65536))) {
divider = 1;
prescaler = TC_CLOCK_PRESCALER_DIV1;
} else if (freq > (48000000 / 65536 / 2)) {
divider = 2;
prescaler = TC_CLOCK_PRESCALER_DIV2;
} else if (freq > (48000000 / 65536 / 4)) {
divider = 4;
prescaler = TC_CLOCK_PRESCALER_DIV4;
} else if (freq > (48000000 / 65536 / 8)) {
divider = 8;
prescaler = TC_CLOCK_PRESCALER_DIV8;
} else if (freq > (48000000 / 65536 / 16)) {
divider = 16;
prescaler = TC_CLOCK_PRESCALER_DIV16;
} else if (freq > (48000000 / 65536 / 64)) {
divider = 64;
prescaler = TC_CLOCK_PRESCALER_DIV64;
} else if (freq > (48000000 / 65536 / 256)) {
divider = 256;
prescaler = TC_CLOCK_PRESCALER_DIV256;
} else {
status = LVGL_ERR_TIMER; // Invalid frequency
}
if (status == LVGL_OK) {
compare = (48000000 / divider) / freq;
// Initialize timer
zerotimer->configure(prescaler, TC_COUNTER_SIZE_16BIT,
TC_WAVE_GENERATION_MATCH_PWM);
zerotimer->setCompare(0, compare);
zerotimer->setCallback(true, TC_CALLBACK_CC_CHANNEL0, timerCallback0);
zerotimer->enable(true);
}
}
#elif defined(ESP32) // ------------------------------------------------
tick.attach_ms(lv_tick_interval_ms, lv_tick_handler);
status = LVGL_OK;
#elif defined(NRF52_SERIES) // -----------------------------------------
TIMER_ID->TASKS_STOP = 1; // Stop timer
TIMER_ID->MODE = TIMER_MODE_MODE_Timer; // Not counter mode
TIMER_ID->TASKS_CLEAR = 1;
TIMER_ID->BITMODE = TIMER_BITMODE_BITMODE_16Bit
<< TIMER_BITMODE_BITMODE_Pos;
TIMER_ID->PRESCALER = 0; // 1:1 prescale (16 MHz)
TIMER_ID->INTENSET = TIMER_INTENSET_COMPARE0_Enabled
<< TIMER_INTENSET_COMPARE0_Pos; // Event 0 int
TIMER_ID->CC[0] = TIMER_FREQ / (lv_tick_interval_ms * 1000);
NVIC_DisableIRQ(TIMER_IRQN);
NVIC_ClearPendingIRQ(TIMER_IRQN);
NVIC_SetPriority(TIMER_IRQN, 2); // Lower priority than soft device
NVIC_EnableIRQ(TIMER_IRQN);
TIMER_ID->TASKS_START = 1; // Start timer
status = LVGL_OK;
#endif // end timer setup --------------------------------------------------
}
if (status != LVGL_OK) {
delete[] lv_pixel_buf;
lv_pixel_buf = NULL;
#if defined(ARDUINO_ARCH_SAMD)
delete zerotimer;
zerotimer = NULL;
#endif
}
return status;
}

View File

@ -1,388 +0,0 @@
/*!
*
* @file Adafruit_STMPE610.cpp
*
* @mainpage Adafruit STMPE610 Resistive Touch Screen Controller
*
* @section intro_sec Introduction
*
* This is a library for the Adafruit STMPE610 Resistive
* touch screen controller breakout
* ----> http://www.adafruit.com/products/1571
*
* Check out the links above for our tutorials and wiring diagrams
* These breakouts use SPI or I2C to communicate
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* @section author Author
*
* Written by Limor Fried/Ladyada for Adafruit Industries.
*
* @section license License
*
* MIT license, all text above must be included in any redistribution
*/
#include "Arduino.h"
#include <SPI.h>
#include <Wire.h>
#include "Adafruit_STMPE610.h"
static SPISettings mySPISettings;
/*!
* @brief Instantiates a new STMPE610 class using bitbang SPI
* @param cspin
* CS pin
* @param mosipin
* MOSI pin
* @param misopin
* MISO pin
* @param clkpin
* CLK pin
*/
Adafruit_STMPE610::Adafruit_STMPE610(uint8_t cspin, uint8_t mosipin,
uint8_t misopin, uint8_t clkpin) {
_CS = cspin;
_MOSI = mosipin;
_MISO = misopin;
_CLK = clkpin;
}
/*!
* @brief Instantiates a new STMPE610 using provided SPI
* @param cspin
* CS pin
* @param *theSPI
* spi object
*/
Adafruit_STMPE610::Adafruit_STMPE610(uint8_t cspin, SPIClass *theSPI) {
_CS = cspin;
_MOSI = _MISO = _CLK = -1;
_spi = theSPI;
}
/*!
* @brief Instantiates a new STMPE610 using provided Wire
* @param *theWire
* wire object
*/
Adafruit_STMPE610::Adafruit_STMPE610(TwoWire *theWire) {
_CS = _MISO = _MOSI = _CLK = -1;
_wire = theWire;
}
/*!
* @brief Setups the HW
* @param i2caddr
* I2C address (defaults to STMPE_ADDR)
* @return True if process is successful
*/
boolean Adafruit_STMPE610::begin(uint8_t i2caddr) {
if (_CS != -1 && _CLK == -1) {
// hardware SPI
pinMode(_CS, OUTPUT);
digitalWrite(_CS, HIGH);
_spi->begin();
mySPISettings = SPISettings(1000000, MSBFIRST, SPI_MODE0);
m_spiMode = SPI_MODE0;
} else if (_CS != -1) {
// software SPI
pinMode(_CLK, OUTPUT);
pinMode(_CS, OUTPUT);
pinMode(_MOSI, OUTPUT);
pinMode(_MISO, INPUT);
} else {
_wire->begin();
_i2caddr = i2caddr;
}
// try mode0
if (getVersion() != 0x811) {
if (_CS != -1 && _CLK == -1) {
// Serial.println("try MODE1");
mySPISettings = SPISettings(1000000, MSBFIRST, SPI_MODE1);
m_spiMode = SPI_MODE1;
if (getVersion() != 0x811) {
return false;
}
} else {
return false;
}
}
writeRegister8(STMPE_SYS_CTRL1, STMPE_SYS_CTRL1_RESET);
delay(10);
for (uint8_t i = 0; i < 65; i++) {
readRegister8(i);
}
writeRegister8(STMPE_SYS_CTRL2, 0x0); // turn on clocks!
writeRegister8(STMPE_TSC_CTRL,
STMPE_TSC_CTRL_XYZ | STMPE_TSC_CTRL_EN); // XYZ and enable!
// Serial.println(readRegister8(STMPE_TSC_CTRL), HEX);
writeRegister8(STMPE_INT_EN, STMPE_INT_EN_TOUCHDET);
writeRegister8(STMPE_ADC_CTRL1, STMPE_ADC_CTRL1_10BIT |
(0x6 << 4)); // 96 clocks per conversion
writeRegister8(STMPE_ADC_CTRL2, STMPE_ADC_CTRL2_6_5MHZ);
writeRegister8(STMPE_TSC_CFG, STMPE_TSC_CFG_4SAMPLE |
STMPE_TSC_CFG_DELAY_1MS |
STMPE_TSC_CFG_SETTLE_5MS);
writeRegister8(STMPE_TSC_FRACTION_Z, 0x6);
writeRegister8(STMPE_FIFO_TH, 1);
writeRegister8(STMPE_FIFO_STA, STMPE_FIFO_STA_RESET);
writeRegister8(STMPE_FIFO_STA, 0); // unreset
writeRegister8(STMPE_TSC_I_DRIVE, STMPE_TSC_I_DRIVE_50MA);
writeRegister8(STMPE_INT_STA, 0xFF); // reset all ints
writeRegister8(STMPE_INT_CTRL,
STMPE_INT_CTRL_POL_HIGH | STMPE_INT_CTRL_ENABLE);
return true;
}
/*!
* @brief Returns true if touched, false otherwise
* @return True if if touched, false otherwise
*/
boolean Adafruit_STMPE610::touched() {
return (readRegister8(STMPE_TSC_CTRL) & 0x80);
}
/*!
* @brief Checks if buffer is empty
* @return True if empty, false otherwise
*/
boolean Adafruit_STMPE610::bufferEmpty() {
return (readRegister8(STMPE_FIFO_STA) & STMPE_FIFO_STA_EMPTY);
}
/*!
* @brief Returns the FIFO buffer size
* @return The FIFO buffer size
*/
uint8_t Adafruit_STMPE610::bufferSize() {
return readRegister8(STMPE_FIFO_SIZE);
}
/*!
* @brief Returns the STMPE610 version number
* @return The STMPE610 version number
*/
uint16_t Adafruit_STMPE610::getVersion() {
uint16_t v;
// Serial.print("get version");
v = readRegister8(0);
v <<= 8;
v |= readRegister8(1);
// Serial.print("Version: 0x"); Serial.println(v, HEX);
return v;
}
/*!
* @brief Reads touchscreen data
* @param *x
* The x coordinate
* @param *y
* The y coordinate
* @param *z
* The z coordinate
*/
void Adafruit_STMPE610::readData(uint16_t *x, uint16_t *y, uint8_t *z) {
uint8_t data[4];
for (uint8_t i = 0; i < 4; i++) {
data[i] = readRegister8(0xD7); // _spi->transfer(0x00);
// Serial.print("0x"); Serial.print(data[i], HEX); Serial.print(" / ");
}
*x = data[0];
*x <<= 4;
*x |= (data[1] >> 4);
*y = data[1] & 0x0F;
*y <<= 8;
*y |= data[2];
*z = data[3];
}
/*!
* @brief Returns point for touchscreen data
* @return The touch point using TS_Point
*/
TS_Point Adafruit_STMPE610::getPoint() {
uint16_t x, y;
uint8_t z;
/* Making sure that we are reading all data before leaving */
while (!bufferEmpty()) {
readData(&x, &y, &z);
}
if (bufferEmpty())
writeRegister8(STMPE_INT_STA, 0xFF); // reset all ints
return TS_Point(x, y, z);
}
/*!
* @brief Reads SPI data
*/
uint8_t Adafruit_STMPE610::spiIn() {
if (_CLK == -1) {
uint8_t d = _spi->transfer(0);
return d;
} else
return shiftIn(_MISO, _CLK, MSBFIRST);
}
/*!
* @brief Sends data through SPI
* @param x
* Data to send (one byte)
*/
void Adafruit_STMPE610::spiOut(uint8_t x) {
if (_CLK == -1) {
_spi->transfer(x);
} else
shiftOut(_MOSI, _CLK, MSBFIRST, x);
}
/*!
* @brief Reads 8bit of data from specified register
* @param reg
* The register
* @return Data in the register
*/
uint8_t Adafruit_STMPE610::readRegister8(uint8_t reg) {
uint8_t x;
if (_CS == -1) {
// use i2c
_wire->beginTransmission(_i2caddr);
_wire->write((byte)reg);
_wire->endTransmission();
_wire->requestFrom(_i2caddr, (byte)1);
x = _wire->read();
// Serial.print("$"); Serial.print(reg, HEX);
// Serial.print(": 0x"); Serial.println(x, HEX);
} else {
if (_CLK == -1)
_spi->beginTransaction(mySPISettings);
digitalWrite(_CS, LOW);
spiOut(0x80 | reg);
spiOut(0x00);
x = spiIn();
digitalWrite(_CS, HIGH);
if (_CLK == -1)
_spi->endTransaction();
}
return x;
}
/*!
* @brief Reads 16 bits of data from specified register
* @param reg
* The register
* @return Data in the register
*/
uint16_t Adafruit_STMPE610::readRegister16(uint8_t reg) {
uint16_t x = 0;
if (_CS == -1) {
// use i2c
_wire->beginTransmission(_i2caddr);
_wire->write((byte)reg);
_wire->endTransmission();
_wire->requestFrom(_i2caddr, (byte)2);
x = _wire->read();
x <<= 8;
x |= _wire->read();
}
if (_CLK == -1) {
// hardware SPI
if (_CLK == -1)
_spi->beginTransaction(mySPISettings);
digitalWrite(_CS, LOW);
spiOut(0x80 | reg);
spiOut(0x00);
x = spiIn();
x <<= 8;
x |= spiIn();
digitalWrite(_CS, HIGH);
if (_CLK == -1)
_spi->endTransaction();
}
// Serial.print("$"); Serial.print(reg, HEX);
// Serial.print(": 0x"); Serial.println(x, HEX);
return x;
}
/*!
* @brief Writes 8 bit of data to specified register
* @param reg
* The register
* @param val
* Value to write
*/
void Adafruit_STMPE610::writeRegister8(uint8_t reg, uint8_t val) {
if (_CS == -1) {
// use i2c
_wire->beginTransmission(_i2caddr);
_wire->write((byte)reg);
_wire->write(val);
_wire->endTransmission();
} else {
if (_CLK == -1)
_spi->beginTransaction(mySPISettings);
digitalWrite(_CS, LOW);
spiOut(reg);
spiOut(val);
digitalWrite(_CS, HIGH);
if (_CLK == -1)
_spi->endTransaction();
}
}
/*!
* @brief TS_Point constructor
*/
TS_Point::TS_Point() { x = y = 0; }
/*!
* @brief TS_Point constructor
* @param x0
* Initial x
* @param y0
* Initial y
* @param z0
* Initial z
*/
TS_Point::TS_Point(int16_t x0, int16_t y0, int16_t z0) {
x = x0;
y = y0;
z = z0;
}
/*!
* @brief Equality operator for TS_Point
* @return True if points are equal
*/
bool TS_Point::operator==(TS_Point p1) {
return ((p1.x == x) && (p1.y == y) && (p1.z == z));
}
/*!
* @brief Non-equality operator for TS_Point
* @return True if points are not equal
*/
bool TS_Point::operator!=(TS_Point p1) {
return ((p1.x != x) || (p1.y != y) || (p1.z != z));
}

View File

@ -1,183 +0,0 @@
/*!
*
* @file Adafruit_STMPE610.cpp
*
* This is a library for the Adafruit STMPE610 Resistive
* touch screen controller breakout
* ----> http://www.adafruit.com/products/1571
*
* Check out the links above for our tutorials and wiring diagrams
* These breakouts use SPI or I2C to communicate
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Limor Fried/Ladyada for Adafruit Industries.
*
* MIT license, all text above must be included in any redistribution
*/
#ifndef _ADAFRUIT_STMPE610H_
#define _ADAFRUIT_STMPE610H_
#include "Arduino.h"
#include <SPI.h>
#include <Wire.h>
/** STMPE610 Address **/
#define STMPE_ADDR 0x41
/** Reset Control **/
#define STMPE_SYS_CTRL1 0x03
#define STMPE_SYS_CTRL1_RESET 0x02
/** Clock Contrl **/
#define STMPE_SYS_CTRL2 0x04
/** Touchscreen controller setup **/
#define STMPE_TSC_CTRL 0x40
#define STMPE_TSC_CTRL_EN 0x01
#define STMPE_TSC_CTRL_XYZ 0x00
#define STMPE_TSC_CTRL_XY 0x02
/** Interrupt control **/
#define STMPE_INT_CTRL 0x09
#define STMPE_INT_CTRL_POL_HIGH 0x04
#define STMPE_INT_CTRL_POL_LOW 0x00
#define STMPE_INT_CTRL_EDGE 0x02
#define STMPE_INT_CTRL_LEVEL 0x00
#define STMPE_INT_CTRL_ENABLE 0x01
#define STMPE_INT_CTRL_DISABLE 0x00
/** Interrupt enable **/
#define STMPE_INT_EN 0x0A
#define STMPE_INT_EN_TOUCHDET 0x01
#define STMPE_INT_EN_FIFOTH 0x02
#define STMPE_INT_EN_FIFOOF 0x04
#define STMPE_INT_EN_FIFOFULL 0x08
#define STMPE_INT_EN_FIFOEMPTY 0x10
#define STMPE_INT_EN_ADC 0x40
#define STMPE_INT_EN_GPIO 0x80
/** Interrupt status **/
#define STMPE_INT_STA 0x0B
#define STMPE_INT_STA_TOUCHDET 0x01
/** ADC control **/
#define STMPE_ADC_CTRL1 0x20
#define STMPE_ADC_CTRL1_12BIT 0x08
#define STMPE_ADC_CTRL1_10BIT 0x00
/** ADC control **/
#define STMPE_ADC_CTRL2 0x21
#define STMPE_ADC_CTRL2_1_625MHZ 0x00
#define STMPE_ADC_CTRL2_3_25MHZ 0x01
#define STMPE_ADC_CTRL2_6_5MHZ 0x02
/** Touchscreen controller configuration **/
#define STMPE_TSC_CFG 0x41
#define STMPE_TSC_CFG_1SAMPLE 0x00
#define STMPE_TSC_CFG_2SAMPLE 0x40
#define STMPE_TSC_CFG_4SAMPLE 0x80
#define STMPE_TSC_CFG_8SAMPLE 0xC0
#define STMPE_TSC_CFG_DELAY_10US 0x00
#define STMPE_TSC_CFG_DELAY_50US 0x08
#define STMPE_TSC_CFG_DELAY_100US 0x10
#define STMPE_TSC_CFG_DELAY_500US 0x18
#define STMPE_TSC_CFG_DELAY_1MS 0x20
#define STMPE_TSC_CFG_DELAY_5MS 0x28
#define STMPE_TSC_CFG_DELAY_10MS 0x30
#define STMPE_TSC_CFG_DELAY_50MS 0x38
#define STMPE_TSC_CFG_SETTLE_10US 0x00
#define STMPE_TSC_CFG_SETTLE_100US 0x01
#define STMPE_TSC_CFG_SETTLE_500US 0x02
#define STMPE_TSC_CFG_SETTLE_1MS 0x03
#define STMPE_TSC_CFG_SETTLE_5MS 0x04
#define STMPE_TSC_CFG_SETTLE_10MS 0x05
#define STMPE_TSC_CFG_SETTLE_50MS 0x06
#define STMPE_TSC_CFG_SETTLE_100MS 0x07
/** FIFO level to generate interrupt **/
#define STMPE_FIFO_TH 0x4A
/** Current filled level of FIFO **/
#define STMPE_FIFO_SIZE 0x4C
/** Current status of FIFO **/
#define STMPE_FIFO_STA 0x4B
#define STMPE_FIFO_STA_RESET 0x01
#define STMPE_FIFO_STA_OFLOW 0x80
#define STMPE_FIFO_STA_FULL 0x40
#define STMPE_FIFO_STA_EMPTY 0x20
#define STMPE_FIFO_STA_THTRIG 0x10
/** Touchscreen controller drive I **/
#define STMPE_TSC_I_DRIVE 0x58
#define STMPE_TSC_I_DRIVE_20MA 0x00
#define STMPE_TSC_I_DRIVE_50MA 0x01
/** Data port for TSC data address **/
#define STMPE_TSC_DATA_X 0x4D
#define STMPE_TSC_DATA_Y 0x4F
#define STMPE_TSC_FRACTION_Z 0x56
/** GPIO **/
#define STMPE_GPIO_SET_PIN 0x10
#define STMPE_GPIO_CLR_PIN 0x11
#define STMPE_GPIO_DIR 0x13
#define STMPE_GPIO_ALT_FUNCT 0x17
/*!
* @brief Class for working with points
*/
class TS_Point {
public:
TS_Point();
TS_Point(int16_t x, int16_t y, int16_t z);
bool operator==(TS_Point);
bool operator!=(TS_Point);
int16_t x; /**< x coordinate **/
int16_t y; /**< y coordinate **/
int16_t z; /**< z coordinate **/
};
/*!
* @brief Class that stores state and functions for interacting with
* STMPE610
*/
class Adafruit_STMPE610 {
public:
Adafruit_STMPE610(uint8_t cspin, uint8_t mosipin, uint8_t misopin,
uint8_t clkpin);
Adafruit_STMPE610(uint8_t cspin, SPIClass *theSPI = &SPI);
Adafruit_STMPE610(TwoWire *theWire = &Wire);
boolean begin(uint8_t i2caddr = STMPE_ADDR);
void writeRegister8(uint8_t reg, uint8_t val);
uint16_t readRegister16(uint8_t reg);
uint8_t readRegister8(uint8_t reg);
void readData(uint16_t *x, uint16_t *y, uint8_t *z);
uint16_t getVersion();
boolean touched();
boolean bufferEmpty();
uint8_t bufferSize();
TS_Point getPoint();
private:
uint8_t spiIn();
void spiOut(uint8_t x);
TwoWire *_wire;
SPIClass *_spi;
int8_t _CS, _MOSI, _MISO, _CLK;
uint8_t _i2caddr;
int m_spiMode;
};
#endif

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 Adafruit Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,20 +0,0 @@
# Adafruit STMPE610 Library [![Build Status](https://github.com/adafruit/Adafruit_STMPE610/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_STMPE610/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_STMPE610/html/index.html)
<a href="http://www.adafruit.com/products/1571"><img src="assets/board.jpg?raw=true" width="500px"></a>
This is a library for the Adafruit STMPE610 Resistive
touch screen controller breakout
* http://www.adafruit.com/products/1571
Check out the links above for our tutorials and wiring diagrams
These breakouts use SPI or I2C to communicate
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
To install, use the Arduino Library Manager and search for "Adafruit STMPE610" and install the library.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 KiB

View File

@ -1,127 +0,0 @@
# Adafruit Community Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and leaders pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level or type of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.
## Our Standards
We are committed to providing a friendly, safe and welcoming environment for
all.
Examples of behavior that contributes to creating a positive environment
include:
* Be kind and courteous to others
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Collaborating with other community members
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and sexual attention or advances
* The use of inappropriate images, including in a community member's avatar
* The use of inappropriate language, including in a community member's nickname
* Any spamming, flaming, baiting or other attention-stealing behavior
* Excessive or unwelcome helping; answering outside the scope of the question
asked
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate
The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you dont just aim to be
"technically unimpeachable", but rather try to be your best self.
We value many things beyond technical expertise, including collaboration and
supporting others within our community. Providing a positive experience for
other community members can have a much more significant impact than simply
providing the correct answer.
## Our Responsibilities
Project leaders are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project leaders have the right and responsibility to remove, edit, or
reject messages, comments, commits, code, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any community member for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.
## Moderation
Instances of behaviors that violate the Adafruit Community Code of Conduct
may be reported by any member of the community. Community members are
encouraged to report these situations, including situations they witness
involving other community members.
You may report in the following ways:
In any situation, you may send an email to <support@adafruit.com>.
On the Adafruit Discord, you may send an open message from any channel
to all Community Helpers by tagging @community helpers. You may also send an
open message from any channel, or a direct message to @kattni#1507,
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
@Andon#8175.
Email and direct message reports will be kept confidential.
In situations on Discord where the issue is particularly egregious, possibly
illegal, requires immediate action, or violates the Discord terms of service,
you should also report the message directly to Discord.
These are the steps for upholding our communitys standards of conduct.
1. Any member of the community may report any situation that violates the
Adafruit Community Code of Conduct. All reports will be reviewed and
investigated.
2. If the behavior is an egregious violation, the community member who
committed the violation may be banned immediately, without warning.
3. Otherwise, moderators will first respond to such behavior with a warning.
4. Moderators follow a soft "three strikes" policy - the community member may
be given another chance, if they are receptive to the warning and change their
behavior.
5. If the community member is unreceptive or unreasonable when warned by a
moderator, or the warning goes unheeded, they may be banned for a first or
second offense. Repeated offenses will result in the community member being
banned.
## Scope
This Code of Conduct and the enforcement policies listed above apply to all
Adafruit Community venues. This includes but is not limited to any community
spaces (both public and private), the entire Adafruit Discord server, and
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
interaction at a conference.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. As a community
member, you are representing our community, and are expected to behave
accordingly.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
For other projects adopting the Adafruit Community Code of
Conduct, please contact the maintainers of those projects for enforcement.
If you wish to use this code of conduct for your own project, consider
explicitly mentioning your moderation policy or making a copy with your
own moderation policy so as to avoid confusion.

View File

@ -1,81 +0,0 @@
/***************************************************
This is an example for the Adafruit STMPE610 Resistive
touch screen controller breakout
----> http://www.adafruit.com/products/1571
Check out the links above for our tutorials and wiring diagrams
These breakouts use SPI or I2C to communicate
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
****************************************************/
#include <SPI.h>
#include <Wire.h>
#include "Adafruit_STMPE610.h"
// Pick one of three wiring options below!
// Option #1 - uses I2C, connect to hardware I2C port only!
// SCL to I2C clock (#A5 on Uno) and SDA to I2C data (#A4 on Uno)
// tie MODE to GND and POWER CYCLE (there is no reset pin)
Adafruit_STMPE610 touch = Adafruit_STMPE610();
// Option #2 - use hardware SPI, connect to hardware SPI port only!
// SDI to MOSI, SDO to MISO, and SCL to SPI CLOCK
// on Arduino Uno, that's 11, 12 and 13 respectively
// Then pick a CS pin, any pin is OK but we suggest #10 on an Uno
// tie MODE to 3.3V and POWER CYCLE the STMPE610 (there is no reset pin)
//Adafruit_STMPE610 touch = Adafruit_STMPE610(STMPE_CS);
// Option #3 - use software SPI, connect to *any* 4 I/O pins!
// define the following pins to whatever 4 you want and wire up!
// Tie MODE to 3.3V and POWER CYCLE the STMPE610 (there is no reset pin)
// Adafruit_STMPE610 touch = Adafruit_STMPE610(STMPE_CS, STMPE_SDI, STMPE_SDO, STMPE_SCK);
/******************/
void setup() {
Serial.begin(9600);
Serial.println("Adafruit STMPE610 example");
Serial.flush();
// if using hardware SPI on an Uno #10 must be an output, remove line
// if using software SPI or I2C
pinMode(10, OUTPUT);
// If using I2C you can select the I2C address (there are two options) by calling
// touch.begin(0x41), the default, or touch.begin(0x44) if A0 is tied to 3.3V
// If no address is passed, 0x41 is used
if (! touch.begin()) {
Serial.println("STMPE not found!");
while(1);
}
Serial.println("Waiting for touch sense");
}
void loop() {
uint16_t x, y;
uint8_t z;
if (touch.touched()) {
// read x & y & z;
while (! touch.bufferEmpty()) {
Serial.print(touch.bufferSize());
touch.readData(&x, &y, &z);
Serial.print("->(");
Serial.print(x); Serial.print(", ");
Serial.print(y); Serial.print(", ");
Serial.print(z);
Serial.println(")");
}
touch.writeRegister8(STMPE_INT_STA, 0xFF); // reset all ints, in this example unneeded depending in use
}
delay(10);
}

View File

@ -1,9 +0,0 @@
name=Adafruit STMPE610
version=1.1.3
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library for STMPE610/811 resistive touch screen controllers
paragraph=Arduino library for STMPE610/811 resistive touch screen controllers
category=Display
url=https://github.com/adafruit/Adafruit_STMPE610
architectures=*

View File

@ -1,26 +0,0 @@
# Adafruit TouchScreen Library [![Build Status](https://github.com/adafruit/Adafruit_TouchScreen/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_TouchScreen/actions)
This is the 4-wire resistive touch screen firmware for Arduino. Works with all Arduinos and Teensy
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
# Contributing
Contributions are welcome! Please read our [Code of Conduct](https://github.com/adafruit/Adafruit_TouchScreen/blob/master/CODE_OF_CONDUCT.md>)
before contributing to help this project stay welcoming.
## Documentation and doxygen
Documentation is produced by doxygen. Contributions should include documentation for any new code added.
Some examples of how to use doxygen can be found in these guide pages:
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips
Written by Limor Fried for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution
To install, use the Arduino Library Manager and search for "Adafruit TouchScreen" and install the library.

View File

@ -1,291 +0,0 @@
// Touch screen library with X Y and Z (pressure) readings as well
// as oversampling to avoid 'bouncing'
// (c) ladyada / adafruit
// Code under MIT License
#include "Arduino.h"
#include "pins_arduino.h"
#ifdef __AVR
#include <avr/pgmspace.h>
#elif defined(ESP8266)
#include <pgmspace.h>
#endif
#include "TouchScreen.h"
// increase or decrease the touchscreen oversampling. This is a little different
// than you make think: 1 is no oversampling, whatever data we get is
// immediately returned 2 is double-sampling and we only return valid data if
// both points are the same 3+ uses insert sort to get the median value. We
// found 2 is precise yet not too slow so we suggest sticking with it!
#define NUMSAMPLES 2
TSPoint::TSPoint(void) { x = y = z = 0; }
/**
* @brief Construct a new TSPoint::TSPoint object
*
* @param x0 The point's X value
* @param y0 The point's Y value
* @param z0 The point's Z value
*/
TSPoint::TSPoint(int16_t x0, int16_t y0, int16_t z0) {
x = x0;
y = y0;
z = z0;
}
/**
* @brief Check if the current point is **not** equivalent to another point
*
* @param p1 The other point being checked for equivalence
* @return `true` : the two points are equivalent
* `false`: the two points are **not** equivalent
*/
bool TSPoint::operator==(TSPoint p1) {
return ((p1.x == x) && (p1.y == y) && (p1.z == z));
}
/**
* @brief Check if the current point is **not** equivalent to another point
*
* @param p1 The other point being checked for equivalence
* @return `true` :the two points are **not** equivalent
* `false`: the two points are equivalent
*/
bool TSPoint::operator!=(TSPoint p1) {
return ((p1.x != x) || (p1.y != y) || (p1.z != z));
}
#if (NUMSAMPLES > 2)
static void insert_sort(int array[], uint8_t size) {
uint8_t j;
int save;
for (int i = 1; i < size; i++) {
save = array[i];
for (j = i; j >= 1 && save < array[j - 1]; j--)
array[j] = array[j - 1];
array[j] = save;
}
}
#endif
/**
* @brief Measure the X, Y, and pressure and return a TSPoint with the
* measurements
*
* @return TSPoint The measured X, Y, and Z/pressure values
*/
TSPoint TouchScreen::getPoint(void) {
int x, y, z;
int samples[NUMSAMPLES];
uint8_t i, valid;
valid = 1;
pinMode(_yp, INPUT);
pinMode(_ym, INPUT);
pinMode(_xp, OUTPUT);
pinMode(_xm, OUTPUT);
#if defined(USE_FAST_PINIO)
*xp_port |= xp_pin;
*xm_port &= ~xm_pin;
#else
digitalWrite(_xp, HIGH);
digitalWrite(_xm, LOW);
#endif
#ifdef __arm__
delayMicroseconds(20); // Fast ARM chips need to allow voltages to settle
#endif
for (i = 0; i < NUMSAMPLES; i++) {
samples[i] = analogRead(_yp);
}
#if NUMSAMPLES > 2
insert_sort(samples, NUMSAMPLES);
#endif
#if NUMSAMPLES == 2
// Allow small amount of measurement noise, because capacitive
// coupling to a TFT display's signals can induce some noise.
if (samples[0] - samples[1] < -4 || samples[0] - samples[1] > 4) {
valid = 0;
} else {
samples[1] = (samples[0] + samples[1]) >> 1; // average 2 samples
}
#endif
x = (1023 - samples[NUMSAMPLES / 2]);
pinMode(_xp, INPUT);
pinMode(_xm, INPUT);
pinMode(_yp, OUTPUT);
pinMode(_ym, OUTPUT);
#if defined(USE_FAST_PINIO)
*ym_port &= ~ym_pin;
*yp_port |= yp_pin;
#else
digitalWrite(_ym, LOW);
digitalWrite(_yp, HIGH);
#endif
#ifdef __arm__
delayMicroseconds(20); // Fast ARM chips need to allow voltages to settle
#endif
for (i = 0; i < NUMSAMPLES; i++) {
samples[i] = analogRead(_xm);
}
#if NUMSAMPLES > 2
insert_sort(samples, NUMSAMPLES);
#endif
#if NUMSAMPLES == 2
// Allow small amount of measurement noise, because capacitive
// coupling to a TFT display's signals can induce some noise.
if (samples[0] - samples[1] < -4 || samples[0] - samples[1] > 4) {
valid = 0;
} else {
samples[1] = (samples[0] + samples[1]) >> 1; // average 2 samples
}
#endif
y = (1023 - samples[NUMSAMPLES / 2]);
// Set X+ to ground
// Set Y- to VCC
// Hi-Z X- and Y+
pinMode(_xp, OUTPUT);
pinMode(_yp, INPUT);
#if defined(USE_FAST_PINIO)
*xp_port &= ~xp_pin;
*ym_port |= ym_pin;
#else
digitalWrite(_xp, LOW);
digitalWrite(_ym, HIGH);
#endif
int z1 = analogRead(_xm);
int z2 = analogRead(_yp);
if (_rxplate != 0) {
// now read the x
float rtouch;
rtouch = z2;
rtouch /= z1;
rtouch -= 1;
rtouch *= x;
rtouch *= _rxplate;
rtouch /= 1024;
z = rtouch;
} else {
z = (1023 - (z2 - z1));
}
if (!valid) {
z = 0;
}
return TSPoint(x, y, z);
}
TouchScreen::TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym,
uint16_t rxplate = 0) {
_yp = yp;
_xm = xm;
_ym = ym;
_xp = xp;
_rxplate = rxplate;
#if defined(USE_FAST_PINIO)
xp_port = portOutputRegister(digitalPinToPort(_xp));
yp_port = portOutputRegister(digitalPinToPort(_yp));
xm_port = portOutputRegister(digitalPinToPort(_xm));
ym_port = portOutputRegister(digitalPinToPort(_ym));
xp_pin = digitalPinToBitMask(_xp);
yp_pin = digitalPinToBitMask(_yp);
xm_pin = digitalPinToBitMask(_xm);
ym_pin = digitalPinToBitMask(_ym);
#endif
pressureThreshhold = 10;
}
/**
* @brief Read the touch event's X value
*
* @return int the X measurement
*/
int TouchScreen::readTouchX(void) {
pinMode(_yp, INPUT);
pinMode(_ym, INPUT);
digitalWrite(_yp, LOW);
digitalWrite(_ym, LOW);
pinMode(_xp, OUTPUT);
digitalWrite(_xp, HIGH);
pinMode(_xm, OUTPUT);
digitalWrite(_xm, LOW);
return (1023 - analogRead(_yp));
}
/**
* @brief Read the touch event's Y value
*
* @return int the Y measurement
*/
int TouchScreen::readTouchY(void) {
pinMode(_xp, INPUT);
pinMode(_xm, INPUT);
digitalWrite(_xp, LOW);
digitalWrite(_xm, LOW);
pinMode(_yp, OUTPUT);
digitalWrite(_yp, HIGH);
pinMode(_ym, OUTPUT);
digitalWrite(_ym, LOW);
return (1023 - analogRead(_xm));
}
/**
* @brief Read the touch event's Z/pressure value
*
* @return int the Z measurement
*/
uint16_t TouchScreen::pressure(void) {
// Set X+ to ground
pinMode(_xp, OUTPUT);
digitalWrite(_xp, LOW);
// Set Y- to VCC
pinMode(_ym, OUTPUT);
digitalWrite(_ym, HIGH);
// Hi-Z X- and Y+
digitalWrite(_xm, LOW);
pinMode(_xm, INPUT);
digitalWrite(_yp, LOW);
pinMode(_yp, INPUT);
int z1 = analogRead(_xm);
int z2 = analogRead(_yp);
if (_rxplate != 0) {
// now read the x
float rtouch;
rtouch = z2;
rtouch /= z1;
rtouch -= 1;
rtouch *= readTouchX();
rtouch *= _rxplate;
rtouch /= 1024;
return rtouch;
} else {
return (1023 - (z2 - z1));
}
}

View File

@ -1,79 +0,0 @@
// Touch screen library with X Y and Z (pressure) readings as well
// as oversampling to avoid 'bouncing'
// (c) ladyada / adafruit
// Code under MIT License
#ifndef _ADAFRUIT_TOUCHSCREEN_H_
#define _ADAFRUIT_TOUCHSCREEN_H_
#include <stdint.h>
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega32U4__) || \
defined(TEENSYDUINO) || defined(__AVR_ATmega2560__) || \
defined(__AVR_ATmega4809__)
typedef volatile uint8_t RwReg;
#elif defined(ARDUINO_STM32_FEATHER)
typedef volatile uint32 RwReg;
#elif defined(NRF52_SERIES) || defined(ESP32) || defined(ESP8266) || \
defined(ARDUINO_ARCH_STM32)
typedef volatile uint32_t RwReg;
#else
typedef volatile uint32_t RwReg;
#endif
#if defined(__AVR__) || defined(TEENSYDUINO) || defined(ARDUINO_ARCH_SAMD)
#define USE_FAST_PINIO
#endif
/** Object that encapsulates the X,Y, and Z/pressure measurements for a touch
* event. */
class TSPoint {
public:
TSPoint(void);
TSPoint(int16_t x, int16_t y, int16_t z);
bool operator==(TSPoint);
bool operator!=(TSPoint);
int16_t x, ///< state variable for the x value
y, ///< state variable for the y value
z; ///< state variable for the z value
};
/** Object that controls and keeps state for a touch screen. */
class TouchScreen {
public:
/**
* @brief Construct a new Touch Screen object
*
* @param xp X+ pin. Must be an analog pin
* @param yp Y+ pin. Must be an analog pin
* @param xm X- pin. Can be a digital pin
* @param ym Y- pin. Can be a digital pin
* @param rx The resistance in ohms between X+ and X- to calibrate pressure
* sensing
*/
TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx);
/**
* @brief **NOT IMPLEMENTED** Test if the screen has been touched
*
* @return true : touch detected false: no touch detected
*/
bool isTouching(void);
uint16_t pressure(void);
int readTouchY();
int readTouchX();
TSPoint getPoint();
int16_t pressureThreshhold; ///< Pressure threshold for `isTouching`
private:
uint8_t _yp, _ym, _xm, _xp;
uint16_t _rxplate;
#if defined(USE_FAST_PINIO)
volatile RwReg *xp_port, *yp_port, *xm_port, *ym_port;
RwReg xp_pin, xm_pin, yp_pin, ym_pin;
#endif
};
#endif

View File

@ -1,127 +0,0 @@
# Adafruit Community Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and leaders pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level or type of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.
## Our Standards
We are committed to providing a friendly, safe and welcoming environment for
all.
Examples of behavior that contributes to creating a positive environment
include:
* Be kind and courteous to others
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Collaborating with other community members
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and sexual attention or advances
* The use of inappropriate images, including in a community member's avatar
* The use of inappropriate language, including in a community member's nickname
* Any spamming, flaming, baiting or other attention-stealing behavior
* Excessive or unwelcome helping; answering outside the scope of the question
asked
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate
The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you dont just aim to be
"technically unimpeachable", but rather try to be your best self.
We value many things beyond technical expertise, including collaboration and
supporting others within our community. Providing a positive experience for
other community members can have a much more significant impact than simply
providing the correct answer.
## Our Responsibilities
Project leaders are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project leaders have the right and responsibility to remove, edit, or
reject messages, comments, commits, code, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any community member for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.
## Moderation
Instances of behaviors that violate the Adafruit Community Code of Conduct
may be reported by any member of the community. Community members are
encouraged to report these situations, including situations they witness
involving other community members.
You may report in the following ways:
In any situation, you may send an email to <support@adafruit.com>.
On the Adafruit Discord, you may send an open message from any channel
to all Community Helpers by tagging @community helpers. You may also send an
open message from any channel, or a direct message to @kattni#1507,
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
@Andon#8175.
Email and direct message reports will be kept confidential.
In situations on Discord where the issue is particularly egregious, possibly
illegal, requires immediate action, or violates the Discord terms of service,
you should also report the message directly to Discord.
These are the steps for upholding our communitys standards of conduct.
1. Any member of the community may report any situation that violates the
Adafruit Community Code of Conduct. All reports will be reviewed and
investigated.
2. If the behavior is an egregious violation, the community member who
committed the violation may be banned immediately, without warning.
3. Otherwise, moderators will first respond to such behavior with a warning.
4. Moderators follow a soft "three strikes" policy - the community member may
be given another chance, if they are receptive to the warning and change their
behavior.
5. If the community member is unreceptive or unreasonable when warned by a
moderator, or the warning goes unheeded, they may be banned for a first or
second offense. Repeated offenses will result in the community member being
banned.
## Scope
This Code of Conduct and the enforcement policies listed above apply to all
Adafruit Community venues. This includes but is not limited to any community
spaces (both public and private), the entire Adafruit Discord server, and
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
interaction at a conference.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. As a community
member, you are representing our community, and are expected to behave
accordingly.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
For other projects adopting the Adafruit Community Code of
Conduct, please contact the maintainers of those projects for enforcement.
If you wish to use this code of conduct for your own project, consider
explicitly mentioning your moderation policy or making a copy with your
own moderation policy so as to avoid confusion.

View File

@ -1,35 +0,0 @@
// Touch screen library with X Y and Z (pressure) readings as well
// as oversampling to avoid 'bouncing'
// This demo code returns raw readings, public domain
#include <stdint.h>
#include "TouchScreen.h"
#define YP A2 // must be an analog pin, use "An" notation!
#define XM A3 // must be an analog pin, use "An" notation!
#define YM 8 // can be a digital pin
#define XP 9 // can be a digital pin
// For better pressure precision, we need to know the resistance
// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
void setup(void) {
Serial.begin(9600);
}
void loop(void) {
// a point object holds x y and z coordinates
TSPoint p = ts.getPoint();
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
if (p.z > ts.pressureThreshhold) {
Serial.print("X = "); Serial.print(p.x);
Serial.print("\tY = "); Serial.print(p.y);
Serial.print("\tPressure = "); Serial.println(p.z);
}
delay(100);
}

View File

@ -1,37 +0,0 @@
// Touch screen library with X Y and Z (pressure) readings as well
// as oversampling to avoid 'bouncing'
// This demo code returns raw readings, public domain
#include <stdint.h>
#include "TouchScreen.h"
// These are the pins for the shield!
#define YP A1 // must be an analog pin, use "An" notation!
#define XM A2 // must be an analog pin, use "An" notation!
#define YM 7 // can be a digital pin
#define XP 6 // can be a digital pin
#define MINPRESSURE 10
#define MAXPRESSURE 1000
// For better pressure precision, we need to know the resistance
// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
void setup(void) {
Serial.begin(9600);
}
void loop(void) {
// a point object holds x y and z coordinates
TSPoint p = ts.getPoint();
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
Serial.print("X = "); Serial.print(p.x);
Serial.print("\tY = "); Serial.print(p.y);
Serial.print("\tPressure = "); Serial.println(p.z);
}
}

View File

@ -1,9 +0,0 @@
name=Adafruit TouchScreen
version=1.1.1
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Adafruit TouchScreen display library.
paragraph=Adafruit TouchScreen display library.
category=Display
url=https://github.com/adafruit/Adafruit_TouchScreen
architectures=*

View File

@ -1,26 +0,0 @@
Software License Agreement (BSD License)
Copyright (c) 2019 Limor Fried for Adafruit Industries
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -53,7 +53,7 @@ uint16_t uDisplay_lvgl::GetColorFromIndex(uint8_t index) {
extern uint8_t *buffer;
extern uint8_t color_type;
uDisplay_lvgl::uDisplay_lvgl(char *lp) : Renderer(800, 600) {
uDisplay_lvgl::uDisplay_lvgl(char *lp) {
// analyse decriptor
col_mode = 16;
sa_mode = 16;
@ -100,9 +100,7 @@ uDisplay_lvgl::uDisplay_lvgl(char *lp) : Renderer(800, 600) {
str2c(&lp1, dname, sizeof(dname));
char ibuff[16];
gxs = next_val(&lp1);
setwidth(gxs);
gys = next_val(&lp1);
setheight(gys);
bpp = next_val(&lp1);
if (bpp == 1) {
color_type = uCOLOR_BW;
@ -679,191 +677,6 @@ void uDisplay_lvgl::Updateframe(void) {
}
void uDisplay_lvgl::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) {
if (ep_mode) {
drawFastVLine_EPD(x, y, h, color);
return;
}
if (interface != _UDSP_SPI) {
Renderer::drawFastVLine(x, y, h, color);
return;
}
// Rudimentary clipping
if ((x >= _width) || (y >= _height)) return;
if ((y + h - 1) >= _height) h = _height - y;
SPI_BEGIN_TRANSACTION
SPI_CS_LOW
setAddrWindow_int(x, y, 1, h);
if (col_mode == 18) {
uint8_t r = (color & 0xF800) >> 11;
uint8_t g = (color & 0x07E0) >> 5;
uint8_t b = color & 0x001F;
r = (r * 255) / 31;
g = (g * 255) / 63;
b = (b * 255) / 31;
while (h--) {
spi_data8(r);
spi_data8(g);
spi_data8(b);
}
} else {
while (h--) {
WriteColor(color);
}
}
SPI_CS_HIGH
SPI_END_TRANSACTION
}
void uDisplay_lvgl::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) {
if (ep_mode) {
drawFastHLine_EPD(x, y, w, color);
return;
}
if (interface != _UDSP_SPI) {
Renderer::drawFastHLine(x, y, w, color);
return;
}
// Rudimentary clipping
if((x >= _width) || (y >= _height)) return;
if((x+w-1) >= _width) w = _width-x;
SPI_BEGIN_TRANSACTION
SPI_CS_LOW
setAddrWindow_int(x, y, w, 1);
if (col_mode == 18) {
uint8_t r = (color & 0xF800) >> 11;
uint8_t g = (color & 0x07E0) >> 5;
uint8_t b = color & 0x001F;
r = (r * 255) / 31;
g = (g * 255) / 63;
b = (b * 255) / 31;
while (w--) {
spi_data8(r);
spi_data8(g);
spi_data8(b);
}
} else {
while (w--) {
WriteColor(color);
}
}
SPI_CS_HIGH
SPI_END_TRANSACTION
}
void uDisplay_lvgl::fillScreen(uint16_t color) {
fillRect(0, 0, gxs, gys, color);
}
// fill a rectangle
void uDisplay_lvgl::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) {
if (ep_mode) {
fillRect_EPD(x, y, w, h, color);
return;
}
if (interface != _UDSP_SPI) {
Renderer::fillRect(x, y, w, h, color);
return;
}
if((x >= gxs) || (y >= gys)) return;
if((x + w - 1) >= gxs) w = gxs - x;
if((y + h - 1) >= gys) h = gys - y;
SPI_BEGIN_TRANSACTION
SPI_CS_LOW
setAddrWindow_int(x, y, w, h);
if (col_mode == 18) {
uint8_t r = (color & 0xF800) >> 11;
uint8_t g = (color & 0x07E0) >> 5;
uint8_t b = color & 0x001F;
r = (r * 255) / 31;
g = (g * 255) / 63;
b = (b * 255) / 31;
for (y = h; y > 0; y--) {
for (x = w; x > 0; x--) {
spi_data8(r);
spi_data8(g);
spi_data8(b);
}
}
} else {
for (y = h; y > 0; y--) {
for (x = w; x > 0; x--) {
WriteColor(color);
}
}
}
SPI_CS_HIGH
SPI_END_TRANSACTION
}
/*
// pack RGB into uint32
uint32_t pack_rgb(uint32_t r, uint32_t g, uint32_t b) {
uint32_t data;
data=r<<23;
data|=g<<14;
data|=b<<5;
data|=0b10000000010000000010000000000000;
return ulswap(data);
}
// init 27 bit mode
uint32_t data=pack_rgb(r,g,b);
REG_SET_BIT(SPI_USER_REG(3), SPI_USR_MOSI);
REG_WRITE(SPI_MOSI_DLEN_REG(3), 27 - 1);
uint32_t *dp=(uint32_t*)SPI_W0_REG(3);
digitalWrite( _cs, LOW);
for(y=h; y>0; y--) {
for(x=w; x>0; x--) {
while (REG_GET_FIELD(SPI_CMD_REG(3), SPI_USR));
*dp=data;
REG_SET_BIT(SPI_CMD_REG(3), SPI_USR);
}
}
*/
// void uDisplay_lvgl::Splash(void) {
// if (ep_mode) {
// delay(lut3time * 10);
// }
// setTextFont(splash_font);
// setTextSize(splash_size);
// DrawStringAt(splash_xp, splash_yp, dname, fg_col, 0);
// Updateframe();
// }
void uDisplay_lvgl::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
@ -917,7 +730,7 @@ void uDisplay_lvgl::setAddrWindow_int(uint16_t x, uint16_t y, uint16_t w, uint16
}
void uDisplay_lvgl::pushColors(uint16_t *data, uint16_t len, boolean first) {
void uDisplay_lvgl::pushColors(uint16_t *data, uint16_t len, bool first) {
uint16_t color;
while (len--) {
@ -949,32 +762,32 @@ void uDisplay_lvgl::WriteColor(uint16_t color) {
void uDisplay_lvgl::drawPixel(int16_t x, int16_t y, uint16_t color) {
if (ep_mode) {
drawPixel_EPD(x, y, color);
return;
}
// if (ep_mode) {
// drawPixel_EPD(x, y, color);
// return;
// }
if (interface != _UDSP_SPI) {
Renderer::drawPixel(x, y, color);
return;
}
// if (interface != _UDSP_SPI) {
// Renderer::drawPixel(x, y, color);
// return;
// }
if ((x < 0) || (x >= _width) || (y < 0) || (y >= _height)) return;
// if ((x < 0) || (x >= _width) || (y < 0) || (y >= _height)) return;
SPI_BEGIN_TRANSACTION
// SPI_BEGIN_TRANSACTION
SPI_CS_LOW
// SPI_CS_LOW
setAddrWindow_int(x, y, 1, 1);
// setAddrWindow_int(x, y, 1, 1);
WriteColor(color);
// WriteColor(color);
SPI_CS_HIGH
// SPI_CS_HIGH
SPI_END_TRANSACTION
// SPI_END_TRANSACTION
}
void uDisplay_lvgl::writePixels(int16_t x, int16_t y, int16_t w, int16_t h,
@ -1028,14 +841,14 @@ void uDisplay_lvgl::setRotation(uint8_t rotation) {
cur_rot = rotation;
if (interface != _UDSP_SPI) {
Renderer::setRotation(cur_rot);
// Renderer::setRotation(cur_rot);
return;
}
if (interface == _UDSP_SPI) {
if (ep_mode) {
Renderer::setRotation(cur_rot);
// Renderer::setRotation(cur_rot);
return;
}
SPI_BEGIN_TRANSACTION
@ -1111,7 +924,7 @@ void uDisplay_lvgl::DisplayOnff(int8_t on) {
}
}
void uDisplay_lvgl::invertDisplay(boolean i) {
void uDisplay_lvgl::invertDisplay(bool i) {
if (ep_mode) {
return;

View File

@ -1,8 +1,6 @@
#ifndef _UDISP_LVGL_
#define _UDISP_LVGL_
#include <Adafruit_GFX.h>
#include <renderer.h>
#include <Wire.h>
#include <SPI.h>
@ -60,7 +58,7 @@ enum uColorType { uCOLOR_BW, uCOLOR_COLOR };
#define ESP32_PWM_CHANNEL 1
class uDisplay_lvgl : public Renderer {
class uDisplay_lvgl {
public:
uDisplay_lvgl(char *);
void Init(void);
@ -74,11 +72,13 @@ class uDisplay_lvgl : public Renderer {
void dim(uint8_t dim);
uint16_t GetColorFromIndex(uint8_t index);
void setRotation(uint8_t m);
void fillScreen(uint16_t color);
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
void pushColors(uint16_t *data, uint16_t len, boolean first);
void pushColors(uint16_t *data, uint16_t len, bool first);
void TS_RotConvert(int16_t *x, int16_t *y);
void invertDisplay(boolean i);
void invertDisplay(bool i);
inline int32_t width(void) const { return gxs; }
inline int32_t height(void) const { return gys; }
inline uint8_t getRotation(void) const { return cur_rot; }
public:
void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
@ -86,8 +86,6 @@ class uDisplay_lvgl : public Renderer {
uint16_t *colors, uint32_t len);
private:
void drawPixel(int16_t x, int16_t y, uint16_t color);
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
uint32_t str2c(char **sp, char *vp, uint32_t len);
void i2c_command(uint8_t val);
void spi_command(uint8_t val);
@ -144,8 +142,8 @@ class uDisplay_lvgl : public Renderer {
// uint16_t splash_yp;
// uint16_t fg_col;
// uint16_t bg_col;
uint16_t gxs;
uint16_t gys;
uint16_t gxs, _width;
uint16_t gys, _height;
int8_t spi_cs;
int8_t spi_clk;
int8_t spi_mosi;

View File

@ -22,9 +22,10 @@
#ifdef USE_LVGL
#include <berry.h>
#include "lvgl.h"
#include "Adafruit_LvGL_Glue.h"
extern Adafruit_LvGL_Glue * glue;
/********************************************************************
* Generated code, don't edit
@ -502,6 +503,29 @@ extern "C" {
be_pushnstring(vm, s, strlen(s)); /* make escape string from buffer */
be_return(vm);
}
/*********************************************************************************************\
* Screenshot in raw format
\********************************************************************************************/
int lv0_screenshot(bvm *vm);
int lv0_screenshot(bvm *vm) {
if (!glue) { be_return_nil(vm); }
char fname[32];
snprintf(fname, sizeof(fname), "/screenshot-%d.raw", Rtc.utc_time);
File f = dfsp->open(fname, "w");
if (f) {
glue->setScreenshotFile(&f);
// redraw screen
lv_obj_invalidate(lv_scr_act());
lv_refr_now(lv_disp_get_default());
glue->stopScreenshot();
f.close();
}
be_pushstring(vm, fname);
be_return(vm);
}
}
#include "lvgl_berry/be_lv_c_mapping.h"

View File

@ -20,7 +20,6 @@
#ifdef USE_LVGL
#include <Adafruit_SPITFT.h>
#include <uDisplay_lvgl.h>
#include "lvgl.h"
@ -257,8 +256,8 @@ void start_lvgl(const char * uconfig) {
udisp->Init();
Settings.display_width = udisp->width();
Settings.display_height = udisp->height();
// Settings.display_width = udisp->width();
// Settings.display_height = udisp->height();
udisp->DisplayInit(0 /* DISPLAY_INIT_MODE */, Settings.display_size, Settings.display_rotate, Settings.display_font);
udisp->dim(Settings.display_dimmer);
@ -269,7 +268,7 @@ void start_lvgl(const char * uconfig) {
glue = new Adafruit_LvGL_Glue();
// Initialize glue, passing in address of display & touchscreen
LvGLStatus status = glue->begin(udisp, (TouchScreen*)nullptr);
LvGLStatus status = glue->begin(udisp);
if (status != LVGL_OK) {
AddLog(LOG_LEVEL_ERROR, PSTR("Glue error %d"), status);
return;

View File

@ -144,35 +144,6 @@ with open(in_file) as f:
break
if found: continue
# if func_name.startswith("lv_obj_"):
# c_func_name = "lvo_" + re.sub('^lv_obj_', '', func_name)
# lvo.append( [ c_func_name, c_ret, c_args, func_name ] )
# elif func_name.startswith("lv_label_"):
# c_func_name = "lvo_label_" + re.sub('^lv_label_', '', func_name)
# lvo.append( [ c_func_name, c_ret, c_args, func_name ] )
# elif func_name.startswith("lv_group_"):
# c_func_name = "lvg_" + re.sub('^lv_group_', '', func_name)
# lvg.append( [ c_func_name, c_ret, c_args, func_name ] )
# elif func_name.startswith("lv_arc_"):
# c_func_name = "lvg_" + re.sub('^lv_arc_', '', func_name)
# lvg.append( [ c_func_name, c_ret, c_args, func_name ] )
# if func_name.startswith("lv_style_"):
# if func_name == "lv_style_init": continue # no need for init as it would collied with native init (and called behind the scene anyways)
# be_name = re.sub('^lv_style_', '', func_name)
# c_func_name = "lvs_" + be_name
# lvs.append( [ c_func_name, c_ret, c_args, func_name, be_name ] )
# else:
# pass # ignore for now
# # be_name = re.sub('^lv_', '', func_name)
# # c_func_name = "lvbe0_" + be_name
# # lv0.append( [ c_func_name, c_ret, c_args, func_name, be_name ] )
with open(module_file) as f:
@ -305,6 +276,7 @@ extern int lv0_layer_top(bvm *vm);
extern int lv0_layer_sys(bvm *vm);
extern int lv0_get_hor_res(bvm *vm);
extern int lv0_get_ver_res(bvm *vm);
extern int lv0_screenshot(bvm *vm);
extern int lco_init(bvm *vm);
extern int lco_tostring(bvm *vm);
@ -410,34 +382,6 @@ print("""
sys.stdout.close()
# for f in lvo:
# c_func_name = f[0]
# print(f"extern int {c_func_name}(bvm *vm);")
# print("/********************************************************************/")
# print()
# print("/********************************************************************")
# print(" * Generated code, don't edit")
# print(" *******************************************************************/")
# print("/* `lv_object` methods */")
# print()
# for f in lvo:
# c_func_name = f[0]
# berry_name = c_func_name
# berry_name = re.sub('^lvo_label_', '', berry_name)
# berry_name = re.sub('^lvo_', '', berry_name)
# print(f" {{ \"{berry_name}\", {c_func_name} }},")
# print("/********************************************************************/")
# print()
sys.stdout = open(lvgl_prefix + be_lv_lvgl_module, 'w')
print("/********************************************************************")
print(" * Generated code, don't edit")
@ -462,6 +406,7 @@ extern int lv0_layer_top(bvm *vm);
extern int lv0_layer_sys(bvm *vm);
extern int lv0_get_hor_res(bvm *vm);
extern int lv0_get_ver_res(bvm *vm);
extern int lv0_screenshot(bvm *vm);
""")
for f in lv0:
@ -578,6 +523,7 @@ print("""
be_native_module_function("layer_sys", lv0_layer_sys),
be_native_module_function("get_hor_res", lv0_get_hor_res),
be_native_module_function("get_ver_res", lv0_get_ver_res),
be_native_module_function("screenshot", lv0_screenshot),
""")
for f in lv0:
@ -744,6 +690,7 @@ print("""
layer_sys, func(lv0_layer_sys)
get_hor_res, func(lv0_get_hor_res)
get_ver_res, func(lv0_get_ver_res)
screenshot, func(lv0_screenshot)
""")
@ -765,115 +712,3 @@ print("""
print("/********************************************************************/")
sys.stdout.close()
# print("/********************************************************************")
# print(" * Generated code, don't edit")
# print(" *******************************************************************/")
# print("/* `lv_group external functions definitions */")
# print()
# for f in lvg:
# c_func_name = f[0]
# print(f"extern int {c_func_name}(bvm *vm);")
# print("/********************************************************************/")
# print()
# print("/********************************************************************")
# print(" * Generated code, don't edit")
# print(" *******************************************************************/")
# print("/* `lv_group` methods */")
# print()
# for f in lvg:
# c_func_name = f[0]
# berry_name = c_func_name
# berry_name = re.sub('^lvg_', '', berry_name)
# print(f" {{ \"{berry_name}\", {c_func_name} }},")
# print("/********************************************************************/")
# print()
# print("/********************************************************************")
# print(" * Generated code, don't edit")
# print(" *******************************************************************/")
# print("/* `lv_style methods */")
# print()
# for f in lvs:
# c_func_name = f[0]
# c_ret_type = f[1]
# c_argc = f[2]
# if c_argc is not None: c_argc = "\"" + c_argc + "\""
# orig_func_name = f[3]
# #print(f" int {c_func_name}(bvm *vm) \{ return (vm, be_call_c_func(void*) &")
# print(f" int {c_func_name}(bvm *vm) {{ return be_call_c_func(vm, (void*) &{orig_func_name}, \"{c_ret_type}\", { c_argc if c_argc else 'nullptr'}); }}")
# print("/********************************************************************/")
# print()
# print("/********************************************************************")
# print(" * Generated code, don't edit")
# print(" *******************************************************************/")
# print("/* `lv_style external functions definitions */")
# print()
# for f in lvs:
# c_func_name = f[0]
# print(f"extern int {c_func_name}(bvm *vm);")
# print("/********************************************************************/")
# print()
# print("/********************************************************************")
# print(" * Generated code, don't edit")
# print(" *******************************************************************/")
# print("/* `lv_style` methods */")
# print()
# for f in lvs:
# c_func_name = f[0]
# berry_name = c_func_name
# berry_name = re.sub('^lvs_', '', berry_name)
# print(f" {{ \"{berry_name}\", {c_func_name} }},")
# print("/********************************************************************/")
# print()
# print("/********************************************************************")
# print(" * Generated code, don't edit")
# print(" *******************************************************************/")
# print("/* `lvgl` functions */")
# print()
# for f in lv:
# c_func_name = f[0]
# c_ret_type = f[1]
# c_argc = f[2]
# if c_argc is not None: c_argc = "\"" + c_argc + "\""
# orig_func_name = f[3]
# #print(f" int {c_func_name}(bvm *vm) \{ return (vm, be_call_c_func(void*) &")
# print(f" int {c_func_name}(bvm *vm) {{ return be_call_c_func(vm, (void*) &{orig_func_name}, \"{c_ret_type}\", { c_argc if c_argc else 'nullptr'}); }}")
# print("/********************************************************************/")
# print()
#int lv0_label_create(bvm *vm) { return be_call_c_func(vm, (void*) &lv_label_create, LV_OBJ_CLASS); }
#print(lvo)