/
lv_conf_internal.h
2469 lines (2291 loc) · 73.6 KB
/
lv_conf_internal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* GENERATED FILE, DO NOT EDIT IT!
* @file lv_conf_internal.h
* Make sure all the defines of lv_conf.h have a default value
**/
#ifndef LV_CONF_INTERNAL_H
#define LV_CONF_INTERNAL_H
/* clang-format off */
#include <stdint.h>
/* Handle special Kconfig options */
#ifndef LV_KCONFIG_IGNORE
#include "lv_conf_kconfig.h"
#ifdef CONFIG_LV_CONF_SKIP
#define LV_CONF_SKIP
#endif
#endif
/*If "lv_conf.h" is available from here try to use it later.*/
#ifdef __has_include
#if __has_include("lv_conf.h")
#ifndef LV_CONF_INCLUDE_SIMPLE
#define LV_CONF_INCLUDE_SIMPLE
#endif
#endif
#endif
/*If lv_conf.h is not skipped include it*/
#ifndef LV_CONF_SKIP
#ifdef LV_CONF_PATH /*If there is a path defined for lv_conf.h use it*/
#define __LV_TO_STR_AUX(x) #x
#define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
#include __LV_TO_STR(LV_CONF_PATH)
#undef __LV_TO_STR_AUX
#undef __LV_TO_STR
#elif defined(LV_CONF_INCLUDE_SIMPLE) /*Or simply include lv_conf.h is enabled*/
#include "lv_conf.h"
#else
#include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/
#endif
#if !defined(LV_CONF_H) && !defined(LV_CONF_SUPPRESS_DEFINE_CHECK)
/* #include will sometimes silently fail when __has_include is used */
/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80753 */
#pragma message("Possible failure to include lv_conf.h, please read the comment in this file if you get errors")
#endif
#endif
#ifdef CONFIG_LV_COLOR_DEPTH
#define _LV_KCONFIG_PRESENT
#endif
/*----------------------------------
* Start parsing lv_conf_template.h
-----------------------------------*/
#include <stdint.h>
/*====================
COLOR SETTINGS
*====================*/
/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
#ifndef LV_COLOR_DEPTH
#ifdef CONFIG_LV_COLOR_DEPTH
#define LV_COLOR_DEPTH CONFIG_LV_COLOR_DEPTH
#else
#define LV_COLOR_DEPTH 16
#endif
#endif
/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
#ifndef LV_COLOR_16_SWAP
#ifdef CONFIG_LV_COLOR_16_SWAP
#define LV_COLOR_16_SWAP CONFIG_LV_COLOR_16_SWAP
#else
#define LV_COLOR_16_SWAP 0
#endif
#endif
/*Enable features to draw on transparent background.
*It's required if opa, and transform_* style properties are used.
*Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/
#ifndef LV_COLOR_SCREEN_TRANSP
#ifdef CONFIG_LV_COLOR_SCREEN_TRANSP
#define LV_COLOR_SCREEN_TRANSP CONFIG_LV_COLOR_SCREEN_TRANSP
#else
#define LV_COLOR_SCREEN_TRANSP 0
#endif
#endif
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
#ifndef LV_COLOR_MIX_ROUND_OFS
#ifdef CONFIG_LV_COLOR_MIX_ROUND_OFS
#define LV_COLOR_MIX_ROUND_OFS CONFIG_LV_COLOR_MIX_ROUND_OFS
#else
#define LV_COLOR_MIX_ROUND_OFS 0
#endif
#endif
/*Images pixels with this color will not be drawn if they are chroma keyed)*/
#ifndef LV_COLOR_CHROMA_KEY
#ifdef CONFIG_LV_COLOR_CHROMA_KEY
#define LV_COLOR_CHROMA_KEY CONFIG_LV_COLOR_CHROMA_KEY
#else
#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/
#endif
#endif
/*=========================
MEMORY SETTINGS
*=========================*/
/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
#ifndef LV_MEM_CUSTOM
#ifdef CONFIG_LV_MEM_CUSTOM
#define LV_MEM_CUSTOM CONFIG_LV_MEM_CUSTOM
#else
#define LV_MEM_CUSTOM 0
#endif
#endif
#if LV_MEM_CUSTOM == 0
/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
#ifndef LV_MEM_SIZE
#ifdef CONFIG_LV_MEM_SIZE
#define LV_MEM_SIZE CONFIG_LV_MEM_SIZE
#else
#define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/
#endif
#endif
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
#ifndef LV_MEM_ADR
#ifdef CONFIG_LV_MEM_ADR
#define LV_MEM_ADR CONFIG_LV_MEM_ADR
#else
#define LV_MEM_ADR 0 /*0: unused*/
#endif
#endif
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
#if LV_MEM_ADR == 0
#ifndef LV_MEM_POOL_INCLUDE
#ifdef CONFIG_LV_MEM_POOL_INCLUDE
#define LV_MEM_POOL_INCLUDE CONFIG_LV_MEM_POOL_INCLUDE
#else
#undef LV_MEM_POOL_INCLUDE
#endif
#endif
#ifndef LV_MEM_POOL_ALLOC
#ifdef CONFIG_LV_MEM_POOL_ALLOC
#define LV_MEM_POOL_ALLOC CONFIG_LV_MEM_POOL_ALLOC
#else
#undef LV_MEM_POOL_ALLOC
#endif
#endif
#endif
#else /*LV_MEM_CUSTOM*/
#ifndef LV_MEM_CUSTOM_INCLUDE
#ifdef CONFIG_LV_MEM_CUSTOM_INCLUDE
#define LV_MEM_CUSTOM_INCLUDE CONFIG_LV_MEM_CUSTOM_INCLUDE
#else
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#endif
#endif
#ifndef LV_MEM_CUSTOM_ALLOC
#ifdef CONFIG_LV_MEM_CUSTOM_ALLOC
#define LV_MEM_CUSTOM_ALLOC CONFIG_LV_MEM_CUSTOM_ALLOC
#else
#define LV_MEM_CUSTOM_ALLOC malloc
#endif
#endif
#ifndef LV_MEM_CUSTOM_FREE
#ifdef CONFIG_LV_MEM_CUSTOM_FREE
#define LV_MEM_CUSTOM_FREE CONFIG_LV_MEM_CUSTOM_FREE
#else
#define LV_MEM_CUSTOM_FREE free
#endif
#endif
#ifndef LV_MEM_CUSTOM_REALLOC
#ifdef CONFIG_LV_MEM_CUSTOM_REALLOC
#define LV_MEM_CUSTOM_REALLOC CONFIG_LV_MEM_CUSTOM_REALLOC
#else
#define LV_MEM_CUSTOM_REALLOC realloc
#endif
#endif
#endif /*LV_MEM_CUSTOM*/
/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms.
*You will see an error log message if there wasn't enough buffers. */
#ifndef LV_MEM_BUF_MAX_NUM
#ifdef CONFIG_LV_MEM_BUF_MAX_NUM
#define LV_MEM_BUF_MAX_NUM CONFIG_LV_MEM_BUF_MAX_NUM
#else
#define LV_MEM_BUF_MAX_NUM 16
#endif
#endif
/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/
#ifndef LV_MEMCPY_MEMSET_STD
#ifdef CONFIG_LV_MEMCPY_MEMSET_STD
#define LV_MEMCPY_MEMSET_STD CONFIG_LV_MEMCPY_MEMSET_STD
#else
#define LV_MEMCPY_MEMSET_STD 0
#endif
#endif
/*====================
HAL SETTINGS
*====================*/
/*Default display refresh period. LVG will redraw changed areas with this period time*/
#ifndef LV_DISP_DEF_REFR_PERIOD
#ifdef CONFIG_LV_DISP_DEF_REFR_PERIOD
#define LV_DISP_DEF_REFR_PERIOD CONFIG_LV_DISP_DEF_REFR_PERIOD
#else
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
#endif
#endif
/*Input device read period in milliseconds*/
#ifndef LV_INDEV_DEF_READ_PERIOD
#ifdef CONFIG_LV_INDEV_DEF_READ_PERIOD
#define LV_INDEV_DEF_READ_PERIOD CONFIG_LV_INDEV_DEF_READ_PERIOD
#else
#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/
#endif
#endif
/*Use a custom tick source that tells the elapsed time in milliseconds.
*It removes the need to manually update the tick with `lv_tick_inc()`)*/
#ifndef LV_TICK_CUSTOM
#ifdef CONFIG_LV_TICK_CUSTOM
#define LV_TICK_CUSTOM CONFIG_LV_TICK_CUSTOM
#else
#define LV_TICK_CUSTOM 0
#endif
#endif
#if LV_TICK_CUSTOM
#ifndef LV_TICK_CUSTOM_INCLUDE
#ifdef CONFIG_LV_TICK_CUSTOM_INCLUDE
#define LV_TICK_CUSTOM_INCLUDE CONFIG_LV_TICK_CUSTOM_INCLUDE
#else
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
#endif
#endif
#ifndef LV_TICK_CUSTOM_SYS_TIME_EXPR
#ifdef CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR
#define LV_TICK_CUSTOM_SYS_TIME_EXPR CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR
#else
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
#endif
#endif
#endif /*LV_TICK_CUSTOM*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#ifndef LV_DPI_DEF
#ifdef CONFIG_LV_DPI_DEF
#define LV_DPI_DEF CONFIG_LV_DPI_DEF
#else
#define LV_DPI_DEF 130 /*[px/inch]*/
#endif
#endif
/*=======================
* FEATURE CONFIGURATION
*=======================*/
/*-------------
* Drawing
*-----------*/
/*Enable complex draw engine.
*Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/
#ifndef LV_DRAW_COMPLEX
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_DRAW_COMPLEX
#define LV_DRAW_COMPLEX CONFIG_LV_DRAW_COMPLEX
#else
#define LV_DRAW_COMPLEX 0
#endif
#else
#define LV_DRAW_COMPLEX 1
#endif
#endif
#if LV_DRAW_COMPLEX != 0
/*Allow buffering some shadow calculation.
*LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
*Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
#ifndef LV_SHADOW_CACHE_SIZE
#ifdef CONFIG_LV_SHADOW_CACHE_SIZE
#define LV_SHADOW_CACHE_SIZE CONFIG_LV_SHADOW_CACHE_SIZE
#else
#define LV_SHADOW_CACHE_SIZE 0
#endif
#endif
/* Set number of maximally cached circle data.
* The circumference of 1/4 circle are saved for anti-aliasing
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
* 0: to disable caching */
#ifndef LV_CIRCLE_CACHE_SIZE
#ifdef CONFIG_LV_CIRCLE_CACHE_SIZE
#define LV_CIRCLE_CACHE_SIZE CONFIG_LV_CIRCLE_CACHE_SIZE
#else
#define LV_CIRCLE_CACHE_SIZE 4
#endif
#endif
#endif /*LV_DRAW_COMPLEX*/
/**
* "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer
* and blend it as an image with the given opacity.
* Note that `bg_opa`, `text_opa` etc don't require buffering into layer)
* The widget can be buffered in smaller chunks to avoid using large buffers.
*
* - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it
* - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated.
*
* Both buffer sizes are in bytes.
* "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers
* and can't be drawn in chunks. So these settings affects only widgets with opacity.
*/
#ifndef LV_LAYER_SIMPLE_BUF_SIZE
#ifdef CONFIG_LV_LAYER_SIMPLE_BUF_SIZE
#define LV_LAYER_SIMPLE_BUF_SIZE CONFIG_LV_LAYER_SIMPLE_BUF_SIZE
#else
#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
#endif
#endif
#ifndef LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE
#ifdef CONFIG_LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE CONFIG_LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE
#else
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024)
#endif
#endif
/*Default image cache size. Image caching keeps the images opened.
*If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
*With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
*However the opened images might consume additional RAM.
*0: to disable caching*/
#ifndef LV_IMG_CACHE_DEF_SIZE
#ifdef CONFIG_LV_IMG_CACHE_DEF_SIZE
#define LV_IMG_CACHE_DEF_SIZE CONFIG_LV_IMG_CACHE_DEF_SIZE
#else
#define LV_IMG_CACHE_DEF_SIZE 0
#endif
#endif
/*Number of stops allowed per gradient. Increase this to allow more stops.
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
#ifndef LV_GRADIENT_MAX_STOPS
#ifdef CONFIG_LV_GRADIENT_MAX_STOPS
#define LV_GRADIENT_MAX_STOPS CONFIG_LV_GRADIENT_MAX_STOPS
#else
#define LV_GRADIENT_MAX_STOPS 2
#endif
#endif
/*Default gradient buffer size.
*When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again.
*LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes.
*If the cache is too small the map will be allocated only while it's required for the drawing.
*0 mean no caching.*/
#ifndef LV_GRAD_CACHE_DEF_SIZE
#ifdef CONFIG_LV_GRAD_CACHE_DEF_SIZE
#define LV_GRAD_CACHE_DEF_SIZE CONFIG_LV_GRAD_CACHE_DEF_SIZE
#else
#define LV_GRAD_CACHE_DEF_SIZE 0
#endif
#endif
/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display)
*LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface
*The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */
#ifndef LV_DITHER_GRADIENT
#ifdef CONFIG_LV_DITHER_GRADIENT
#define LV_DITHER_GRADIENT CONFIG_LV_DITHER_GRADIENT
#else
#define LV_DITHER_GRADIENT 0
#endif
#endif
#if LV_DITHER_GRADIENT
/*Add support for error diffusion dithering.
*Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing.
*The increase in memory consumption is (24 bits * object's width)*/
#ifndef LV_DITHER_ERROR_DIFFUSION
#ifdef CONFIG_LV_DITHER_ERROR_DIFFUSION
#define LV_DITHER_ERROR_DIFFUSION CONFIG_LV_DITHER_ERROR_DIFFUSION
#else
#define LV_DITHER_ERROR_DIFFUSION 0
#endif
#endif
#endif
/*Maximum buffer size to allocate for rotation.
*Only used if software rotation is enabled in the display driver.*/
#ifndef LV_DISP_ROT_MAX_BUF
#ifdef CONFIG_LV_DISP_ROT_MAX_BUF
#define LV_DISP_ROT_MAX_BUF CONFIG_LV_DISP_ROT_MAX_BUF
#else
#define LV_DISP_ROT_MAX_BUF (10*1024)
#endif
#endif
/*-------------
* GPU
*-----------*/
/*Use Arm's 2D acceleration library Arm-2D */
#ifndef LV_USE_GPU_ARM2D
#ifdef CONFIG_LV_USE_GPU_ARM2D
#define LV_USE_GPU_ARM2D CONFIG_LV_USE_GPU_ARM2D
#else
#define LV_USE_GPU_ARM2D 0
#endif
#endif
/*Use STM32's DMA2D (aka Chrom Art) GPU*/
#ifndef LV_USE_GPU_STM32_DMA2D
#ifdef CONFIG_LV_USE_GPU_STM32_DMA2D
#define LV_USE_GPU_STM32_DMA2D CONFIG_LV_USE_GPU_STM32_DMA2D
#else
#define LV_USE_GPU_STM32_DMA2D 0
#endif
#endif
#if LV_USE_GPU_STM32_DMA2D
/*Must be defined to include path of CMSIS header of target processor
e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
#ifndef LV_GPU_DMA2D_CMSIS_INCLUDE
#ifdef CONFIG_LV_GPU_DMA2D_CMSIS_INCLUDE
#define LV_GPU_DMA2D_CMSIS_INCLUDE CONFIG_LV_GPU_DMA2D_CMSIS_INCLUDE
#else
#define LV_GPU_DMA2D_CMSIS_INCLUDE
#endif
#endif
#endif
/*Use SWM341's DMA2D GPU*/
#ifndef LV_USE_GPU_SWM341_DMA2D
#ifdef CONFIG_LV_USE_GPU_SWM341_DMA2D
#define LV_USE_GPU_SWM341_DMA2D CONFIG_LV_USE_GPU_SWM341_DMA2D
#else
#define LV_USE_GPU_SWM341_DMA2D 0
#endif
#endif
#if LV_USE_GPU_SWM341_DMA2D
#ifndef LV_GPU_SWM341_DMA2D_INCLUDE
#ifdef CONFIG_LV_GPU_SWM341_DMA2D_INCLUDE
#define LV_GPU_SWM341_DMA2D_INCLUDE CONFIG_LV_GPU_SWM341_DMA2D_INCLUDE
#else
#define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h"
#endif
#endif
#endif
/*Use NXP's PXP GPU iMX RTxxx platforms*/
#ifndef LV_USE_GPU_NXP_PXP
#ifdef CONFIG_LV_USE_GPU_NXP_PXP
#define LV_USE_GPU_NXP_PXP CONFIG_LV_USE_GPU_NXP_PXP
#else
#define LV_USE_GPU_NXP_PXP 0
#endif
#endif
#if LV_USE_GPU_NXP_PXP
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
*/
#ifndef LV_USE_GPU_NXP_PXP_AUTO_INIT
#ifdef CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
#define LV_USE_GPU_NXP_PXP_AUTO_INIT CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
#else
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
#endif
#endif
#endif
/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/
#ifndef LV_USE_GPU_NXP_VG_LITE
#ifdef CONFIG_LV_USE_GPU_NXP_VG_LITE
#define LV_USE_GPU_NXP_VG_LITE CONFIG_LV_USE_GPU_NXP_VG_LITE
#else
#define LV_USE_GPU_NXP_VG_LITE 0
#endif
#endif
/*Use SDL renderer API*/
#ifndef LV_USE_GPU_SDL
#ifdef CONFIG_LV_USE_GPU_SDL
#define LV_USE_GPU_SDL CONFIG_LV_USE_GPU_SDL
#else
#define LV_USE_GPU_SDL 0
#endif
#endif
#if LV_USE_GPU_SDL
#ifndef LV_GPU_SDL_INCLUDE_PATH
#ifdef CONFIG_LV_GPU_SDL_INCLUDE_PATH
#define LV_GPU_SDL_INCLUDE_PATH CONFIG_LV_GPU_SDL_INCLUDE_PATH
#else
#define LV_GPU_SDL_INCLUDE_PATH <SDL2/SDL.h>
#endif
#endif
/*Texture cache size, 8MB by default*/
#ifndef LV_GPU_SDL_LRU_SIZE
#ifdef CONFIG_LV_GPU_SDL_LRU_SIZE
#define LV_GPU_SDL_LRU_SIZE CONFIG_LV_GPU_SDL_LRU_SIZE
#else
#define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8)
#endif
#endif
/*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/
#ifndef LV_GPU_SDL_CUSTOM_BLEND_MODE
#ifdef CONFIG_LV_GPU_SDL_CUSTOM_BLEND_MODE
#define LV_GPU_SDL_CUSTOM_BLEND_MODE CONFIG_LV_GPU_SDL_CUSTOM_BLEND_MODE
#else
#define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6))
#endif
#endif
#endif
/*-------------
* Logging
*-----------*/
/*Enable the log module*/
#ifndef LV_USE_LOG
#ifdef CONFIG_LV_USE_LOG
#define LV_USE_LOG CONFIG_LV_USE_LOG
#else
#define LV_USE_LOG 0
#endif
#endif
#if LV_USE_LOG
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
#ifndef LV_LOG_LEVEL
#ifdef CONFIG_LV_LOG_LEVEL
#define LV_LOG_LEVEL CONFIG_LV_LOG_LEVEL
#else
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
#endif
#endif
/*1: Print the log with 'printf';
*0: User need to register a callback with `lv_log_register_print_cb()`*/
#ifndef LV_LOG_PRINTF
#ifdef CONFIG_LV_LOG_PRINTF
#define LV_LOG_PRINTF CONFIG_LV_LOG_PRINTF
#else
#define LV_LOG_PRINTF 0
#endif
#endif
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
#ifndef LV_LOG_TRACE_MEM
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_MEM
#define LV_LOG_TRACE_MEM CONFIG_LV_LOG_TRACE_MEM
#else
#define LV_LOG_TRACE_MEM 0
#endif
#else
#define LV_LOG_TRACE_MEM 1
#endif
#endif
#ifndef LV_LOG_TRACE_TIMER
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_TIMER
#define LV_LOG_TRACE_TIMER CONFIG_LV_LOG_TRACE_TIMER
#else
#define LV_LOG_TRACE_TIMER 0
#endif
#else
#define LV_LOG_TRACE_TIMER 1
#endif
#endif
#ifndef LV_LOG_TRACE_INDEV
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_INDEV
#define LV_LOG_TRACE_INDEV CONFIG_LV_LOG_TRACE_INDEV
#else
#define LV_LOG_TRACE_INDEV 0
#endif
#else
#define LV_LOG_TRACE_INDEV 1
#endif
#endif
#ifndef LV_LOG_TRACE_DISP_REFR
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_DISP_REFR
#define LV_LOG_TRACE_DISP_REFR CONFIG_LV_LOG_TRACE_DISP_REFR
#else
#define LV_LOG_TRACE_DISP_REFR 0
#endif
#else
#define LV_LOG_TRACE_DISP_REFR 1
#endif
#endif
#ifndef LV_LOG_TRACE_EVENT
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_EVENT
#define LV_LOG_TRACE_EVENT CONFIG_LV_LOG_TRACE_EVENT
#else
#define LV_LOG_TRACE_EVENT 0
#endif
#else
#define LV_LOG_TRACE_EVENT 1
#endif
#endif
#ifndef LV_LOG_TRACE_OBJ_CREATE
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_OBJ_CREATE
#define LV_LOG_TRACE_OBJ_CREATE CONFIG_LV_LOG_TRACE_OBJ_CREATE
#else
#define LV_LOG_TRACE_OBJ_CREATE 0
#endif
#else
#define LV_LOG_TRACE_OBJ_CREATE 1
#endif
#endif
#ifndef LV_LOG_TRACE_LAYOUT
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_LAYOUT
#define LV_LOG_TRACE_LAYOUT CONFIG_LV_LOG_TRACE_LAYOUT
#else
#define LV_LOG_TRACE_LAYOUT 0
#endif
#else
#define LV_LOG_TRACE_LAYOUT 1
#endif
#endif
#ifndef LV_LOG_TRACE_ANIM
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_LOG_TRACE_ANIM
#define LV_LOG_TRACE_ANIM CONFIG_LV_LOG_TRACE_ANIM
#else
#define LV_LOG_TRACE_ANIM 0
#endif
#else
#define LV_LOG_TRACE_ANIM 1
#endif
#endif
#endif /*LV_USE_LOG*/
/*-------------
* Asserts
*-----------*/
/*Enable asserts if an operation is failed or an invalid data is found.
*If LV_USE_LOG is enabled an error message will be printed on failure*/
#ifndef LV_USE_ASSERT_NULL
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_USE_ASSERT_NULL
#define LV_USE_ASSERT_NULL CONFIG_LV_USE_ASSERT_NULL
#else
#define LV_USE_ASSERT_NULL 0
#endif
#else
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
#endif
#endif
#ifndef LV_USE_ASSERT_MALLOC
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_USE_ASSERT_MALLOC
#define LV_USE_ASSERT_MALLOC CONFIG_LV_USE_ASSERT_MALLOC
#else
#define LV_USE_ASSERT_MALLOC 0
#endif
#else
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
#endif
#endif
#ifndef LV_USE_ASSERT_STYLE
#ifdef CONFIG_LV_USE_ASSERT_STYLE
#define LV_USE_ASSERT_STYLE CONFIG_LV_USE_ASSERT_STYLE
#else
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
#endif
#endif
#ifndef LV_USE_ASSERT_MEM_INTEGRITY
#ifdef CONFIG_LV_USE_ASSERT_MEM_INTEGRITY
#define LV_USE_ASSERT_MEM_INTEGRITY CONFIG_LV_USE_ASSERT_MEM_INTEGRITY
#else
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#endif
#endif
#ifndef LV_USE_ASSERT_OBJ
#ifdef CONFIG_LV_USE_ASSERT_OBJ
#define LV_USE_ASSERT_OBJ CONFIG_LV_USE_ASSERT_OBJ
#else
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
#endif
#endif
/*Add a custom handler when assert happens e.g. to restart the MCU*/
#ifndef LV_ASSERT_HANDLER_INCLUDE
#ifdef CONFIG_LV_ASSERT_HANDLER_INCLUDE
#define LV_ASSERT_HANDLER_INCLUDE CONFIG_LV_ASSERT_HANDLER_INCLUDE
#else
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#endif
#endif
#ifndef LV_ASSERT_HANDLER
#ifdef CONFIG_LV_ASSERT_HANDLER
#define LV_ASSERT_HANDLER CONFIG_LV_ASSERT_HANDLER
#else
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
#endif
#endif
/*-------------
* Others
*-----------*/
/*1: Show CPU usage and FPS count*/
#ifndef LV_USE_PERF_MONITOR
#ifdef CONFIG_LV_USE_PERF_MONITOR
#define LV_USE_PERF_MONITOR CONFIG_LV_USE_PERF_MONITOR
#else
#define LV_USE_PERF_MONITOR 0
#endif
#endif
#if LV_USE_PERF_MONITOR
#ifndef LV_USE_PERF_MONITOR_POS
#ifdef CONFIG_LV_USE_PERF_MONITOR_POS
#define LV_USE_PERF_MONITOR_POS CONFIG_LV_USE_PERF_MONITOR_POS
#else
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
#endif
#endif
#endif
/*1: Show the used memory and the memory fragmentation
* Requires LV_MEM_CUSTOM = 0*/
#ifndef LV_USE_MEM_MONITOR
#ifdef CONFIG_LV_USE_MEM_MONITOR
#define LV_USE_MEM_MONITOR CONFIG_LV_USE_MEM_MONITOR
#else
#define LV_USE_MEM_MONITOR 0
#endif
#endif
#if LV_USE_MEM_MONITOR
#ifndef LV_USE_MEM_MONITOR_POS
#ifdef CONFIG_LV_USE_MEM_MONITOR_POS
#define LV_USE_MEM_MONITOR_POS CONFIG_LV_USE_MEM_MONITOR_POS
#else
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif
#endif
#endif
/*1: Draw random colored rectangles over the redrawn areas*/
#ifndef LV_USE_REFR_DEBUG
#ifdef CONFIG_LV_USE_REFR_DEBUG
#define LV_USE_REFR_DEBUG CONFIG_LV_USE_REFR_DEBUG
#else
#define LV_USE_REFR_DEBUG 0
#endif
#endif
/*Change the built in (v)snprintf functions*/
#ifndef LV_SPRINTF_CUSTOM
#ifdef CONFIG_LV_SPRINTF_CUSTOM
#define LV_SPRINTF_CUSTOM CONFIG_LV_SPRINTF_CUSTOM
#else
#define LV_SPRINTF_CUSTOM 0
#endif
#endif
#if LV_SPRINTF_CUSTOM
#ifndef LV_SPRINTF_INCLUDE
#ifdef CONFIG_LV_SPRINTF_INCLUDE
#define LV_SPRINTF_INCLUDE CONFIG_LV_SPRINTF_INCLUDE
#else
#define LV_SPRINTF_INCLUDE <stdio.h>
#endif
#endif
#ifndef lv_snprintf
#ifdef CONFIG_LV_SNPRINTF
#define lv_snprintf CONFIG_LV_SNPRINTF
#else
#define lv_snprintf snprintf
#endif
#endif
#ifndef lv_vsnprintf
#ifdef CONFIG_LV_VSNPRINTF
#define lv_vsnprintf CONFIG_LV_VSNPRINTF
#else
#define lv_vsnprintf vsnprintf
#endif
#endif
#else /*LV_SPRINTF_CUSTOM*/
#ifndef LV_SPRINTF_USE_FLOAT
#ifdef CONFIG_LV_SPRINTF_USE_FLOAT
#define LV_SPRINTF_USE_FLOAT CONFIG_LV_SPRINTF_USE_FLOAT
#else
#define LV_SPRINTF_USE_FLOAT 0
#endif
#endif
#endif /*LV_SPRINTF_CUSTOM*/
#ifndef LV_USE_USER_DATA
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_USE_USER_DATA
#define LV_USE_USER_DATA CONFIG_LV_USE_USER_DATA
#else
#define LV_USE_USER_DATA 0
#endif
#else
#define LV_USE_USER_DATA 1
#endif
#endif
/*Garbage Collector settings
*Used if lvgl is bound to higher level language and the memory is managed by that language*/
#ifndef LV_ENABLE_GC
#ifdef CONFIG_LV_ENABLE_GC
#define LV_ENABLE_GC CONFIG_LV_ENABLE_GC
#else
#define LV_ENABLE_GC 0
#endif
#endif
#if LV_ENABLE_GC != 0
#ifndef LV_GC_INCLUDE
#ifdef CONFIG_LV_GC_INCLUDE
#define LV_GC_INCLUDE CONFIG_LV_GC_INCLUDE
#else
#define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
#endif
#endif
#endif /*LV_ENABLE_GC*/
/*=====================
* COMPILER SETTINGS
*====================*/
/*For big endian systems set to 1*/
#ifndef LV_BIG_ENDIAN_SYSTEM
#ifdef CONFIG_LV_BIG_ENDIAN_SYSTEM
#define LV_BIG_ENDIAN_SYSTEM CONFIG_LV_BIG_ENDIAN_SYSTEM
#else
#define LV_BIG_ENDIAN_SYSTEM 0
#endif
#endif
/*Define a custom attribute to `lv_tick_inc` function*/
#ifndef LV_ATTRIBUTE_TICK_INC
#ifdef CONFIG_LV_ATTRIBUTE_TICK_INC
#define LV_ATTRIBUTE_TICK_INC CONFIG_LV_ATTRIBUTE_TICK_INC
#else
#define LV_ATTRIBUTE_TICK_INC
#endif
#endif
/*Define a custom attribute to `lv_timer_handler` function*/
#ifndef LV_ATTRIBUTE_TIMER_HANDLER
#ifdef CONFIG_LV_ATTRIBUTE_TIMER_HANDLER
#define LV_ATTRIBUTE_TIMER_HANDLER CONFIG_LV_ATTRIBUTE_TIMER_HANDLER
#else
#define LV_ATTRIBUTE_TIMER_HANDLER
#endif
#endif
/*Define a custom attribute to `lv_disp_flush_ready` function*/
#ifndef LV_ATTRIBUTE_FLUSH_READY
#ifdef CONFIG_LV_ATTRIBUTE_FLUSH_READY
#define LV_ATTRIBUTE_FLUSH_READY CONFIG_LV_ATTRIBUTE_FLUSH_READY
#else
#define LV_ATTRIBUTE_FLUSH_READY
#endif
#endif
/*Required alignment size for buffers*/
#ifndef LV_ATTRIBUTE_MEM_ALIGN_SIZE
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE
#else
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 0
#endif
#else
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
#endif
#endif
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
* E.g. __attribute__((aligned(4)))*/
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#ifdef CONFIG_LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN CONFIG_LV_ATTRIBUTE_MEM_ALIGN
#else
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#endif
/*Attribute to mark large constant arrays for example font's bitmaps*/
#ifndef LV_ATTRIBUTE_LARGE_CONST
#ifdef CONFIG_LV_ATTRIBUTE_LARGE_CONST
#define LV_ATTRIBUTE_LARGE_CONST CONFIG_LV_ATTRIBUTE_LARGE_CONST
#else
#define LV_ATTRIBUTE_LARGE_CONST
#endif
#endif
/*Compiler prefix for a big array declaration in RAM*/
#ifndef LV_ATTRIBUTE_LARGE_RAM_ARRAY
#ifdef CONFIG_LV_ATTRIBUTE_LARGE_RAM_ARRAY
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY CONFIG_LV_ATTRIBUTE_LARGE_RAM_ARRAY
#else
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
#endif
#endif
/*Place performance critical functions into a faster memory (e.g RAM)*/
#ifndef LV_ATTRIBUTE_FAST_MEM
#ifdef CONFIG_LV_ATTRIBUTE_FAST_MEM
#define LV_ATTRIBUTE_FAST_MEM CONFIG_LV_ATTRIBUTE_FAST_MEM
#else
#define LV_ATTRIBUTE_FAST_MEM
#endif
#endif
/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/
#ifndef LV_ATTRIBUTE_DMA
#ifdef CONFIG_LV_ATTRIBUTE_DMA
#define LV_ATTRIBUTE_DMA CONFIG_LV_ATTRIBUTE_DMA
#else
#define LV_ATTRIBUTE_DMA
#endif
#endif
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
*should also appear on LVGL binding API such as Micropython.*/
#ifndef LV_EXPORT_CONST_INT
#ifdef CONFIG_LV_EXPORT_CONST_INT
#define LV_EXPORT_CONST_INT CONFIG_LV_EXPORT_CONST_INT
#else
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
#endif
#endif
/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/
#ifndef LV_USE_LARGE_COORD
#ifdef CONFIG_LV_USE_LARGE_COORD
#define LV_USE_LARGE_COORD CONFIG_LV_USE_LARGE_COORD
#else
#define LV_USE_LARGE_COORD 0
#endif
#endif
/*==================
* FONT USAGE
*===================*/
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#ifndef LV_FONT_MONTSERRAT_8
#ifdef CONFIG_LV_FONT_MONTSERRAT_8
#define LV_FONT_MONTSERRAT_8 CONFIG_LV_FONT_MONTSERRAT_8
#else
#define LV_FONT_MONTSERRAT_8 0
#endif
#endif
#ifndef LV_FONT_MONTSERRAT_10
#ifdef CONFIG_LV_FONT_MONTSERRAT_10
#define LV_FONT_MONTSERRAT_10 CONFIG_LV_FONT_MONTSERRAT_10
#else
#define LV_FONT_MONTSERRAT_10 0
#endif
#endif
#ifndef LV_FONT_MONTSERRAT_12
#ifdef CONFIG_LV_FONT_MONTSERRAT_12
#define LV_FONT_MONTSERRAT_12 CONFIG_LV_FONT_MONTSERRAT_12
#else
#define LV_FONT_MONTSERRAT_12 0
#endif
#endif
#ifndef LV_FONT_MONTSERRAT_14
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_FONT_MONTSERRAT_14
#define LV_FONT_MONTSERRAT_14 CONFIG_LV_FONT_MONTSERRAT_14
#else
#define LV_FONT_MONTSERRAT_14 0
#endif
#else
#define LV_FONT_MONTSERRAT_14 1