Example of using the LittlevGL with the MbedOS (bare metal) on the Disco-F746NG board and also the GPU STM32 chrom-art accelerator is used

Dependencies:   BSP_DISCO_F746NG

Committer:
elelthvd
Date:
Tue Jul 21 19:59:09 2020 +0800
Revision:
3:1c9c6f2a7fcf
Parent:
0:10c4b83c458d
Updated to LVGLv7 and Mbed-OSv6

Who changed what in which revision?

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