1 /** 2 * @file lv_conf.h 3 * 4 */ 5 6 /* 7 * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER 8 */ 9 10 #if 1 /*Set it to "1" to enable content*/ 11 12 #ifndef LV_CONF_H 13 #define LV_CONF_H 14 /* clang-format off */ 15 16 #include <stdint.h> 17 18 /*==================== 19 Graphical settings 20 *====================*/ 21 22 /* Maximal horizontal and vertical resolution to support by the library.*/ 23 #define LV_HOR_RES_MAX (128) 24 #define LV_VER_RES_MAX (64) 25 26 /* Color depth: 27 * - 1: 1 byte per pixel 28 * - 8: RGB233 29 * - 16: RGB565 30 * - 32: ARGB8888 31 */ 32 #define LV_COLOR_DEPTH 1 33 34 /* Swap the 2 bytes of RGB565 color. 35 * Useful if the display has a 8 bit interface (e.g. SPI)*/ 36 #define LV_COLOR_16_SWAP 0 37 38 /* 1: Enable screen transparency. 39 * Useful for OSD or other overlapping GUIs. 40 * Requires `LV_COLOR_DEPTH = 32` colors and the screen's style should be modified: `style.body.opa = ...`*/ 41 #define LV_COLOR_SCREEN_TRANSP 0 42 43 /*Images pixels with this color will not be drawn (with chroma keying)*/ 44 #define LV_COLOR_TRANSP LV_COLOR_LIME /*LV_COLOR_LIME: pure green*/ 45 46 /* Enable anti-aliasing (lines, and radiuses will be smoothed) */ 47 #define LV_ANTIALIAS 0 48 49 /* Default display refresh period. 50 * Can be changed in the display driver (`lv_disp_drv_t`).*/ 51 #define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ 52 53 /* Dot Per Inch: used to initialize default sizes. 54 * E.g. a button with width = LV_DPI / 2 -> half inch wide 55 * (Not so important, you can adjust it to modify default sizes and spaces)*/ 56 #define LV_DPI 100 /*[px]*/ 57 58 /* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */ 59 typedef int16_t lv_coord_t; 60 61 /*========================= 62 Memory manager settings 63 *=========================*/ 64 65 /* LittelvGL's internal memory manager's settings. 66 * The graphical objects and other related data are stored here. */ 67 68 /* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */ 69 #define LV_MEM_CUSTOM 0 70 #if LV_MEM_CUSTOM == 0 71 /* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ 72 # define LV_MEM_SIZE (3U * 1024U) 73 74 /* Complier prefix for a big array declaration */ 75 # define LV_MEM_ATTR 76 77 /* Set an address for the memory pool instead of allocating it as an array. 78 * Can be in external SRAM too. */ 79 # define LV_MEM_ADR 0 80 81 /* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */ 82 # define LV_MEM_AUTO_DEFRAG 1 83 #else /*LV_MEM_CUSTOM*/ 84 # define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/ 85 # define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/ 86 # define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/ 87 #endif /*LV_MEM_CUSTOM*/ 88 89 /* Garbage Collector settings 90 * Used if lvgl is binded to higher level language and the memory is managed by that language */ 91 #define LV_ENABLE_GC 0 92 #if LV_ENABLE_GC != 0 93 # define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ 94 # define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/ 95 # define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/ 96 #endif /* LV_ENABLE_GC */ 97 98 /*======================= 99 Input device settings 100 *=======================*/ 101 102 /* Input device default settings. 103 * Can be changed in the Input device driver (`lv_indev_drv_t`)*/ 104 105 /* Input device read period in milliseconds */ 106 #define LV_INDEV_DEF_READ_PERIOD 30 107 108 /* Drag threshold in pixels */ 109 #define LV_INDEV_DEF_DRAG_LIMIT 10 110 111 /* Drag throw slow-down in [%]. Greater value -> faster slow-down */ 112 #define LV_INDEV_DEF_DRAG_THROW 20 113 114 /* Long press time in milliseconds. 115 * Time to send `LV_EVENT_LONG_PRESSSED`) */ 116 #define LV_INDEV_DEF_LONG_PRESS_TIME 400 117 118 /* Repeated trigger period in long press [ms] 119 * Time between `LV_EVENT_LONG_PRESSED_REPEAT */ 120 #define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100 121 122 /*================== 123 * Feature usage 124 *==================*/ 125 126 /*1: Enable the Animations */ 127 #define LV_USE_ANIMATION 1 128 #if LV_USE_ANIMATION 129 130 /*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/ 131 typedef void * lv_anim_user_data_t; 132 133 #endif 134 135 /* 1: Enable shadow drawing*/ 136 #define LV_USE_SHADOW 0 137 138 /* 1: Enable object groups (for keyboard/encoder navigation) */ 139 #define LV_USE_GROUP 0 140 #if LV_USE_GROUP 141 typedef void * lv_group_user_data_t; 142 #endif /*LV_USE_GROUP*/ 143 144 /* 1: Enable GPU interface*/ 145 #define LV_USE_GPU 0 146 147 /* 1: Enable file system (might be required for images */ 148 #define LV_USE_FILESYSTEM 0 149 #if LV_USE_FILESYSTEM 150 /*Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`)*/ 151 typedef void * lv_fs_drv_user_data_t; 152 #endif 153 154 /*1: Add a `user_data` to drivers and objects*/ 155 #define LV_USE_USER_DATA 1 156 157 /*======================== 158 * Image decoder and cache 159 *========================*/ 160 161 /* 1: Enable indexed (palette) images */ 162 #define LV_IMG_CF_INDEXED 1 163 164 /* 1: Enable alpha indexed images */ 165 #define LV_IMG_CF_ALPHA 1 166 167 /* Default image cache size. Image caching keeps the images opened. 168 * If only the built-in image formats are used there is no real advantage of caching. 169 * (I.e. no new image decoder is added) 170 * With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. 171 * However the opened images might consume additional RAM. 172 * LV_IMG_CACHE_DEF_SIZE must be >= 1 */ 173 #define LV_IMG_CACHE_DEF_SIZE 1 174 175 /*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/ 176 typedef void * lv_img_decoder_user_data_t; 177 178 /*===================== 179 * Compiler settings 180 *====================*/ 181 /* Define a custom attribute to `lv_tick_inc` function */ 182 #define LV_ATTRIBUTE_TICK_INC 183 184 /* Define a custom attribute to `lv_task_handler` function */ 185 #define LV_ATTRIBUTE_TASK_HANDLER 186 187 /* With size optimization (-Os) the compiler might not align data to 188 * 4 or 8 byte boundary. This alignment will be explicitly applied where needed. 189 * E.g. __attribute__((aligned(4))) */ 190 #define LV_ATTRIBUTE_MEM_ALIGN 191 192 /* Attribute to mark large constant arrays for example 193 * font's bitmaps */ 194 #define LV_ATTRIBUTE_LARGE_CONST 195 196 /*=================== 197 * HAL settings 198 *==================*/ 199 200 /* 1: use a custom tick source. 201 * It removes the need to manually update the tick with `lv_tick_inc`) */ 202 #define LV_TICK_CUSTOM 0 203 #if LV_TICK_CUSTOM == 1 204 #define LV_TICK_CUSTOM_INCLUDE "something.h" /*Header for the sys time function*/ 205 #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current systime in ms*/ 206 #endif /*LV_TICK_CUSTOM*/ 207 208 typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/ 209 typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/ 210 211 /*================ 212 * Log settings 213 *===============*/ 214 215 /*1: Enable the log module*/ 216 #define LV_USE_LOG 0 217 #if LV_USE_LOG 218 /* How important log should be added: 219 * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information 220 * LV_LOG_LEVEL_INFO Log important events 221 * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem 222 * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail 223 * LV_LOG_LEVEL_NONE Do not log anything 224 */ 225 # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN 226 227 /* 1: Print the log with 'printf'; 228 * 0: user need to register a callback with `lv_log_register_print`*/ 229 # define LV_LOG_PRINTF 0 230 #endif /*LV_USE_LOG*/ 231 232 /*================ 233 * THEME USAGE 234 *================*/ 235 #define LV_THEME_LIVE_UPDATE 0 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/ 236 237 #define LV_USE_THEME_TEMPL 0 /*Just for test*/ 238 #define LV_USE_THEME_DEFAULT 0 /*Built mainly from the built-in styles. Consumes very few RAM*/ 239 #define LV_USE_THEME_ALIEN 0 /*Dark futuristic theme*/ 240 #define LV_USE_THEME_NIGHT 0 /*Dark elegant theme*/ 241 #define LV_USE_THEME_MONO 1 /*Mono color theme for monochrome displays*/ 242 #define LV_USE_THEME_MATERIAL 0 /*Flat theme with bold colors and light shadows*/ 243 #define LV_USE_THEME_ZEN 0 /*Peaceful, mainly light theme */ 244 #define LV_USE_THEME_NEMO 0 /*Water-like theme based on the movie "Finding Nemo"*/ 245 246 /*================== 247 * FONT USAGE 248 *===================*/ 249 250 /* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel. 251 * The symbols are available via `LV_SYMBOL_...` defines 252 * More info about fonts: https://docs.littlevgl.com/#Fonts 253 * To create a new font go to: https://littlevgl.com/ttf-font-to-c-array 254 */ 255 256 /* Robot fonts with bpp = 4 257 * https://fonts.google.com/specimen/Roboto */ 258 #define LV_FONT_ROBOTO_12 0 259 #define LV_FONT_ROBOTO_16 1 260 #define LV_FONT_ROBOTO_22 1 261 #define LV_FONT_ROBOTO_28 1 262 263 /*Pixel perfect monospace font 264 * http://pelulamu.net/unscii/ */ 265 #define LV_FONT_UNSCII_8 0 266 267 /* Optionally declare your custom fonts here. 268 * You can use these fonts as default font too 269 * and they will be available globally. E.g. 270 * #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \ 271 * LV_FONT_DECLARE(my_font_2) 272 */ 273 #define LV_FONT_CUSTOM_DECLARE 274 275 /*Always set a default font from the built-in fonts*/ 276 #define LV_FONT_DEFAULT &lv_font_roboto_22 277 278 /* Enable it if you have fonts with a lot of characters. 279 * The limit depends on the font size, font face and bpp 280 * but with > 10,000 characters if you see issues probably you need to enable it.*/ 281 #define LV_FONT_FMT_TXT_LARGE 0 282 283 /*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/ 284 typedef void * lv_font_user_data_t; 285 286 /*================= 287 * Text settings 288 *=================*/ 289 290 /* Select a character encoding for strings. 291 * Your IDE or editor should have the same character encoding 292 * - LV_TXT_ENC_UTF8 293 * - LV_TXT_ENC_ASCII 294 * */ 295 #define LV_TXT_ENC LV_TXT_ENC_UTF8 296 297 /*Can break (wrap) texts on these chars*/ 298 #define LV_TXT_BREAK_CHARS " ,.;:-_" 299 300 /*=================== 301 * LV_OBJ SETTINGS 302 *==================*/ 303 304 /*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/ 305 typedef void * lv_obj_user_data_t; 306 307 /*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/ 308 #define LV_USE_OBJ_REALIGN 1 309 310 /* Enable to make the object clickable on a larger area. 311 * LV_EXT_CLICK_AREA_OFF or 0: Disable this feature 312 * LV_EXT_CLICK_AREA_TINY: The extra area can be adjusted horizontally and vertically (0..255 px) 313 * LV_EXT_CLICK_AREA_FULL: The extra area can be adjusted in all 4 directions (-32k..+32k px) 314 */ 315 #define LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF 316 317 /*================== 318 * LV OBJ X USAGE 319 *================*/ 320 /* 321 * Documentation of the object types: https://docs.littlevgl.com/#Object-types 322 */ 323 324 /*Arc (dependencies: -)*/ 325 #define LV_USE_ARC 1 326 327 /*Bar (dependencies: -)*/ 328 #define LV_USE_BAR 1 329 330 /*Button (dependencies: lv_cont*/ 331 #define LV_USE_BTN 1 332 #if LV_USE_BTN != 0 333 /*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/ 334 # define LV_BTN_INK_EFFECT 0 335 #endif 336 337 /*Button matrix (dependencies: -)*/ 338 #define LV_USE_BTNM 1 339 340 /*Calendar (dependencies: -)*/ 341 #define LV_USE_CALENDAR 1 342 343 /*Canvas (dependencies: lv_img)*/ 344 #define LV_USE_CANVAS 0 345 346 /*Check box (dependencies: lv_btn, lv_label)*/ 347 #define LV_USE_CB 1 348 349 /*Chart (dependencies: -)*/ 350 #define LV_USE_CHART 1 351 #if LV_USE_CHART 352 # define LV_CHART_AXIS_TICK_LABEL_MAX_LEN 20 353 #endif 354 355 /*Container (dependencies: -*/ 356 #define LV_USE_CONT 1 357 358 /*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/ 359 #define LV_USE_DDLIST 1 360 #if LV_USE_DDLIST != 0 361 /*Open and close default animation time [ms] (0: no animation)*/ 362 # define LV_DDLIST_DEF_ANIM_TIME 200 363 #endif 364 365 /*Gauge (dependencies:lv_bar, lv_lmeter)*/ 366 #define LV_USE_GAUGE 1 367 368 /*Image (dependencies: lv_label*/ 369 #define LV_USE_IMG 1 370 371 /*Image Button (dependencies: lv_btn*/ 372 #define LV_USE_IMGBTN 1 373 #if LV_USE_IMGBTN 374 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/ 375 # define LV_IMGBTN_TILED 0 376 #endif 377 378 /*Keyboard (dependencies: lv_btnm)*/ 379 #define LV_USE_KB 1 380 381 /*Label (dependencies: -*/ 382 #define LV_USE_LABEL 1 383 #if LV_USE_LABEL != 0 384 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode*/ 385 # define LV_LABEL_DEF_SCROLL_SPEED 25 386 387 /* Waiting period at beginning/end of animation cycle */ 388 # define LV_LABEL_WAIT_CHAR_COUNT 3 389 390 /*Enable selecting text of the label */ 391 # define LV_LABEL_TEXT_SEL 0 392 393 /*Store extra some info in labels (12 bytes) to speed up drawing of very long texts*/ 394 # define LV_LABEL_LONG_TXT_HINT 0 395 #endif 396 397 /*LED (dependencies: -)*/ 398 #define LV_USE_LED 1 399 400 /*Line (dependencies: -*/ 401 #define LV_USE_LINE 1 402 403 /*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/ 404 #define LV_USE_LIST 1 405 #if LV_USE_LIST != 0 406 /*Default animation time of focusing to a list element [ms] (0: no animation) */ 407 # define LV_LIST_DEF_ANIM_TIME 100 408 #endif 409 410 /*Line meter (dependencies: *;)*/ 411 #define LV_USE_LMETER 1 412 413 /*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/ 414 #define LV_USE_MBOX 1 415 416 /*Page (dependencies: lv_cont)*/ 417 #define LV_USE_PAGE 1 418 #if LV_USE_PAGE != 0 419 /*Focus default animation time [ms] (0: no animation)*/ 420 # define LV_PAGE_DEF_ANIM_TIME 400 421 #endif 422 423 /*Preload (dependencies: lv_arc, lv_anim)*/ 424 #define LV_USE_PRELOAD 1 425 #if LV_USE_PRELOAD != 0 426 # define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/ 427 # define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/ 428 # define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC 429 #endif 430 431 /*Roller (dependencies: lv_ddlist)*/ 432 #define LV_USE_ROLLER 1 433 #if LV_USE_ROLLER != 0 434 /*Focus animation time [ms] (0: no animation)*/ 435 # define LV_ROLLER_DEF_ANIM_TIME 200 436 437 /*Number of extra "pages" when the roller is infinite*/ 438 # define LV_ROLLER_INF_PAGES 7 439 #endif 440 441 /*Slider (dependencies: lv_bar)*/ 442 #define LV_USE_SLIDER 1 443 444 /*Spinbox (dependencies: lv_ta)*/ 445 #define LV_USE_SPINBOX 1 446 447 /*Switch (dependencies: lv_slider)*/ 448 #define LV_USE_SW 1 449 450 /*Text area (dependencies: lv_label, lv_page)*/ 451 #define LV_USE_TA 1 452 #if LV_USE_TA != 0 453 # define LV_TA_DEF_CURSOR_BLINK_TIME 400 /*ms*/ 454 # define LV_TA_DEF_PWD_SHOW_TIME 1500 /*ms*/ 455 #endif 456 457 /*Table (dependencies: lv_label)*/ 458 #define LV_USE_TABLE 1 459 #if LV_USE_TABLE 460 # define LV_TABLE_COL_MAX 12 461 #endif 462 463 /*Tab (dependencies: lv_page, lv_btnm)*/ 464 #define LV_USE_TABVIEW 1 465 # if LV_USE_TABVIEW != 0 466 /*Time of slide animation [ms] (0: no animation)*/ 467 # define LV_TABVIEW_DEF_ANIM_TIME 300 468 #endif 469 470 /*Tileview (dependencies: lv_page) */ 471 #define LV_USE_TILEVIEW 1 472 #if LV_USE_TILEVIEW 473 /*Time of slide animation [ms] (0: no animation)*/ 474 # define LV_TILEVIEW_DEF_ANIM_TIME 300 475 #endif 476 477 /*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/ 478 #define LV_USE_WIN 1 479 480 /*================== 481 * Non-user section 482 *==================*/ 483 484 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/ 485 # define _CRT_SECURE_NO_WARNINGS 486 #endif 487 488 /*--END OF LV_CONF_H--*/ 489 490 /*Be sure every define has a default value*/ 491 //#include "lv_conf_checker.h" 492 493 #endif /*LV_CONF_H*/ 494 495 #endif /*End of "Content enable"*/ 496