Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/libs/lv_conf.h
1476 views
1
/*
2
* Copyright (c) 2018 CTCaer
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#ifndef LV_CONF_H
18
#define LV_CONF_H
19
20
#include <soc/timer.h>
21
#include <memory_map.h>
22
/*===================
23
Dynamic memory
24
*===================*/
25
26
/* Memory size which will be used by the library
27
* to store the graphical objects and other data */
28
#define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
29
#if LV_MEM_CUSTOM == 0
30
# define LV_MEM_SIZE NYX_LV_MEM_SZ /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
31
# define LV_MEM_ATTR /*Complier prefix for big array declaration*/
32
# define LV_MEM_ADR NYX_LV_MEM_ADR /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/
33
# define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
34
#else /*LV_MEM_CUSTOM*/
35
# define LV_MEM_CUSTOM_INCLUDE <mem/heap.h> /*Header for the dynamic memory function*/
36
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
37
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
38
#endif /*LV_MEM_CUSTOM*/
39
40
/* Garbage Collector settings
41
* Used if lvgl is binded to higher language and the memory is managed by that language */
42
#define LV_ENABLE_GC 0
43
#if LV_ENABLE_GC != 0
44
# define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/
45
# define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/
46
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
47
#endif /* LV_ENABLE_GC */
48
49
/*===================
50
Graphical settings
51
*===================*/
52
53
/* Horizontal and vertical resolution of the library.*/
54
#define LV_HOR_RES (1280)
55
#define LV_VER_RES (720)
56
57
/* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide
58
* (Not so important, you can adjust it to modify default sizes and spaces)*/
59
#define LV_DPI 100
60
61
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
62
#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/
63
64
/*Screen refresh period in milliseconds*/
65
#define LV_REFR_PERIOD 33
66
67
/*-----------------
68
* VDB settings
69
*----------------*/
70
71
/* VDB (Virtual Display Buffer) is an internal graphics buffer.
72
* The GUI will be drawn into this buffer first and then
73
* the buffer will be passed to your `disp_drv.disp_flush` function to
74
* copy it to your frame buffer.
75
* VDB is required for: buffered drawing, opacity, anti-aliasing and shadows
76
* Learn more: https://docs.littlevgl.com/#Drawing*/
77
78
/* Size of the VDB in pixels. Typical size: ~1/10 screen. Must be >= LV_HOR_RES
79
* Setting it to 0 will disable VDB and `disp_drv.disp_fill` and `disp_drv.disp_map` functions
80
* will be called to draw to the frame buffer directly*/
81
#define LV_VDB_SIZE (LV_VER_RES * LV_HOR_RES)
82
83
/* Bit-per-pixel of VDB. Useful for monochrome or non-standard color format displays.
84
* Special formats are handled with `disp_drv.vdb_wr`)*/
85
#define LV_VDB_PX_BPP LV_COLOR_SIZE /*LV_COLOR_SIZE comes from LV_COLOR_DEPTH below to set 8, 16 or 32 bit pixel size automatically */
86
87
/* Place VDB to a specific address (e.g. in external RAM)
88
* 0: allocate automatically into RAM
89
* LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/
90
#define LV_VDB_ADR NYX_LV_VDB_ADR
91
92
/* Use two Virtual Display buffers (VDB) to parallelize rendering and flushing
93
* The flushing should use DMA to write the frame buffer in the background */
94
#define LV_VDB_DOUBLE 0
95
96
/* Place VDB2 to a specific address (e.g. in external RAM)
97
* 0: allocate automatically into RAM
98
* LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/
99
#define LV_VDB2_ADR 0
100
101
/* Using true double buffering in `disp_drv.disp_flush` you will always get the image of the whole screen.
102
* Your only task is to set the rendered image (`color_p` parameter) as frame buffer address or send it to your display.
103
* The best if you do in the blank period of you display to avoid tearing effect.
104
* Requires:
105
* - LV_VDB_SIZE = LV_HOR_RES * LV_VER_RES
106
* - LV_VDB_DOUBLE = 1
107
*/
108
#define LV_VDB_TRUE_DOUBLE_BUFFERED 0
109
110
/*=================
111
Misc. setting
112
*=================*/
113
114
/*Input device settings*/
115
#define LV_INDEV_READ_PERIOD 33 /*Input device read period in milliseconds*/
116
#define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points (required: USE_LV_REAL_DRAW = 1)*/
117
#define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */
118
#define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
119
#define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
120
#define LV_INDEV_LONG_PRESS_REP_TIME 1000 //Fix keyb /*Repeated trigger period in long press [ms] */
121
122
/*Color settings*/
123
#define LV_COLOR_DEPTH 32 /*Color depth: 1/8/16/32*/
124
#define LV_COLOR_16_SWAP 0 /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/
125
#define LV_COLOR_SCREEN_TRANSP 0 /*1: Enable screen transparency. Useful for OSD or other overlapping GUIs. Requires ARGB8888 colors*/
126
#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/
127
128
/*Text settings*/
129
#define LV_TXT_UTF8 0 /*Enable UTF-8 coded Unicode character usage */
130
#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
131
#define LV_TXT_LINE_BREAK_LONG_LEN 12 /* If a character is at least this long, will break wherever "prettiest" */
132
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 /* Minimum number of characters of a word to put on a line before a break */
133
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 1 /* Minimum number of characters of a word to put on a line after a break */
134
135
/*Feature usage*/
136
#define USE_LV_ANIMATION 1 /*1: Enable all animations*/
137
#define USE_LV_SHADOW 1 /*1: Enable shadows*/
138
#define USE_LV_GROUP 0 /*1: Enable object groups (for keyboards)*/
139
#define USE_LV_GPU 0 /*1: Enable GPU interface*/
140
#define USE_LV_REAL_DRAW 0 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/
141
#define USE_LV_FILESYSTEM 0 /*1: Enable file system (might be required for images*/
142
#define USE_LV_MULTI_LANG 0 /* Number of languages for labels to store (0: to disable this feature)*/
143
144
/*Compiler settings*/
145
#define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to `lv_tick_inc` function */
146
#define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to `lv_task_handler` function */
147
#define LV_COMPILER_VLA_SUPPORTED 1 /* 1: Variable length array is supported*/
148
149
/*HAL settings*/
150
#define LV_TICK_CUSTOM 1 /*1: use a custom tick source (removing the need to manually update the tick with `lv_tick_inc`) */
151
#if LV_TICK_CUSTOM == 1
152
#define LV_TICK_CUSTOM_INCLUDE <soc/timer.h> /*Header for the sys time function*/
153
#define LV_TICK_CUSTOM_SYS_TIME_EXPR ((u32)get_tmr_ms()) /*Expression evaluating to current systime in ms*/
154
#endif /*LV_TICK_CUSTOM*/
155
156
157
/*Log settings*/
158
#ifdef DEBUG_UART_LV_LOG
159
# define USE_LV_LOG 1 /*Enable/disable the log module*/
160
#else
161
# define USE_LV_LOG 0 /*Enable/disable the log module*/
162
#endif
163
#if USE_LV_LOG
164
/* How important log should be added:
165
* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
166
* LV_LOG_LEVEL_INFO Log important events
167
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't caused problem
168
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
169
*/
170
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
171
/* 1: Print the log with 'printf'; 0: user need to register a callback*/
172
# define LV_LOG_PRINTF 1
173
#endif /*USE_LV_LOG*/
174
175
/*================
176
* THEME USAGE
177
*================*/
178
#define LV_THEME_LIVE_UPDATE 0 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/
179
180
#define USE_LV_THEME_HEKATE 1 /*Flat theme with bold colors and light shadows*/
181
182
/*==================
183
* FONT USAGE
184
*===================*/
185
186
/* More info about fonts: https://docs.littlevgl.com/#Fonts
187
* To enable a built-in font use 1,2,4 or 8 values
188
* which will determine the bit-per-pixel. Higher value means smoother fonts */
189
#define LV_FONT_QUALITY 8
190
191
#define USE_UBUNTU_MONO LV_FONT_QUALITY
192
193
#define USE_INTERUI_20 LV_FONT_QUALITY
194
#define USE_INTERUI_30 LV_FONT_QUALITY
195
196
#define USE_HEKATE_SYMBOL_20 USE_INTERUI_20
197
#define USE_HEKATE_SYMBOL_30 USE_INTERUI_30
198
#define USE_HEKATE_SYMBOL_120 LV_FONT_QUALITY
199
200
/* Optionally declare your custom fonts here.
201
* You can use these fonts as default font too
202
* and they will be available globally. E.g.
203
* #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \
204
* LV_FONT_DECLARE(my_font_2) \
205
*/
206
#define LV_FONT_CUSTOM_DECLARE
207
208
#define LV_FONT_DEFAULT &interui_30 /*Always set a default font from the built-in fonts*/
209
210
/*===================
211
* LV_OBJ SETTINGS
212
*==================*/
213
#define LV_OBJ_FREE_NUM_TYPE uint32_t /*Type of free number attribute (comment out disable free number)*/
214
#define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/
215
#define LV_OBJ_REALIGN 1 // 0 in OG gui /*Enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
216
217
/*==================
218
* LV OBJ X USAGE
219
*================*/
220
/*
221
* Documentation of the object types: https://docs.littlevgl.com/#Object-types
222
*/
223
224
/*****************
225
* Simple object
226
*****************/
227
228
/*Label (dependencies: -*/
229
#define USE_LV_LABEL 1
230
#if USE_LV_LABEL != 0
231
# define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
232
#endif
233
234
/*Image (dependencies: lv_label*/
235
#define USE_LV_IMG 1
236
#if USE_LV_IMG != 0
237
# define LV_IMG_CF_INDEXED 0 /*Enable indexed (palette) images*/
238
# define LV_IMG_CF_ALPHA 0 /*Enable alpha indexed images*/
239
#endif
240
241
/*Line (dependencies: -*/
242
#define USE_LV_LINE 1
243
244
/*Arc (dependencies: -)*/
245
#define USE_LV_ARC 0
246
247
/*******************
248
* Container objects
249
*******************/
250
251
/*Container (dependencies: -*/
252
#define USE_LV_CONT 1
253
254
/*Page (dependencies: lv_cont)*/
255
#define USE_LV_PAGE 1
256
257
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
258
#define USE_LV_WIN 1
259
260
/*Tab (dependencies: lv_page, lv_btnm)*/
261
#define USE_LV_TABVIEW 1
262
# if USE_LV_TABVIEW != 0
263
# define LV_TABVIEW_ANIM_TIME 0 /*Time of slide animation [ms] (0: no animation)*/
264
#endif
265
266
/*Tileview (dependencies: lv_page) */
267
#define USE_LV_TILEVIEW 0
268
#if USE_LV_TILEVIEW
269
# define LV_TILEVIEW_ANIM_TIME 0 /*Time of slide animation [ms] (0: no animation)*/
270
#endif
271
272
/*************************
273
* Data visualizer objects
274
*************************/
275
276
/*Bar (dependencies: -)*/
277
#define USE_LV_BAR 1
278
279
/*Line meter (dependencies: *;)*/
280
#define USE_LV_LMETER 0
281
282
/*Gauge (dependencies:lv_bar, lv_lmeter)*/
283
#define USE_LV_GAUGE 0
284
285
/*Chart (dependencies: -)*/
286
#define USE_LV_CHART 0
287
288
/*Table (dependencies: lv_label)*/
289
#define USE_LV_TABLE 1
290
#if USE_LV_TABLE
291
# define LV_TABLE_COL_MAX 12
292
#endif
293
294
/*LED (dependencies: -)*/
295
#define USE_LV_LED 0
296
297
/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
298
#define USE_LV_MBOX 1
299
#if USE_LV_MBOX != 0
300
# define LV_MBOX_CLOSE_ANIM_TIME 200 /*ms*/
301
#endif
302
303
/*Text area (dependencies: lv_label, lv_page)*/
304
#define USE_LV_TA 1
305
#if USE_LV_TA != 0
306
# define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
307
# define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
308
#endif
309
310
/*Spinbox (dependencies: lv_ta)*/
311
#define USE_LV_SPINBOX 0
312
313
/*Calendar (dependencies: -)*/
314
#define USE_LV_CALENDAR 0
315
316
/*Preload (dependencies: lv_arc)*/
317
#define USE_LV_PRELOAD 0
318
#if USE_LV_PRELOAD != 0
319
# define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
320
# define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
321
# define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
322
#endif
323
324
/*Canvas (dependencies: lv_img)*/
325
#define USE_LV_CANVAS 0
326
/*************************
327
* User input objects
328
*************************/
329
330
/*Button (dependencies: lv_cont*/
331
#define USE_LV_BTN 1
332
#if USE_LV_BTN != 0
333
# define LV_BTN_INK_EFFECT 0 /*Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION)*/
334
#endif
335
336
/*Image Button (dependencies: lv_btn*/
337
#define USE_LV_IMGBTN 1
338
#if USE_LV_IMGBTN
339
# define LV_IMGBTN_TILED 0 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
340
#endif
341
342
/*Button matrix (dependencies: -)*/
343
#define USE_LV_BTNM 1
344
345
/*Keyboard (dependencies: lv_btnm)*/
346
#define USE_LV_KB 0
347
348
/*Check box (dependencies: lv_btn, lv_label)*/
349
#define USE_LV_CB 1
350
351
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
352
#define USE_LV_LIST 1
353
#if USE_LV_LIST != 0
354
# define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
355
#endif
356
357
/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
358
#define USE_LV_DDLIST 1
359
#if USE_LV_DDLIST != 0
360
# define LV_DDLIST_ANIM_TIME 100 /*Open and close default animation time [ms] (0: no animation)*/
361
#endif
362
363
/*Roller (dependencies: lv_ddlist)*/
364
#define USE_LV_ROLLER 1
365
#if USE_LV_ROLLER != 0
366
# define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
367
#endif
368
369
/*Slider (dependencies: lv_bar)*/
370
#define USE_LV_SLIDER 1
371
372
/*Switch (dependencies: lv_slider)*/
373
#define USE_LV_SW 1
374
375
#endif /*LV_CONF_H*/
376
377
378