THEME AND FONT

Dependencies:   TS_DISCO_F746NG mbed LCD_DISCO_F746NG BSP_DISCO_F746NG lvgl_RB FastPWM millis

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lv_conf.h Source File

lv_conf.h

Go to the documentation of this file.
00001 /**
00002  * @file lv_conf.h
00003  *
00004  */
00005 
00006 /*
00007  * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER
00008  */
00009 
00010 #if 1 /*Set it to "1" to enable content*/
00011 
00012 #ifndef LV_CONF_H
00013 #define LV_CONF_H
00014 /* clang-format off */
00015 
00016 #include <stdint.h>
00017 
00018 /*====================
00019    Graphical settings
00020  *====================*/
00021 
00022 /* Maximal horizontal and vertical resolution to support by the library.*/
00023 #define LV_HOR_RES_MAX          480
00024 #define LV_VER_RES_MAX          272
00025 
00026 /* Color depth:
00027  * - 1:  1 byte per pixel
00028  * - 8:  RGB233
00029  * - 16: RGB565
00030  * - 32: ARGB8888
00031  */
00032 #define LV_COLOR_DEPTH     32
00033 
00034 /* Swap the 2 bytes of RGB565 color.
00035  * Useful if the display has a 8 bit interface (e.g. SPI)*/
00036 #define LV_COLOR_16_SWAP   0
00037 
00038 /* 1: Enable screen transparency.
00039  * Useful for OSD or other overlapping GUIs.
00040  * Requires `LV_COLOR_DEPTH = 32` colors and the screen's style should be modified: `style.body.opa = ...`*/
00041 #define LV_COLOR_SCREEN_TRANSP    0
00042 
00043 /*Images pixels with this color will not be drawn (with chroma keying)*/
00044 #define LV_COLOR_TRANSP    LV_COLOR_LIME         /*LV_COLOR_LIME: pure green*/
00045 
00046 /* Enable anti-aliasing (lines, and radiuses will be smoothed) */
00047 #define LV_ANTIALIAS        1
00048 
00049 /* Default display refresh period.
00050  * Can be changed in the display driver (`lv_disp_drv_t`).*/
00051 #define LV_DISP_DEF_REFR_PERIOD      30      /*[ms]*/
00052 
00053 /* Dot Per Inch: used to initialize default sizes.
00054  * E.g. a button with width = LV_DPI / 2 -> half inch wide
00055  * (Not so important, you can adjust it to modify default sizes and spaces)*/
00056 #define LV_DPI              100     /*[px]*/
00057 
00058 /* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
00059 typedef int16_t lv_coord_t;
00060 
00061 /*=========================
00062    Memory manager settings
00063  *=========================*/
00064 
00065 /* LittelvGL's internal memory manager's settings.
00066  * The graphical objects and other related data are stored here. */
00067 
00068 /* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
00069 #define LV_MEM_CUSTOM      0
00070 #if LV_MEM_CUSTOM == 0
00071 /* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
00072 #  define LV_MEM_SIZE    (32U * 1024U)
00073 
00074 /* Complier prefix for a big array declaration */
00075 #  define LV_MEM_ATTR
00076 
00077 /* Set an address for the memory pool instead of allocating it as an array.
00078  * Can be in external SRAM too. */
00079 #  define LV_MEM_ADR          0
00080 
00081 /* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
00082 #  define LV_MEM_AUTO_DEFRAG  1
00083 #else       /*LV_MEM_CUSTOM*/
00084 #  define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
00085 #  define LV_MEM_CUSTOM_ALLOC   malloc       /*Wrapper to malloc*/
00086 #  define LV_MEM_CUSTOM_FREE    free         /*Wrapper to free*/
00087 #endif     /*LV_MEM_CUSTOM*/
00088 
00089 /* Garbage Collector settings
00090  * Used if lvgl is binded to higher level language and the memory is managed by that language */
00091 #define LV_ENABLE_GC 0
00092 #if LV_ENABLE_GC != 0
00093 #  define LV_GC_INCLUDE "gc.h"                           /*Include Garbage Collector related things*/
00094 #  define LV_MEM_CUSTOM_REALLOC   your_realloc           /*Wrapper to realloc*/
00095 #  define LV_MEM_CUSTOM_GET_SIZE  your_mem_get_size      /*Wrapper to lv_mem_get_size*/
00096 #endif /* LV_ENABLE_GC */
00097 
00098 /*=======================
00099    Input device settings
00100  *=======================*/
00101 
00102 /* Input device default settings.
00103  * Can be changed in the Input device driver (`lv_indev_drv_t`)*/
00104 
00105 /* Input device read period in milliseconds */
00106 #define LV_INDEV_DEF_READ_PERIOD          30
00107 
00108 /* Drag threshold in pixels */
00109 #define LV_INDEV_DEF_DRAG_LIMIT           10
00110 
00111 /* Drag throw slow-down in [%]. Greater value -> faster slow-down */
00112 #define LV_INDEV_DEF_DRAG_THROW           20
00113 
00114 /* Long press time in milliseconds.
00115  * Time to send `LV_EVENT_LONG_PRESSSED`) */
00116 #define LV_INDEV_DEF_LONG_PRESS_TIME      400
00117 
00118 /* Repeated trigger period in long press [ms]
00119  * Time between `LV_EVENT_LONG_PRESSED_REPEAT */
00120 #define LV_INDEV_DEF_LONG_PRESS_REP_TIME  100
00121 
00122 /*==================
00123  * Feature usage
00124  *==================*/
00125 
00126 /*1: Enable the Animations */
00127 #define LV_USE_ANIMATION        1
00128 #if LV_USE_ANIMATION
00129 
00130 /*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
00131 typedef void * lv_anim_user_data_t;
00132 
00133 #endif
00134 
00135 /* 1: Enable shadow drawing*/
00136 #define LV_USE_SHADOW           1
00137 
00138 /* 1: Enable object groups (for keyboard/encoder navigation) */
00139 #define LV_USE_GROUP            1
00140 #if LV_USE_GROUP
00141 typedef void * lv_group_user_data_t;
00142 #endif  /*LV_USE_GROUP*/
00143 
00144 /* 1: Enable GPU interface*/
00145 #define LV_USE_GPU              1
00146 
00147 /* 1: Enable file system (might be required for images */
00148 #define LV_USE_FILESYSTEM       1
00149 #if LV_USE_FILESYSTEM
00150 /*Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`)*/
00151 typedef void * lv_fs_drv_user_data_t;
00152 #endif
00153 
00154 /*1: Add a `user_data` to drivers and objects*/
00155 #define LV_USE_USER_DATA        0
00156 
00157 /*========================
00158  * Image decoder and cache
00159  *========================*/
00160 
00161 /* 1: Enable indexed (palette) images */
00162 #define LV_IMG_CF_INDEXED       1
00163 
00164 /* 1: Enable alpha indexed images */
00165 #define LV_IMG_CF_ALPHA         1
00166 
00167 /* Default image cache size. Image caching keeps the images opened.
00168  * If only the built-in image formats are used there is no real advantage of caching.
00169  * (I.e. no new image decoder is added)
00170  * With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
00171  * However the opened images might consume additional RAM.
00172  * LV_IMG_CACHE_DEF_SIZE must be >= 1 */
00173 #define LV_IMG_CACHE_DEF_SIZE       1
00174 
00175 /*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
00176 typedef void * lv_img_decoder_user_data_t;
00177 
00178 /*=====================
00179  *  Compiler settings
00180  *====================*/
00181 /* Define a custom attribute to `lv_tick_inc` function */
00182 #define LV_ATTRIBUTE_TICK_INC
00183 
00184 /* Define a custom attribute to `lv_task_handler` function */
00185 #define LV_ATTRIBUTE_TASK_HANDLER
00186 
00187 /* With size optimization (-Os) the compiler might not align data to
00188  * 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
00189  * E.g. __attribute__((aligned(4))) */
00190 #define LV_ATTRIBUTE_MEM_ALIGN
00191 
00192 /* Attribute to mark large constant arrays for example
00193  * font's bitmaps */
00194 #define LV_ATTRIBUTE_LARGE_CONST
00195 
00196 /*===================
00197  *  HAL settings
00198  *==================*/
00199 
00200 /* 1: use a custom tick source.
00201  * It removes the need to manually update the tick with `lv_tick_inc`) */
00202 #define LV_TICK_CUSTOM     0
00203 #if LV_TICK_CUSTOM == 1
00204 #define LV_TICK_CUSTOM_INCLUDE  "something.h"       /*Header for the sys time function*/
00205 #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())     /*Expression evaluating to current systime in ms*/
00206 #endif   /*LV_TICK_CUSTOM*/
00207 
00208 typedef void * lv_disp_drv_user_data_t;             /*Type of user data in the display driver*/
00209 typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the input device driver*/
00210 
00211 /*================
00212  * Log settings
00213  *===============*/
00214 
00215 /*1: Enable the log module*/
00216 #define LV_USE_LOG      0
00217 #if LV_USE_LOG
00218 /* How important log should be added:
00219  * LV_LOG_LEVEL_TRACE       A lot of logs to give detailed information
00220  * LV_LOG_LEVEL_INFO        Log important events
00221  * LV_LOG_LEVEL_WARN        Log if something unwanted happened but didn't cause a problem
00222  * LV_LOG_LEVEL_ERROR       Only critical issue, when the system may fail
00223  * LV_LOG_LEVEL_NONE        Do not log anything
00224  */
00225 #  define LV_LOG_LEVEL    LV_LOG_LEVEL_WARN
00226 
00227 /* 1: Print the log with 'printf';
00228  * 0: user need to register a callback with `lv_log_register_print_cb`*/
00229 #  define LV_LOG_PRINTF   0
00230 #endif  /*LV_USE_LOG*/
00231 
00232 /*================
00233  *  THEME USAGE
00234  *================*/
00235 #define LV_THEME_LIVE_UPDATE    1   /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/
00236 
00237 #define LV_USE_THEME_TEMPL      1   /*Just for test*/
00238 #define LV_USE_THEME_DEFAULT    1   /*Built mainly from the built-in styles. Consumes very few RAM*/
00239 #define LV_USE_THEME_ALIEN      1   /*Dark futuristic theme*/
00240 #define LV_USE_THEME_NIGHT      1   /*Dark elegant theme*/
00241 #define LV_USE_THEME_MONO       1   /*Mono color theme for monochrome displays*/
00242 #define LV_USE_THEME_MATERIAL   1   /*Flat theme with bold colors and light shadows*/
00243 #define LV_USE_THEME_ZEN        1   /*Peaceful, mainly light theme */
00244 #define LV_USE_THEME_NEMO       1   /*Water-like theme based on the movie "Finding Nemo"*/
00245 
00246 /*==================
00247  *    FONT USAGE
00248  *===================*/
00249 
00250 /* The built-in fonts contains the ASCII range and some Symbols with  4 bit-per-pixel.
00251  * The symbols are available via `LV_SYMBOL_...` defines
00252  * More info about fonts: https://docs.littlevgl.com/#Fonts
00253  * To create a new font go to: https://littlevgl.com/ttf-font-to-c-array
00254  */
00255 
00256 /* Robot fonts with bpp = 4
00257  * https://fonts.google.com/specimen/Roboto  */
00258 #define LV_FONT_ROBOTO_12    1
00259 #define LV_FONT_ROBOTO_16    1
00260 #define LV_FONT_ROBOTO_22    1
00261 #define LV_FONT_ROBOTO_28    1
00262 
00263 /*Pixel perfect monospace font
00264  * http://pelulamu.net/unscii/ */
00265 #define LV_FONT_UNSCII_8     0
00266 
00267 /* Optionally declare your custom fonts here.
00268  * You can use these fonts as default font too
00269  * and they will be available globally. E.g.
00270  * #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \
00271  *                                LV_FONT_DECLARE(my_font_2)
00272  */
00273 #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(RB_lv_font_roboto_16) \ 
00274                                LV_FONT_DECLARE(RB_lv_font_roboto_12) 
00275 
00276 /*Always set a default font from the built-in fonts*/
00277 #define LV_FONT_DEFAULT        &lv_font_roboto_16
00278 //#define LV_FONT_DEFAULT        &RB_lv_font_roboto_16  //GABOR
00279 
00280 /* Enable it if you have fonts with a lot of characters.
00281  * The limit depends on the font size, font face and bpp
00282  * but with > 10,000 characters if you see issues probably you need to enable it.*/
00283 #define LV_FONT_FMT_TXT_LARGE   0
00284 
00285 /*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
00286 typedef void * lv_font_user_data_t;
00287 
00288 /*=================
00289  *  Text settings
00290  *=================*/
00291 
00292 /* Select a character encoding for strings.
00293  * Your IDE or editor should have the same character encoding
00294  * - LV_TXT_ENC_UTF8
00295  * - LV_TXT_ENC_ASCII
00296  * */
00297 #define LV_TXT_ENC LV_TXT_ENC_UTF8
00298 
00299  /*Can break (wrap) texts on these chars*/
00300 #define LV_TXT_BREAK_CHARS                  " ,.;:-_"
00301 
00302 /*===================
00303  *  LV_OBJ SETTINGS
00304  *==================*/
00305 
00306 /*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
00307 typedef void * lv_obj_user_data_t;
00308 
00309 /*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
00310 #define LV_USE_OBJ_REALIGN          1
00311 
00312 /* Enable to make the object clickable on a larger area.
00313  * LV_EXT_CLICK_AREA_OFF or 0: Disable this feature
00314  * LV_EXT_CLICK_AREA_TINY: The extra area can be adjusted horizontally and vertically (0..255 px)
00315  * LV_EXT_CLICK_AREA_FULL: The extra area can be adjusted in all 4 directions (-32k..+32k px)
00316  */
00317 #define LV_USE_EXT_CLICK_AREA  LV_EXT_CLICK_AREA_OFF
00318 
00319 /*==================
00320  *  LV OBJ X USAGE
00321  *================*/
00322 /*
00323  * Documentation of the object types: https://docs.littlevgl.com/#Object-types
00324  */
00325 
00326 /*Arc (dependencies: -)*/
00327 #define LV_USE_ARC      1
00328 
00329 /*Bar (dependencies: -)*/
00330 #define LV_USE_BAR      1
00331 
00332 /*Button (dependencies: lv_cont*/
00333 #define LV_USE_BTN      1
00334 #if LV_USE_BTN != 0
00335 /*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/
00336 #  define LV_BTN_INK_EFFECT   1
00337 #endif
00338 
00339 /*Button matrix (dependencies: -)*/
00340 #define LV_USE_BTNM     1
00341 
00342 /*Calendar (dependencies: -)*/
00343 #define LV_USE_CALENDAR 1
00344 
00345 /*Canvas (dependencies: lv_img)*/
00346 #define LV_USE_CANVAS   1
00347 
00348 /*Check box (dependencies: lv_btn, lv_label)*/
00349 #define LV_USE_CB       1
00350 
00351 /*Chart (dependencies: -)*/
00352 #define LV_USE_CHART    1
00353 #if LV_USE_CHART
00354 #  define LV_CHART_AXIS_TICK_LABEL_MAX_LEN    20
00355 #endif
00356 
00357 /*Container (dependencies: -*/
00358 #define LV_USE_CONT     1
00359 
00360 /*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
00361 #define LV_USE_DDLIST    1
00362 #if LV_USE_DDLIST != 0
00363 /*Open and close default animation time [ms] (0: no animation)*/
00364 #  define LV_DDLIST_DEF_ANIM_TIME     200
00365 #endif
00366 
00367 /*Gauge (dependencies:lv_bar, lv_lmeter)*/
00368 #define LV_USE_GAUGE    1
00369 
00370 /*Image (dependencies: lv_label*/
00371 #define LV_USE_IMG      1
00372 
00373 /*Image Button (dependencies: lv_btn*/
00374 #define LV_USE_IMGBTN   1
00375 #if LV_USE_IMGBTN
00376 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
00377 #  define LV_IMGBTN_TILED 0
00378 #endif
00379 
00380 /*Keyboard (dependencies: lv_btnm)*/
00381 #define LV_USE_KB       1
00382 
00383 /*Label (dependencies: -*/
00384 #define LV_USE_LABEL    1
00385 #if LV_USE_LABEL != 0
00386 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode*/
00387 #  define LV_LABEL_DEF_SCROLL_SPEED       25
00388 
00389 /* Waiting period at beginning/end of animation cycle */
00390 #  define LV_LABEL_WAIT_CHAR_COUNT        3
00391 
00392 /*Enable selecting text of the label */
00393 #  define LV_LABEL_TEXT_SEL               0
00394 
00395 /*Store extra some info in labels (12 bytes) to speed up drawing of very long texts*/
00396 #  define LV_LABEL_LONG_TXT_HINT          0
00397 #endif
00398 
00399 /*LED (dependencies: -)*/
00400 #define LV_USE_LED      1
00401 
00402 /*Line (dependencies: -*/
00403 #define LV_USE_LINE     1
00404 
00405 /*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
00406 #define LV_USE_LIST     1
00407 #if LV_USE_LIST != 0
00408 /*Default animation time of focusing to a list element [ms] (0: no animation)  */
00409 #  define LV_LIST_DEF_ANIM_TIME  100
00410 #endif
00411 
00412 /*Line meter (dependencies: *;)*/
00413 #define LV_USE_LMETER   1
00414 
00415 /*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
00416 #define LV_USE_MBOX     1
00417 
00418 /*Page (dependencies: lv_cont)*/
00419 #define LV_USE_PAGE     1
00420 #if LV_USE_PAGE != 0
00421 /*Focus default animation time [ms] (0: no animation)*/
00422 #  define LV_PAGE_DEF_ANIM_TIME     400
00423 #endif
00424 
00425 /*Preload (dependencies: lv_arc, lv_anim)*/
00426 #define LV_USE_PRELOAD      1
00427 #if LV_USE_PRELOAD != 0
00428 #  define LV_PRELOAD_DEF_ARC_LENGTH   60      /*[deg]*/
00429 #  define LV_PRELOAD_DEF_SPIN_TIME    1000    /*[ms]*/
00430 #  define LV_PRELOAD_DEF_ANIM         LV_PRELOAD_TYPE_SPINNING_ARC
00431 #endif
00432 
00433 /*Roller (dependencies: lv_ddlist)*/
00434 #define LV_USE_ROLLER    1
00435 #if LV_USE_ROLLER != 0
00436 /*Focus animation time [ms] (0: no animation)*/
00437 #  define LV_ROLLER_DEF_ANIM_TIME     200
00438 
00439 /*Number of extra "pages" when the roller is infinite*/
00440 #  define LV_ROLLER_INF_PAGES         7
00441 #endif
00442 
00443 /*Slider (dependencies: lv_bar)*/
00444 #define LV_USE_SLIDER    1
00445 
00446 /*Spinbox (dependencies: lv_ta)*/
00447 #define LV_USE_SPINBOX       1
00448 
00449 /*Switch (dependencies: lv_slider)*/
00450 #define LV_USE_SW       1
00451 
00452 /*Text area (dependencies: lv_label, lv_page)*/
00453 #define LV_USE_TA       1
00454 #if LV_USE_TA != 0
00455 #  define LV_TA_DEF_CURSOR_BLINK_TIME 400     /*ms*/
00456 #  define LV_TA_DEF_PWD_SHOW_TIME     1500    /*ms*/
00457 #endif
00458 
00459 /*Table (dependencies: lv_label)*/
00460 #define LV_USE_TABLE    1
00461 #if LV_USE_TABLE
00462 #  define LV_TABLE_COL_MAX    12
00463 #endif
00464 
00465 /*Tab (dependencies: lv_page, lv_btnm)*/
00466 #define LV_USE_TABVIEW      1
00467 #  if LV_USE_TABVIEW != 0
00468 /*Time of slide animation [ms] (0: no animation)*/
00469 #  define LV_TABVIEW_DEF_ANIM_TIME    300
00470 #endif
00471 
00472 /*Tileview (dependencies: lv_page) */
00473 #define LV_USE_TILEVIEW     1
00474 #if LV_USE_TILEVIEW
00475 /*Time of slide animation [ms] (0: no animation)*/
00476 #  define LV_TILEVIEW_DEF_ANIM_TIME   300
00477 #endif
00478 
00479 /*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
00480 #define LV_USE_WIN      1
00481 
00482 /*==================
00483  * Non-user section
00484  *==================*/
00485 
00486 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)    /* Disable warnings for Visual Studio*/
00487 #  define _CRT_SECURE_NO_WARNINGS
00488 #endif
00489 
00490 /*--END OF LV_CONF_H--*/
00491 
00492 /*Be sure every define has a default value*/
00493 #include "lvgl/src/lv_conf_checker.h"
00494 
00495 #endif /*LV_CONF_H*/
00496 
00497 #endif /*End of "Content enable"*/