125 lines
3.9 KiB
C
125 lines
3.9 KiB
C
/* lv_conf.h for Teensy 4.1 + ST7796S 480x320 + LVGL 9.
|
|
*
|
|
* Minimal config: 16-bit color, partial render, built-in stdlib, no extra
|
|
* widgets/libs we don't need. Keeps flash + RAM usage down.
|
|
*
|
|
* Place this file in the sketch's src/ directory so LVGL's __has_include
|
|
* finds it.
|
|
*/
|
|
#ifndef LV_CONF_H
|
|
#define LV_CONF_H
|
|
|
|
/* Color depth: 16-bit RGB565 (matches the ST7796S) */
|
|
#define LV_COLOR_DEPTH 16
|
|
|
|
/* Resolution */
|
|
#define LV_HOR_RES_MAX 480
|
|
#define LV_VER_RES_MAX 320
|
|
|
|
/* DPI (not critical for a touch UI but LVGL wants it) */
|
|
#define LV_DPI_DEF 130
|
|
|
|
/* Memory: use LVGL's built-in allocator (lv_malloc) */
|
|
#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN
|
|
#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN
|
|
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN
|
|
#define LV_MALLOC(lv_mem) lv_mem_builtin_malloc(lv_mem)
|
|
#define LV_FREE(lv_mem) lv_mem_builtin_free(lv_mem)
|
|
#define LV_REALLOC(lv_mem, new) lv_mem_builtin_realloc(lv_mem, new)
|
|
|
|
/* Memory pool size — the Teensy 4.1 has 512 KB RAM1 (shared between ITCM
|
|
* code and DTCM variables) and 512 KB RAM2 (DMAMEM). LVGL's built-in pool
|
|
* lives in RAM1 (DTCM) by default; keep it small because the secp256k1 +
|
|
* PQClean code also needs RAM1 for ITCM. The draw buffers are in DMAMEM. */
|
|
#define LV_MEM_SIZE (16 * 1024U)
|
|
|
|
/* Tick rate: we call lv_tick_inc(5) in loop(), so 5ms ticks */
|
|
#define LV_DEF_REFR_PERIOD 33 /* ~30 FPS */
|
|
|
|
/* Enable the widgets we use: buttons, labels, keyboard, textarea, list */
|
|
#define LV_USE_BTN 1
|
|
#define LV_USE_LABEL 1
|
|
#define LV_USE_KEYBOARD 1
|
|
#define LV_USE_TEXTAREA 1
|
|
#define LV_USE_LIST 1
|
|
#define LV_USE_MSGBOX 1
|
|
#define LV_USE_BAR 1
|
|
#define LV_USE_SLIDER 0 /* not needed for a signer */
|
|
#define LV_USE_CHECKBOX 0
|
|
#define LV_USE_SWITCH 0
|
|
#define LV_USE_DROPDOWN 0
|
|
#define LV_USE_ROLLER 0
|
|
#define LV_USE_TABLE 0
|
|
#define LV_USE_LED 0
|
|
#define LV_USE_SPINNER 0
|
|
#define LV_USE_CALENDAR 0
|
|
#define LV_USE_CHART 0
|
|
#define LV_USE_CANVAS 0
|
|
#define LV_USE_IMG 0
|
|
#define LV_USE_LINE 1 /* needed by scale + arc; small */
|
|
#define LV_USE_ARC 0
|
|
#define LV_USE_METER 0
|
|
#define LV_USE_SCALE 0 /* not needed, but depends on line if enabled */
|
|
#define LV_USE_SPAN 0
|
|
#define LV_USE_TABVIEW 0
|
|
#define LV_USE_WIN 0
|
|
#define LV_USE_OBJX_TEMPL 0
|
|
|
|
/* Fonts: use the built-in monospace font. The default is 14px; we also
|
|
* enable 16px and 20px for titles. */
|
|
#define LV_FONT_MONTSERRAT_14 1
|
|
#define LV_FONT_MONTSERRAT_16 1
|
|
#define LV_FONT_MONTSERRAT_20 1
|
|
#define LV_FONT_MONTSERRAT_8 0
|
|
#define LV_FONT_MONTSERRAT_10 0
|
|
#define LV_FONT_MONTSERRAT_12 0
|
|
#define LV_FONT_MONTSERRAT_18 0
|
|
#define LV_FONT_MONTSERRAT_22 0
|
|
#define LV_FONT_MONTSERRAT_24 0
|
|
#define LV_FONT_MONTSERRAT_26 0
|
|
#define LV_FONT_MONTSERRAT_28 0
|
|
#define LV_FONT_MONTSERRAT_30 0
|
|
#define LV_FONT_MONTSERRAT_32 0
|
|
#define LV_FONT_MONTSERRAT_34 0
|
|
#define LV_FONT_MONTSERRAT_36 0
|
|
#define LV_FONT_MONTSERRAT_38 0
|
|
#define LV_FONT_MONTSERRAT_40 0
|
|
#define LV_FONT_MONTSERRAT_42 0
|
|
#define LV_FONT_MONTSERRAT_44 0
|
|
#define LV_FONT_MONTSERRAT_46 0
|
|
#define LV_FONT_MONTSERRAT_48 0
|
|
#define LV_FONT_MONTSERRAT_12_SUBPX 0
|
|
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0
|
|
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0
|
|
#define LV_FONT_SIMSUN_16_CJK 0
|
|
#define LV_FONT_UNSCII_8 0
|
|
#define LV_FONT_UNSCII_16 0
|
|
#define LV_FONT_DEFAULT &lv_font_montserrat_14
|
|
|
|
/* Themes: use the default theme (we override colors per-widget anyway) */
|
|
#define LV_USE_THEME_DEFAULT 1
|
|
#define LV_USE_THEME_SIMPLE 0
|
|
#define LV_USE_THEME_MONO 0
|
|
|
|
/* Animations: disable to save CPU + flash (a signer UI is static) */
|
|
#define LV_USE_ANIMIMG 0
|
|
#define LV_USE_DRAW 1
|
|
|
|
/* Log: off in production, on for debugging */
|
|
#define LV_USE_LOG 0
|
|
|
|
/* OS: bare metal (no FreeRTOS — the Teensy Arduino core is single-threaded) */
|
|
#define LV_USE_OS LV_OS_NONE
|
|
|
|
/* Input devices: pointer (touch) */
|
|
#define LV_USE_INDEV 1
|
|
|
|
/* Draw: use the software renderer */
|
|
#define LV_USE_DRAW_SW 1
|
|
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
|
|
|
|
/* Enable LVGL's built-in timer handler */
|
|
#define LV_USE_TIMER 1
|
|
|
|
#endif /* LV_CONF_H */
|