lv_conf.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. /**
  2. * @file lv_conf.h
  3. * Configuration file for v7.11.0
  4. */
  5. /*
  6. * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER
  7. */
  8. #if 1 /*Set it to "1" to enable content*/
  9. #ifndef LV_CONF_H
  10. #define LV_CONF_H
  11. /* clang-format off */
  12. #include <stdint.h>
  13. #include "luat_conf_bsp.h"
  14. /*====================
  15. Graphical settings
  16. *====================*/
  17. /* Maximal horizontal and vertical resolution to support by the library.*/
  18. #ifndef LV_HOR_RES_MAX
  19. #define LV_HOR_RES_MAX (1024)
  20. #define LV_VER_RES_MAX (600)
  21. #endif
  22. /* Color depth:
  23. * - 1: 1 byte per pixel
  24. * - 8: RGB332
  25. * - 16: RGB565
  26. * - 32: ARGB8888
  27. */
  28. #ifndef LV_COLOR_DEPTH
  29. #define LV_COLOR_DEPTH 32
  30. #endif
  31. /* Swap the 2 bytes of RGB565 color.
  32. * Useful if the display has a 8 bit interface (e.g. SPI)*/
  33. #ifndef LV_COLOR_16_SWAP
  34. #define LV_COLOR_16_SWAP 0
  35. #endif
  36. /* 1: Enable screen transparency.
  37. * Useful for OSD or other overlapping GUIs.
  38. * Requires `LV_COLOR_DEPTH = 32` colors and the screen's style should be modified: `style.body.opa = ...`*/
  39. #define LV_COLOR_SCREEN_TRANSP 0
  40. /*Images pixels with this color will not be drawn (with chroma keying)*/
  41. #define LV_COLOR_TRANSP LV_COLOR_LIME /*LV_COLOR_LIME: pure green*/
  42. /* Enable anti-aliasing (lines, and radiuses will be smoothed) */
  43. #define LV_ANTIALIAS 1
  44. /* Default display refresh period.
  45. * Can be changed in the display driver (`lv_disp_drv_t`).*/
  46. #ifndef LV_DISP_DEF_REFR_PERIOD
  47. #define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
  48. #endif
  49. extern unsigned int g_lvgl_flash_time;
  50. /* Dot Per Inch: used to initialize default sizes.
  51. * E.g. a button with width = LV_DPI / 2 -> half inch wide
  52. * (Not so important, you can adjust it to modify default sizes and spaces)*/
  53. #ifndef LV_DPI
  54. #define LV_DPI 130 /*[px]*/
  55. #endif
  56. /* The the real width of the display changes some default values:
  57. * default object sizes, layout of examples, etc.
  58. * According to the width of the display (hor. res. / dpi)
  59. * the displays fall in 4 categories.
  60. * The 4th is extra large which has no upper limit so not listed here
  61. * The upper limit of the categories are set below in 0.1 inch unit.
  62. */
  63. #define LV_DISP_SMALL_LIMIT 30
  64. #define LV_DISP_MEDIUM_LIMIT 50
  65. #define LV_DISP_LARGE_LIMIT 70
  66. /* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
  67. typedef int16_t lv_coord_t;
  68. /* Maximum buffer size to allocate for rotation. Only used if software rotation is enabled. */
  69. #define LV_DISP_ROT_MAX_BUF (10U * 1024U)
  70. /*=========================
  71. Memory manager settings
  72. *=========================*/
  73. /* LittelvGL's internal memory manager's settings.
  74. * The graphical objects and other related data are stored here. */
  75. /* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
  76. #ifndef LV_MEM_CUSTOM
  77. #define LV_MEM_CUSTOM 0
  78. #endif
  79. #if LV_MEM_CUSTOM == 0
  80. /* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
  81. #ifndef LV_MEM_SIZE
  82. # define LV_MEM_SIZE (32U * 1024U)
  83. #endif
  84. /* Compiler prefix for a big array declaration */
  85. #ifndef LV_MEM_ATTR
  86. # define LV_MEM_ATTR
  87. #endif
  88. /* Set an address for the memory pool instead of allocating it as an array.
  89. * Can be in external SRAM too. */
  90. #ifndef LV_MEM_ADR
  91. # define LV_MEM_ADR 0
  92. #endif
  93. /* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
  94. # define LV_MEM_AUTO_DEFRAG 1
  95. #else /*LV_MEM_CUSTOM*/
  96. # define LV_MEM_CUSTOM_INCLUDE "luat_malloc.h" /*Header for the dynamic memory function*/
  97. # define LV_MEM_CUSTOM_ALLOC luat_heap_malloc /*Wrapper to malloc*/
  98. # define LV_MEM_CUSTOM_FREE luat_heap_free /*Wrapper to free*/
  99. // TODO 启用luat_lvgl_mem 和 LV_ENABLE_GC
  100. // # define LV_MEM_CUSTOM_INCLUDE "luat_lvgl_mem.h" /*Header for the dynamic memory function*/
  101. // # define LV_MEM_CUSTOM_ALLOC luat_lvgl_malloc /*Wrapper to malloc*/
  102. // # define LV_MEM_CUSTOM_FREE luat_lvgl_free /*Wrapper to free*/
  103. #endif /*LV_MEM_CUSTOM*/
  104. /* Use the standard memcpy and memset instead of LVGL's own functions.
  105. * The standard functions might or might not be faster depending on their implementation. */
  106. #define LV_MEMCPY_MEMSET_STD 0
  107. /* Garbage Collector settings
  108. * Used if lvgl is binded to higher level language and the memory is managed by that language */
  109. #define LV_ENABLE_GC 0
  110. #if LV_ENABLE_GC != 0
  111. # define LV_GC_INCLUDE "luat_lvgl_mem.h" /*Include Garbage Collector related things*/
  112. # define LV_MEM_CUSTOM_REALLOC luat_lvgl_realloc /*Wrapper to realloc*/
  113. # define LV_MEM_CUSTOM_GET_SIZE luat_lvgl_mem_get_size /*Wrapper to lv_mem_get_size*/
  114. #endif /* LV_ENABLE_GC */
  115. /*=======================
  116. Input device settings
  117. *=======================*/
  118. /* Input device default settings.
  119. * Can be changed in the Input device driver (`lv_indev_drv_t`)*/
  120. /* Input device read period in milliseconds */
  121. #define LV_INDEV_DEF_READ_PERIOD 30
  122. /* Drag threshold in pixels */
  123. #define LV_INDEV_DEF_DRAG_LIMIT 10
  124. /* Drag throw slow-down in [%]. Greater value -> faster slow-down */
  125. #define LV_INDEV_DEF_DRAG_THROW 10
  126. /* Long press time in milliseconds.
  127. * Time to send `LV_EVENT_LONG_PRESSED`) */
  128. #define LV_INDEV_DEF_LONG_PRESS_TIME 400
  129. /* Repeated trigger period in long press [ms]
  130. * Time between `LV_EVENT_LONG_PRESSED_REPEAT */
  131. #define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100
  132. /* Gesture threshold in pixels */
  133. #define LV_INDEV_DEF_GESTURE_LIMIT 50
  134. /* Gesture min velocity at release before swipe (pixels)*/
  135. #define LV_INDEV_DEF_GESTURE_MIN_VELOCITY 3
  136. /*==================
  137. * Feature usage
  138. *==================*/
  139. /*1: Enable the Animations */
  140. #define LV_USE_ANIMATION 1
  141. #if LV_USE_ANIMATION
  142. /*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
  143. typedef struct lv_anim_mydata {
  144. int exec_cb_ref;
  145. int ready_cb_ref;
  146. void* obj;
  147. }lv_anim_mydata_t;
  148. typedef lv_anim_mydata_t lv_anim_user_data_t;
  149. #endif
  150. /* 1: Enable shadow drawing on rectangles*/
  151. #define LV_USE_SHADOW 0
  152. #if LV_USE_SHADOW
  153. /* Allow buffering some shadow calculation
  154. * LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer,
  155. * where shadow size is `shadow_width + radius`
  156. * Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
  157. #define LV_SHADOW_CACHE_SIZE 0
  158. #endif
  159. /*1: enable outline drawing on rectangles*/
  160. #define LV_USE_OUTLINE 1
  161. /*1: enable pattern drawing on rectangles*/
  162. #define LV_USE_PATTERN 1
  163. /*1: enable value string drawing on rectangles*/
  164. #define LV_USE_VALUE_STR 1
  165. /* 1: Use other blend modes than normal (`LV_BLEND_MODE_...`)*/
  166. #define LV_USE_BLEND_MODES 1
  167. /* 1: Use the `opa_scale` style property to set the opacity of an object and its children at once*/
  168. #define LV_USE_OPA_SCALE 1
  169. /* 1: Use image zoom and rotation*/
  170. #define LV_USE_IMG_TRANSFORM 1
  171. /* 1: Enable object groups (for keyboard/encoder navigation) */
  172. #define LV_USE_GROUP 1
  173. #if LV_USE_GROUP
  174. typedef void * lv_group_user_data_t;
  175. #endif /*LV_USE_GROUP*/
  176. /* 1: Enable GPU interface*/
  177. #define LV_USE_GPU 0 /*Only enables `gpu_fill_cb` and `gpu_blend_cb` in the disp. drv- */
  178. #define LV_USE_GPU_STM32_DMA2D 0
  179. /*If enabling LV_USE_GPU_STM32_DMA2D, LV_GPU_DMA2D_CMSIS_INCLUDE must be defined to include path of CMSIS header of target processor
  180. e.g. "stm32f769xx.h" or "stm32f429xx.h" */
  181. #define LV_GPU_DMA2D_CMSIS_INCLUDE
  182. /*1: Use PXP for CPU off-load on NXP RTxxx platforms */
  183. #define LV_USE_GPU_NXP_PXP 0
  184. /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
  185. * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
  186. * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
  187. *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
  188. * */
  189. #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
  190. /*1: Use VG-Lite for CPU offload on NXP RTxxx platforms */
  191. #define LV_USE_GPU_NXP_VG_LITE 0
  192. /* 1: Enable file system (might be required for images */
  193. #define LV_USE_FILESYSTEM 1
  194. #if LV_USE_FILESYSTEM
  195. /*Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`)*/
  196. typedef void * lv_fs_drv_user_data_t;
  197. #endif
  198. /*1: Add a `user_data` to drivers and objects*/
  199. #define LV_USE_USER_DATA 1
  200. /*1: Show CPU usage and FPS count in the right bottom corner*/
  201. #ifndef LV_USE_PERF_MONITOR
  202. #define LV_USE_PERF_MONITOR 0
  203. #endif
  204. /*1: Use the functions and types from the older API if possible */
  205. #define LV_USE_API_EXTENSION_V6 0
  206. #define LV_USE_API_EXTENSION_V7 1
  207. /*========================
  208. * Image decoder and cache
  209. *========================*/
  210. /* 1: Enable indexed (palette) images */
  211. #define LV_IMG_CF_INDEXED 1
  212. /* 1: Enable alpha indexed images */
  213. #define LV_IMG_CF_ALPHA 1
  214. /* Default image cache size. Image caching keeps the images opened.
  215. * If only the built-in image formats are used there is no real advantage of caching.
  216. * (I.e. no new image decoder is added)
  217. * With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
  218. * However the opened images might consume additional RAM.
  219. * Set it to 0 to disable caching */
  220. #ifndef LV_IMG_CACHE_DEF_SIZE
  221. #define LV_IMG_CACHE_DEF_SIZE 1
  222. #endif
  223. /*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
  224. typedef void * lv_img_decoder_user_data_t;
  225. /*=====================
  226. * Compiler settings
  227. *====================*/
  228. /* For big endian systems set to 1 */
  229. #define LV_BIG_ENDIAN_SYSTEM 0
  230. /* Define a custom attribute to `lv_tick_inc` function */
  231. #define LV_ATTRIBUTE_TICK_INC
  232. /* Define a custom attribute to `lv_task_handler` function */
  233. #define LV_ATTRIBUTE_TASK_HANDLER
  234. /* Define a custom attribute to `lv_disp_flush_ready` function */
  235. #define LV_ATTRIBUTE_FLUSH_READY
  236. /* Required alignment size for buffers */
  237. #define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4
  238. /* With size optimization (-Os) the compiler might not align data to
  239. * 4 or 8 byte boundary. Some HW may need even 32 or 64 bytes.
  240. * This alignment will be explicitly applied where needed.
  241. * LV_ATTRIBUTE_MEM_ALIGN_SIZE should be used to specify required align size.
  242. * E.g. __attribute__((aligned(LV_ATTRIBUTE_MEM_ALIGN_SIZE))) */
  243. #define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(LV_ATTRIBUTE_MEM_ALIGN_SIZE)))
  244. /* Attribute to mark large constant arrays for example
  245. * font's bitmaps */
  246. #define LV_ATTRIBUTE_LARGE_CONST
  247. /* Prefix performance critical functions to place them into a faster memory (e.g RAM)
  248. * Uses 15-20 kB extra memory */
  249. #ifndef LV_ATTRIBUTE_FAST_MEM
  250. #define LV_ATTRIBUTE_FAST_MEM
  251. #endif
  252. /* Export integer constant to binding.
  253. * This macro is used with constants in the form of LV_<CONST> that
  254. * should also appear on lvgl binding API such as Micropython
  255. *
  256. * The default value just prevents a GCC warning.
  257. */
  258. #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning
  259. /* Prefix variables that are used in GPU accelerated operations, often these need to be
  260. * placed in RAM sections that are DMA accessible */
  261. #define LV_ATTRIBUTE_DMA
  262. /*===================
  263. * HAL settings
  264. *==================*/
  265. /* 1: use a custom tick source.
  266. * It removes the need to manually update the tick with `lv_tick_inc`) */
  267. #ifndef LV_TICK_CUSTOM
  268. #define LV_TICK_CUSTOM 1
  269. #endif
  270. #if LV_TICK_CUSTOM == 1
  271. #ifndef LV_TICK_CUSTOM_INCLUDE
  272. #define LV_TICK_CUSTOM_INCLUDE "luat_mcu.h" /*Header for the system time function*/
  273. #define LV_TICK_CUSTOM_SYS_TIME_EXPR (luat_mcu_tick64_ms()) /*Expression evaluating to current system time in ms*/
  274. #endif
  275. #endif /*LV_TICK_CUSTOM*/
  276. typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/
  277. typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/
  278. /*================
  279. * Log settings
  280. *===============*/
  281. /*1: Enable the log module*/
  282. #ifndef LV_USE_LOG
  283. #define LV_USE_LOG 0
  284. #endif
  285. #if LV_USE_LOG
  286. /* How important log should be added:
  287. * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
  288. * LV_LOG_LEVEL_INFO Log important events
  289. * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
  290. * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
  291. * LV_LOG_LEVEL_NONE Do not log anything
  292. */
  293. # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
  294. /* 1: Print the log with 'printf';
  295. * 0: user need to register a callback with `lv_log_register_print_cb`*/
  296. # define LV_LOG_PRINTF 0
  297. #endif /*LV_USE_LOG*/
  298. /*=================
  299. * Debug settings
  300. *================*/
  301. /* If Debug is enabled LittelvGL validates the parameters of the functions.
  302. * If an invalid parameter is found an error log message is printed and
  303. * the MCU halts at the error. (`LV_USE_LOG` should be enabled)
  304. * If you are debugging the MCU you can pause
  305. * the debugger to see exactly where the issue is.
  306. *
  307. * The behavior of asserts can be overwritten by redefining them here.
  308. * E.g. #define LV_ASSERT_MEM(p) <my_assert_code>
  309. */
  310. #define LV_USE_DEBUG 0
  311. #if LV_USE_DEBUG
  312. /*Check if the parameter is NULL. (Quite fast) */
  313. #define LV_USE_ASSERT_NULL 1
  314. /*Checks is the memory is successfully allocated or no. (Quite fast)*/
  315. #define LV_USE_ASSERT_MEM 1
  316. /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
  317. #define LV_USE_ASSERT_MEM_INTEGRITY 0
  318. /* Check the strings.
  319. * Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)
  320. * If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
  321. #define LV_USE_ASSERT_STR 0
  322. /* Check NULL, the object's type and existence (e.g. not deleted). (Quite slow)
  323. * If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
  324. #define LV_USE_ASSERT_OBJ 0
  325. /*Check if the styles are properly initialized. (Fast)*/
  326. #define LV_USE_ASSERT_STYLE 0
  327. #endif /*LV_USE_DEBUG*/
  328. /*==================
  329. * FONT USAGE
  330. *===================*/
  331. /* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
  332. * The symbols are available via `LV_SYMBOL_...` defines
  333. * More info about fonts: https://docs.lvgl.io/v7/en/html/overview/font.html
  334. * To create a new font go to: https://lvgl.com/ttf-font-to-c-array
  335. */
  336. /* Montserrat fonts with bpp = 4
  337. * https://fonts.google.com/specimen/Montserrat */
  338. #define LV_FONT_MONTSERRAT_8 0
  339. #define LV_FONT_MONTSERRAT_10 0
  340. #define LV_FONT_MONTSERRAT_12 0
  341. #define LV_FONT_MONTSERRAT_14 1
  342. #define LV_FONT_MONTSERRAT_16 0
  343. #define LV_FONT_MONTSERRAT_18 0
  344. #define LV_FONT_MONTSERRAT_20 0
  345. #define LV_FONT_MONTSERRAT_22 0
  346. #define LV_FONT_MONTSERRAT_24 0
  347. #define LV_FONT_MONTSERRAT_26 0
  348. #define LV_FONT_MONTSERRAT_28 0
  349. #define LV_FONT_MONTSERRAT_30 0
  350. #define LV_FONT_MONTSERRAT_32 0
  351. #define LV_FONT_MONTSERRAT_34 0
  352. #define LV_FONT_MONTSERRAT_36 0
  353. #define LV_FONT_MONTSERRAT_38 0
  354. #define LV_FONT_MONTSERRAT_40 0
  355. #define LV_FONT_MONTSERRAT_42 0
  356. #define LV_FONT_MONTSERRAT_44 0
  357. #define LV_FONT_MONTSERRAT_46 0
  358. #define LV_FONT_MONTSERRAT_48 0
  359. /* Demonstrate special features */
  360. #define LV_FONT_MONTSERRAT_12_SUBPX 0
  361. #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
  362. #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, PErisan letters and all their forms*/
  363. #define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
  364. /*Pixel perfect monospace font
  365. * http://pelulamu.net/unscii/ */
  366. #define LV_FONT_UNSCII_8 0
  367. #define LV_FONT_UNSCII_16 0
  368. /* Optionally declare your custom fonts here.
  369. * You can use these fonts as default font too
  370. * and they will be available globally. E.g.
  371. * #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \
  372. * LV_FONT_DECLARE(my_font_2)
  373. */
  374. #define LV_FONT_CUSTOM_DECLARE
  375. /* Enable it if you have fonts with a lot of characters.
  376. * The limit depends on the font size, font face and bpp
  377. * but with > 10,000 characters if you see issues probably you need to enable it.*/
  378. #define LV_FONT_FMT_TXT_LARGE 1
  379. /* Enables/disables support for compressed fonts. If it's disabled, compressed
  380. * glyphs cannot be processed by the library and won't be rendered.
  381. */
  382. #define LV_USE_FONT_COMPRESSED 1
  383. /* Enable subpixel rendering */
  384. #define LV_USE_FONT_SUBPX 0
  385. #if LV_USE_FONT_SUBPX
  386. /* Set the pixel order of the display.
  387. * Important only if "subpx fonts" are used.
  388. * With "normal" font it doesn't matter.
  389. */
  390. #define LV_FONT_SUBPX_BGR 0
  391. #endif
  392. /*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
  393. typedef void * lv_font_user_data_t;
  394. /*================
  395. * THEME USAGE
  396. *================*/
  397. /*Always enable at least on theme*/
  398. /* No theme, you can apply your styles as you need
  399. * No flags. Set LV_THEME_DEFAULT_FLAG 0 */
  400. #define LV_USE_THEME_EMPTY 1
  401. /*Simple to the create your theme based on it
  402. * No flags. Set LV_THEME_DEFAULT_FLAG 0 */
  403. #define LV_USE_THEME_TEMPLATE 1
  404. /* A fast and impressive theme.
  405. * Flags:
  406. * LV_THEME_MATERIAL_FLAG_LIGHT: light theme
  407. * LV_THEME_MATERIAL_FLAG_DARK: dark theme
  408. * LV_THEME_MATERIAL_FLAG_NO_TRANSITION: disable transitions (state change animations)
  409. * LV_THEME_MATERIAL_FLAG_NO_FOCUS: disable indication of focused state)
  410. * */
  411. #define LV_USE_THEME_MATERIAL 1
  412. /* Mono-color theme for monochrome displays.
  413. * If LV_THEME_DEFAULT_COLOR_PRIMARY is LV_COLOR_BLACK the
  414. * texts and borders will be black and the background will be
  415. * white. Else the colors are inverted.
  416. * No flags. Set LV_THEME_DEFAULT_FLAG 0 */
  417. #define LV_USE_THEME_MONO 1
  418. #define LV_THEME_DEFAULT_INCLUDE <stdint.h> /*Include a header for the init. function*/
  419. #define LV_THEME_DEFAULT_INIT lv_theme_material_init
  420. #define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(0x01a2b1)
  421. #define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(0x44d1b6)
  422. #define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT
  423. #ifndef LV_THEME_DEFAULT_FONT_SMALL
  424. #if defined(LV_FONT_OPPOSANS_M_14)
  425. #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_opposans_m_14
  426. #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_opposans_m_14
  427. #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_opposans_m_14
  428. #define LV_THEME_DEFAULT_FONT_TITLE &lv_font_opposans_m_14
  429. #elif defined(LV_FONT_OPPOSANS_M_16)
  430. #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_opposans_m_16
  431. #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_opposans_m_16
  432. #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_opposans_m_16
  433. #define LV_THEME_DEFAULT_FONT_TITLE &lv_font_opposans_m_16
  434. #elif defined(LV_FONT_OPPOSANS_M_12)
  435. #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_opposans_m_12
  436. #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_opposans_m_12
  437. #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_opposans_m_12
  438. #define LV_THEME_DEFAULT_FONT_TITLE &lv_font_opposans_m_12
  439. #else
  440. #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_14
  441. #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_14
  442. #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_14
  443. #define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_14
  444. #endif
  445. #else
  446. #endif
  447. /*=================
  448. * Text settings
  449. *=================*/
  450. /* Select a character encoding for strings.
  451. * Your IDE or editor should have the same character encoding
  452. * - LV_TXT_ENC_UTF8
  453. * - LV_TXT_ENC_ASCII
  454. * */
  455. #define LV_TXT_ENC LV_TXT_ENC_UTF8
  456. /*Can break (wrap) texts on these chars*/
  457. #define LV_TXT_BREAK_CHARS " ,.;:-_"
  458. /* If a word is at least this long, will break wherever "prettiest"
  459. * To disable, set to a value <= 0 */
  460. #define LV_TXT_LINE_BREAK_LONG_LEN 0
  461. /* Minimum number of characters in a long word to put on a line before a break.
  462. * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
  463. #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
  464. /* Minimum number of characters in a long word to put on a line after a break.
  465. * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
  466. #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
  467. /* The control character to use for signalling text recoloring. */
  468. #define LV_TXT_COLOR_CMD "#"
  469. /* Support bidirectional texts.
  470. * Allows mixing Left-to-Right and Right-to-Left texts.
  471. * The direction will be processed according to the Unicode Bidirectional Algorithm:
  472. * https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
  473. #define LV_USE_BIDI 0
  474. #if LV_USE_BIDI
  475. /* Set the default direction. Supported values:
  476. * `LV_BIDI_DIR_LTR` Left-to-Right
  477. * `LV_BIDI_DIR_RTL` Right-to-Left
  478. * `LV_BIDI_DIR_AUTO` detect texts base direction */
  479. #define LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO
  480. #endif
  481. /* Enable Arabic/Persian processing
  482. * In these languages characters should be replaced with
  483. * an other form based on their position in the text */
  484. #define LV_USE_ARABIC_PERSIAN_CHARS 0
  485. /*Change the built in (v)snprintf functions*/
  486. #define LV_SPRINTF_CUSTOM 0
  487. #if LV_SPRINTF_CUSTOM
  488. # define LV_SPRINTF_INCLUDE <stdio.h>
  489. # define lv_snprintf snprintf
  490. # define lv_vsnprintf vsnprintf
  491. #else /*!LV_SPRINTF_CUSTOM*/
  492. # define LV_SPRINTF_DISABLE_FLOAT 1
  493. #endif /*LV_SPRINTF_CUSTOM*/
  494. /*===================
  495. * LV_OBJ SETTINGS
  496. *==================*/
  497. #if LV_USE_USER_DATA
  498. /*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
  499. typedef struct luat_lv_userdata {
  500. int event_cb_ref;
  501. int signal_cb_ref;
  502. }luat_lv_userdata_t;
  503. typedef struct luat_lv_userdata lv_obj_user_data_t;
  504. /*Provide a function to free user data*/
  505. #define LV_USE_USER_DATA_FREE 1
  506. #if LV_USE_USER_DATA_FREE
  507. # define LV_USER_DATA_FREE_INCLUDE "luat_lvgl_userdata.h" /*Header for user data free function*/
  508. /* Function prototype : void luat_lv_user_data_free(lv_obj_t * obj); */
  509. # define LV_USER_DATA_FREE (luat_lv_user_data_free) /*Invoking for user data free function*/
  510. #endif
  511. #endif
  512. /*1: enable `lv_obj_realign()` based on `lv_obj_align()` parameters*/
  513. #define LV_USE_OBJ_REALIGN 1
  514. /* Enable to make the object clickable on a larger area.
  515. * LV_EXT_CLICK_AREA_OFF or 0: Disable this feature
  516. * LV_EXT_CLICK_AREA_TINY: The extra area can be adjusted horizontally and vertically (0..255 px)
  517. * LV_EXT_CLICK_AREA_FULL: The extra area can be adjusted in all 4 directions (-32k..+32k px)
  518. */
  519. #define LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_TINY
  520. /*==================
  521. * LV OBJ X USAGE
  522. *================*/
  523. /*
  524. * Documentation of the object types: https://docs.lvgl.com/#Object-types
  525. */
  526. /*Arc (dependencies: -)*/
  527. #define LV_USE_ARC 1
  528. /*Bar (dependencies: -)*/
  529. #define LV_USE_BAR 1
  530. /*Button (dependencies: lv_cont*/
  531. #define LV_USE_BTN 1
  532. /*Button matrix (dependencies: -)*/
  533. #define LV_USE_BTNMATRIX 1
  534. /*Calendar (dependencies: -)*/
  535. #define LV_USE_CALENDAR 1
  536. #if LV_USE_CALENDAR
  537. # define LV_CALENDAR_WEEK_STARTS_MONDAY 0
  538. #endif
  539. /*Canvas (dependencies: lv_img)*/
  540. #define LV_USE_CANVAS 1
  541. /*Check box (dependencies: lv_btn, lv_label)*/
  542. #define LV_USE_CHECKBOX 1
  543. /*Chart (dependencies: -)*/
  544. #define LV_USE_CHART 1
  545. #if LV_USE_CHART
  546. # define LV_CHART_AXIS_TICK_LABEL_MAX_LEN 256
  547. #endif
  548. /*Container (dependencies: -*/
  549. #define LV_USE_CONT 1
  550. /*Color picker (dependencies: -*/
  551. #define LV_USE_CPICKER 1
  552. /*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
  553. #define LV_USE_DROPDOWN 1
  554. #if LV_USE_DROPDOWN != 0
  555. /*Open and close default animation time [ms] (0: no animation)*/
  556. # define LV_DROPDOWN_DEF_ANIM_TIME 200
  557. #endif
  558. /*Gauge (dependencies:lv_bar, lv_linemeter)*/
  559. #define LV_USE_GAUGE 1
  560. /*Image (dependencies: lv_label*/
  561. #define LV_USE_IMG 1
  562. /*Image Button (dependencies: lv_btn*/
  563. #define LV_USE_IMGBTN 1
  564. #if LV_USE_IMGBTN
  565. /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
  566. # define LV_IMGBTN_TILED 0
  567. #endif
  568. /*Keyboard (dependencies: lv_btnm)*/
  569. #define LV_USE_KEYBOARD 1
  570. /*Label (dependencies: -*/
  571. #define LV_USE_LABEL 1
  572. #if LV_USE_LABEL != 0
  573. /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode*/
  574. # define LV_LABEL_DEF_SCROLL_SPEED 25
  575. /* Waiting period at beginning/end of animation cycle */
  576. # define LV_LABEL_WAIT_CHAR_COUNT 3
  577. /*Enable selecting text of the label */
  578. # define LV_LABEL_TEXT_SEL 0
  579. /*Store extra some info in labels (12 bytes) to speed up drawing of very long texts*/
  580. # define LV_LABEL_LONG_TXT_HINT 1
  581. #endif
  582. /*LED (dependencies: -)*/
  583. #define LV_USE_LED 1
  584. #if LV_USE_LED
  585. # define LV_LED_BRIGHT_MIN 120 /*Minimal brightness*/
  586. # define LV_LED_BRIGHT_MAX 255 /*Maximal brightness*/
  587. #endif
  588. /*Line (dependencies: -*/
  589. #define LV_USE_LINE 1
  590. /*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
  591. #define LV_USE_LIST 1
  592. #if LV_USE_LIST != 0
  593. /*Default animation time of focusing to a list element [ms] (0: no animation) */
  594. # define LV_LIST_DEF_ANIM_TIME 100
  595. #endif
  596. /*Line meter (dependencies: *;)*/
  597. #define LV_USE_LINEMETER 1
  598. #if LV_USE_LINEMETER
  599. /* Draw line more precisely at cost of performance.
  600. * Useful if there are lot of lines any minor are visible
  601. * 0: No extra precision
  602. * 1: Some extra precision
  603. * 2: Best precision
  604. */
  605. # define LV_LINEMETER_PRECISE 1
  606. #endif
  607. /*Mask (dependencies: -)*/
  608. #define LV_USE_OBJMASK 1
  609. /*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
  610. #define LV_USE_MSGBOX 1
  611. /*Page (dependencies: lv_cont)*/
  612. #define LV_USE_PAGE 1
  613. #if LV_USE_PAGE != 0
  614. /*Focus default animation time [ms] (0: no animation)*/
  615. # define LV_PAGE_DEF_ANIM_TIME 400
  616. #endif
  617. /*Preload (dependencies: lv_arc, lv_anim)*/
  618. #define LV_USE_SPINNER 1
  619. #if LV_USE_SPINNER != 0
  620. # define LV_SPINNER_DEF_ARC_LENGTH 60 /*[deg]*/
  621. # define LV_SPINNER_DEF_SPIN_TIME 1000 /*[ms]*/
  622. # define LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_SPINNING_ARC
  623. #endif
  624. /*Roller (dependencies: lv_ddlist)*/
  625. #define LV_USE_ROLLER 1
  626. #if LV_USE_ROLLER != 0
  627. /*Focus animation time [ms] (0: no animation)*/
  628. # define LV_ROLLER_DEF_ANIM_TIME 200
  629. /*Number of extra "pages" when the roller is infinite*/
  630. # define LV_ROLLER_INF_PAGES 7
  631. #endif
  632. /*Slider (dependencies: lv_bar)*/
  633. #define LV_USE_SLIDER 1
  634. /*Spinbox (dependencies: lv_ta)*/
  635. #define LV_USE_SPINBOX 1
  636. /*Switch (dependencies: lv_slider)*/
  637. #define LV_USE_SWITCH 1
  638. /*Text area (dependencies: lv_label, lv_page)*/
  639. #define LV_USE_TEXTAREA 1
  640. #if LV_USE_TEXTAREA != 0
  641. # define LV_TEXTAREA_DEF_CURSOR_BLINK_TIME 400 /*ms*/
  642. # define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
  643. #endif
  644. /*Table (dependencies: lv_label)*/
  645. #define LV_USE_TABLE 1
  646. #if LV_USE_TABLE
  647. # define LV_TABLE_COL_MAX 12
  648. # define LV_TABLE_CELL_STYLE_CNT 4
  649. #endif
  650. /*Tab (dependencies: lv_page, lv_btnm)*/
  651. #define LV_USE_TABVIEW 1
  652. # if LV_USE_TABVIEW != 0
  653. /*Time of slide animation [ms] (0: no animation)*/
  654. # define LV_TABVIEW_DEF_ANIM_TIME 300
  655. #endif
  656. /*Tileview (dependencies: lv_page) */
  657. #define LV_USE_TILEVIEW 1
  658. #if LV_USE_TILEVIEW
  659. /*Time of slide animation [ms] (0: no animation)*/
  660. # define LV_TILEVIEW_DEF_ANIM_TIME 300
  661. #endif
  662. /*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
  663. #define LV_USE_WIN 1
  664. #if LV_USE_ANIMATION == 0
  665. #ifdef LV_USE_SPINNER
  666. #undef LV_USE_SPINNER
  667. #endif
  668. #define LV_USE_SPINNER 0
  669. #endif
  670. /*==================
  671. * Non-user section
  672. *==================*/
  673. #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
  674. # define _CRT_SECURE_NO_WARNINGS
  675. #endif
  676. /*--END OF LV_CONF_H--*/
  677. #endif /*LV_CONF_H*/
  678. #endif /*End of "Content enable"*/