You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/04/15 14:38:32 UTC

[incubator-nuttx-apps] branch master updated (e0a61da -> 771811c)

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git.


    from e0a61da  Rename workflows to match build.yml
     new abdc745  graphics/littlevgl: Migrate part of Kconfig/lv_conf.h to LittleVGL V6.1.2, such as basic setting and font, etc.
     new 20f3db7  apps/examples/lvgldemo: Update touchpad read callback for LittleVGL V6.1
     new 25876e8  apps/examples/lvgldemo: Update fb flush callback for LVGL V6.1.2
     new 6f2ed3d  apps/graphics/littlevgl: Update include guard macro of lv_conf.h
     new 1fa30e5  apps/examples/lvgldemo: Port tp_cal.c for LVGL V6.1.2
     new b7e96b4  apps/examples/lvgldemo: Update the lvgl init procedure
     new 5bee037  graphics/littlevgl:Fix nxstyle for lv_conf.h
     new 13606dc  apps/examples/lvgldemo: Port new simple demo from LVGL V6.1.2
     new 94b8dbe  examples/lvgldemo: Port all demos to LVGL V6.1.2
     new 1775ccd  graphics/littlevgl: Correct color depth description
     new 2bb4cbf  examples/littlevgl: Add missing btn event handler
     new 972a31c  graphics/littlevgl: Update theme config symbol name in Kconfig
     new 4555e73  graphics/littlevgl: Change tarball version from 5.3 to 6.1.2
     new a749b42  graphics/littlevgl: Fix nxstyle
     new 771811c  examples/lvgldemo: Fix nxstyle

The 15 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 examples/lvgldemo/Kconfig              |    5 +
 examples/lvgldemo/demo.c               |  527 +++++++-------
 examples/lvgldemo/demo.h               |    6 +
 examples/lvgldemo/fbdev.c              |   80 ++-
 examples/lvgldemo/fbdev.h              |   11 +-
 examples/lvgldemo/lv_test_theme_1.c    |  559 +++++++--------
 examples/lvgldemo/lv_test_theme_2.c    |  409 ++++++-----
 examples/lvgldemo/lvgldemo.c           |   17 +-
 examples/lvgldemo/tp.c                 |   33 +-
 examples/lvgldemo/tp.h                 |    6 +-
 examples/lvgldemo/tp_cal.c             |  355 +++++-----
 graphics/littlevgl/Kconfig             |  271 ++------
 graphics/littlevgl/Makefile            |   24 +-
 graphics/littlevgl/lv_conf.h           | 1181 +++++++++++++++++++-------------
 graphics/littlevgl/lv_symbol_def.patch |   12 -
 15 files changed, 1781 insertions(+), 1715 deletions(-)
 delete mode 100644 graphics/littlevgl/lv_symbol_def.patch


[incubator-nuttx-apps] 01/15: graphics/littlevgl: Migrate part of Kconfig/lv_conf.h to LittleVGL V6.1.2, such as basic setting and font, etc.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit abdc745412130d6e2f16470718571ce6919662e3
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Fri Apr 3 11:21:31 2020 +0000

    graphics/littlevgl: Migrate part of Kconfig/lv_conf.h to LittleVGL V6.1.2, such as basic setting and font, etc.
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: Ib3dc31d95acf646dd26d41be873082ea107c6616
---
 graphics/littlevgl/Kconfig   |  251 ++--------
 graphics/littlevgl/lv_conf.h | 1068 ++++++++++++++++++++++--------------------
 2 files changed, 599 insertions(+), 720 deletions(-)

diff --git a/graphics/littlevgl/Kconfig b/graphics/littlevgl/Kconfig
index 58efef8..d8387d6 100644
--- a/graphics/littlevgl/Kconfig
+++ b/graphics/littlevgl/Kconfig
@@ -82,8 +82,8 @@ config LV_ANTIALIAS
 
 endif # LV_VDB_SIZE != 0
 
-config LV_REFR_PERIOD
-	int "Refresh period in milliseconds"
+config LV_DISP_DEF_REFR_PERIOD
+	int "Default refresh period in milliseconds"
 	default 50
 	---help---
 		The graphics library will check for invalid areas an refresh
@@ -100,28 +100,28 @@ endmenu
 
 menu "Input device settings"
 
-config LV_INDEV_READ_PERIOD
-	int "Input device read period in milliseconds"
+config LV_INDEV_DEF_READ_PERIOD
+	int "Input device default read period in milliseconds"
 	default 50
 
 config LV_INDEV_POINT_MARKER
 	int "Mark the pressed points on the screen"
 	default 0
 
-config LV_INDEV_DRAG_LIMIT
-	int "Drag limit in pixels"
+config LV_INDEV_DEF_DRAG_LIMIT
+	int "Default drag limit in pixels"
 	default 10
 
-config LV_INDEV_DRAG_THROW
-	int "Slow down ration when throwing on object by drag [%]"
+config LV_INDEV_DEF_DRAG_THROW
+	int "Default slow down ration when throwing on object by drag [%]"
 	default 20
 
-config LV_INDEV_LONG_PRESS_TIME
-	int "Long press time [ms]"
+config LV_INDEV_DEF_LONG_PRESS_TIME
+	int "Default long press time [ms]"
 	default 400
 
-config LV_INDEV_LONG_PRESS_REP_TIME
-	int "Repeated trigger period in long press [ms]"
+config LV_INDEV_DEF_LONG_PRESS_REP_TIME
+	int "Default repeated trigger period in long press [ms]"
 	default 100
 
 endmenu
@@ -264,207 +264,49 @@ endmenu
 
 menu "Font usage"
 
-# 10 PX FONTS
-
-config USE_LV_FONT_DEJAVU_10
-	int "Dejavu 10 px"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_10_LATIN_SUP
-	int "Dejavu 10 px - latin supplement"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_10_CYRILLIC
-	int "Dejavu 10 px - cyrillic"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_SYMBOL_10
-	int "Symbol 10 px"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-#20 PX FONTS
-
-config USE_LV_FONT_DEJAVU_20
-	int "Dejavu 20 px"
-	default 4
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_20_LATIN_SUP
-	int "Dejavu 20 px - latin supplement"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_20_CYRILLIC
-	int "Dejavu 20 px - cyrillic"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_SYMBOL_20
-	int "Symbol 20 px"
-	default 4
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
+config USE_LV_FONT_ROBOTO_12
+	bool "Roboto 12 px"
+	default n
 
-#30 PX FONTS
+config USE_LV_FONT_ROBOTO_16
+	bool "Roboto 16 px"
+	default y
 
-config USE_LV_FONT_DEJAVU_30
-	int "Dejavu 30 px"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_30_LATIN_SUP
-	int "Dejavu 30 px - latin supplement"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_30_CYRILLIC
-	int "Dejavu 30 px - cyrillic"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_SYMBOL_30
-	int "Symbol 30 px"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
+config USE_LV_FONT_ROBOTO_22
+	bool "Roboto 22 px"
+	default n
 
-#40 PX FONTS
+config USE_LV_FONT_ROBOTO_28
+	bool "Roboto 28 px"
+	default n
 
-config USE_LV_FONT_DEJAVU_40
-	int "Dejavu 40 px"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_40_LATIN_SUP
-	int "Dejavu 40 px - latin supplement"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_DEJAVU_40_CYRILLIC
-	int "Dejavu 40 px - cyrillic"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_SYMBOL_40
-	int "Symbol 40 px"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
-
-config USE_LV_FONT_MONOSPACE_8
-	int "Monospace 8 px"
-	default 0
-	---help---
-		0: disable
-		1: 1 bit-per-pixel
-		2: 2 bit-per-pixel
-		4: 4 bit-per-pixel
-		8: 8 bit-per-pixel
+config USE_LV_FONT_UNSCII_8
+	bool "Monospace 8 px"
+	default n
 
 choice
 	prompt "Default Font"
-	default LV_FONT_DEFAULT_DEJAVU_20
+	default LV_FONT_DEFAULT_ROBOTO_16
 
-config LV_FONT_DEFAULT_DEJAVU_10
-	bool "Dejavu 10 px"
-	depends on USE_LV_FONT_DEJAVU_10 != 0
+config LV_FONT_DEFAULT_ROBOTO_12
+	bool "Roboto 12 px"
+	depends on USE_LV_FONT_ROBOTO_12 != 0
 
-config LV_FONT_DEFAULT_DEJAVU_20
-	bool "Dejavu 20 px"
-	depends on USE_LV_FONT_DEJAVU_20 != 0
+config LV_FONT_DEFAULT_ROBOTO_16
+	bool "Roboto 16 px"
+	depends on USE_LV_FONT_ROBOTO_16 != 0
 
-config LV_FONT_DEFAULT_DEJAVU_30
-	bool "Dejavu 30 px"
-	depends on USE_LV_FONT_DEJAVU_30 != 0
+config LV_FONT_DEFAULT_ROBOTO_22
+	bool "Roboto 22 px"
+	depends on USE_LV_FONT_ROBOTO_22 != 0
 
-config LV_FONT_DEFAULT_DEJAVU_40
-	bool "Dejavu 40 px"
-	depends on USE_LV_FONT_DEJAVU_40 != 0
+config LV_FONT_DEFAULT_ROBOTO_28
+	bool "Roboto 28 px"
+	depends on USE_LV_FONT_ROBOTO_28 != 0
 
-config LV_FONT_DEFAULT_MONOSPACE_8
+config LV_FONT_DEFAULT_UNSCII_8
 	bool "Monospace 8 px"
-	depends on USE_LV_FONT_MONOSPACE_8 != 0
+	depends on USE_LV_FONT_UNSCII_8 != 0
 
 endchoice
 
@@ -472,10 +314,6 @@ endmenu
 
 menu "Base object settings"
 
-config LV_OBJ_FREE_PTR
-	bool "Free pointer enable/disable"
-	default y
-
 config LV_OBJ_REALIGN
 	bool "Enable `lv_obj_realaign()` based on `lv_obj_align()` parameters"
 	default y
@@ -567,6 +405,11 @@ config USE_LV_CHART
 	bool "Chart usage"
 	default y
 
+config LV_CHART_AXIS_TICK_LABEL_MAX_LEN
+	depends on USE_LV_CHART
+	int "Chart axis tick label max length"
+	default 20
+
 config USE_LV_TABLE
 	bool "Table usage"
 	depends on USE_LV_LABEL
diff --git a/graphics/littlevgl/lv_conf.h b/graphics/littlevgl/lv_conf.h
index a929e7f..911b456 100644
--- a/graphics/littlevgl/lv_conf.h
+++ b/graphics/littlevgl/lv_conf.h
@@ -33,749 +33,785 @@
  *
  ****************************************************************************/
 
-#ifndef __APPS_GRAPHICS_LITTLEVGL_LV_CONF_H
-#define __APPS_GRAPHICS_LITTLEVGL_LV_CONF_H
 
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* Compiler settings */
-
-#define LV_COMPILER_VLA_SUPPORTED   1
-
-/* Dynamic memory */
-
-#define LV_MEM_CUSTOM       0
-#define LV_MEM_SIZE         CONFIG_LV_MEM_SIZE
-#define LV_MEM_ADR          0
-#define LV_MEM_AUTO_DEFRAG  1               /* Automatically defrag on free */
-#define LV_MEM_ATTR
-
-#define LV_ENABLE_GC        0
+/*
+ * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER
+ */
 
-/* Graphical settings */
+#ifndef LV_CONF_H
+#define LV_CONF_H
+/* clang-format off */
 
-#define LV_DEMO_SLIDE_SHOW  0
+#include <nuttx/config.h>
 
-/* Horizontal and vertical resolution of the library.*/
+#include <stdint.h>
 
-#define LV_HOR_RES          CONFIG_LV_HOR_RES
-#define LV_VER_RES          CONFIG_LV_VER_RES
-#define LV_DPI              CONFIG_LV_DPI
+/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
+typedef int16_t lv_coord_t;
 
-/* Buffered rendering:
- *
- * No antialasing >= LV_HOR_RES
- * Anti aliasing  >= 4 * LV_HOR_RES
- *
- * Place VDB to a specific address (e.g. in external RAM) (0: allocate into
- * RAM)
- */
+/*====================
+   Graphical settings
+ *====================*/
 
-#define LV_VDB_SIZE         CONFIG_LV_VDB_SIZE
-#define LV_VDB_ADR          CONFIG_LV_VDB_ADR
+/* Maximal horizontal and vertical resolution to support by the library.*/
+#define LV_HOR_RES_MAX          CONFIG_LV_HOR_RES
+#define LV_VER_RES_MAX          CONFIG_LV_VER_RES
 
-/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing
- * The flushing should use DMA to write the frame buffer in the background,
+/* Color depth:
+ * - 1:  1 byte per pixel
+ * - 8:  RGB233
+ * - 16: RGB565
+ * - 32: ARGB8888
  */
+#define LV_COLOR_DEPTH     CONFIG_LV_COLOR_DEPTH
 
-#ifdef CONFIG_LV_VDB_DOUBLE
-#  define LV_VDB_DOUBLE     CONFIG_LV_VDB_DOUBLE
+/* Swap the 2 bytes of RGB565 color.
+ * Useful if the display has a 8 bit interface (e.g. SPI)*/
+#ifdef CONFIG_LV_COLOR_16_SWAP
+#define LV_COLOR_16_SWAP    CONFIG_LV_COLOR_16_SWAP
 #else
-#  define LV_VDB_DOUBLE     0
+#define LV_COLOR_16_SWAP    0
 #endif
 
-/* LV_VDB2_ADR - Place VDB2 to a specific address (e.g. in external RAM)
- * (0: allocate into RAM)
- */
-
-#define LV_VDB2_ADR         CONFIG_LV_VDB2_ADR
-
-#ifdef CONFIG_LV_VDB_TRUE_DOUBLE_BUFFERED
-#  define LV_VDB_TRUE_DOUBLE_BUFFERED  CONFIG_LV_VDB_TRUE_DOUBLE_BUFFERED
+/* 1: Enable screen transparency.
+ * Useful for OSD or other overlapping GUIs.
+ * Requires `LV_COLOR_DEPTH = 32` colors and the screen's style should be modified: `style.body.opa = ...`*/
+#ifdef CONFIG_LV_COLOR_SCREEN_TRANSP
+#define LV_COLOR_SCREEN_TRANSP    CONFIG_LV_COLOR_SCREEN_TRANSP
 #else
-#  define LV_VDB_TRUE_DOUBLE_BUFFERED  0
+#define LV_COLOR_SCREEN_TRANSP    0
 #endif
+/*Images pixels with this color will not be drawn (with chroma keying)*/
+#define LV_COLOR_TRANSP    ((lv_color_t){.full = (CONFIG_LV_COLOR_TRANSP)})      /*LV_COLOR_LIME: pure green*/
 
-/* Enable anti aliasing
- */
+/* Enable chroma keying for indexed images. */
+#define LV_INDEXED_CHROMA    1
 
+/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
 #ifdef CONFIG_LV_ANTIALIAS
-#  define LV_ANTIALIAS      CONFIG_LV_ANTIALIAS
+#define LV_ANTIALIAS        CONFIG_LV_ANTIALIAS
 #else
-#  define LV_ANTIALIAS      0
+#define LV_ANTIALIAS        0
 #endif
 
-/* Screen refresh settings
- *
- * LV_REFR_PERIOD   - Screen refresh period in milliseconds
- * LV_INV_FIFO_SIZE - The average count of objects on a screen
- */
+/* Default display refresh period.
+ * Can be changed in the display driver (`lv_disp_drv_t`).*/
+#define LV_DISP_DEF_REFR_PERIOD      CONFIG_LV_DISP_DEF_REFR_PERIOD   /*[ms]*/
 
-#define LV_REFR_PERIOD      CONFIG_LV_REFR_PERIOD
-#define LV_INV_FIFO_SIZE    CONFIG_LV_INV_FIFO_SIZE
+/* Dot Per Inch: used to initialize default sizes.
+ * E.g. a button with width = LV_DPI / 2 -> half inch wide
+ * (Not so important, you can adjust it to modify default sizes and spaces)*/
+#define LV_DPI              CONFIG_LV_DPI     /*[px]*/
 
-/* Misc. settings */
-/* Input device settings
- *
- * LV_INDEV_READ_PERIOD         - Input device read period in milliseconds
- * LV_INDEV_POINT_MARKER        - Mark the pressed points
- * LV_INDEV_DRAG_LIMIT          - Drag threshold in pixels
- * LV_INDEV_DRAG_THROW          - Drag throw slow-down in [%]. Greater value
- *                                means faster slow-down
- * LV_INDEV_LONG_PRESS_TIME     - Long press time in milliseconds
- * LV_INDEV_LONG_PRESS_REP_TIME - Repeated trigger period in long press [ms]
- */
+/*=========================
+   Memory manager settings
+ *=========================*/
 
-#define LV_INDEV_READ_PERIOD         CONFIG_LV_INDEV_READ_PERIOD
+/* LittelvGL's internal memory manager's settings.
+ * The graphical objects and other related data are stored here. */
 
-#ifdef CONFIG_LV_INDEV_POINT_MARKER
-#  define LV_INDEV_POINT_MARKER      CONFIG_LV_INDEV_POINT_MARKER
-#else
-#  define LV_INDEV_POINT_MARKER      0
-#endif
+/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
+#define LV_MEM_CUSTOM      0
+#if LV_MEM_CUSTOM == 0
+/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
+#  define LV_MEM_SIZE    (32U * 1024U)
 
-#define LV_INDEV_DRAG_LIMIT          CONFIG_LV_INDEV_DRAG_LIMIT
-#define LV_INDEV_DRAG_THROW          CONFIG_LV_INDEV_DRAG_THROW
-#define LV_INDEV_LONG_PRESS_TIME     CONFIG_LV_INDEV_LONG_PRESS_TIME
-#define LV_INDEV_LONG_PRESS_REP_TIME CONFIG_LV_INDEV_LONG_PRESS_REP_TIME
+/* Complier prefix for a big array declaration */
+#  define LV_MEM_ATTR
 
-/* Color settings
- *
- * LV_COLOR_TRANSP - Images pixels with this color will not be drawn (chroma
- *                   keying)
- */
+/* Set an address for the memory pool instead of allocating it as an array.
+ * Can be in external SRAM too. */
+#  define LV_MEM_ADR          0
 
-#define LV_COLOR_DEPTH       CONFIG_LV_COLOR_DEPTH
+/* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
+#  define LV_MEM_AUTO_DEFRAG  1
+#else       /*LV_MEM_CUSTOM*/
+#  define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
+#  define LV_MEM_CUSTOM_ALLOC   malloc       /*Wrapper to malloc*/
+#  define LV_MEM_CUSTOM_FREE    free         /*Wrapper to free*/
+#endif     /*LV_MEM_CUSTOM*/
 
-#ifdef CONFIG_LV_COLOR_16_SWAP
-#  define LV_COLOR_16_SWAP   CONFIG_LV_COLOR_16_SWAP
-#else
-#  define LV_COLOR_16_SWAP   0
-#endif
+/* Garbage Collector settings
+ * Used if lvgl is binded to higher level language and the memory is managed by that language */
+#define LV_ENABLE_GC 0
+#if LV_ENABLE_GC != 0
+#  define LV_GC_INCLUDE "gc.h"                           /*Include Garbage Collector related things*/
+#  define LV_MEM_CUSTOM_REALLOC   your_realloc           /*Wrapper to realloc*/
+#  define LV_MEM_CUSTOM_GET_SIZE  your_mem_get_size      /*Wrapper to lv_mem_get_size*/
+#endif /* LV_ENABLE_GC */
 
-#ifdef CONFIG_LV_COLOR_SCREEN_TRANSP
-#  define LV_COLOR_SCREEN_TRANSP  CONFIG_LV_COLOR_SCREEN_TRANSP
-#else
-#  define LV_COLOR_SCREEN_TRANSP  0
-#endif
+/*=======================
+   Input device settings
+ *=======================*/
 
-#define LV_COLOR_TRANSP      LV_COLOR_HEX(CONFIG_LV_COLOR_TRANSP)
+/* Input device default settings.
+ * Can be changed in the Input device driver (`lv_indev_drv_t`)*/
 
-/* Text settings
- *
- * LV_TXT_BREAK_CHARS - Can break texts on these chars
- */
+/* Input device read period in milliseconds */
+#define LV_INDEV_DEF_READ_PERIOD          CONFIG_LV_INDEV_DEF_READ_PERIOD
 
-#ifdef CONFIG_LV_TXT_UTF8
-#  define LV_TXT_UTF8        CONFIG_LV_TXT_UTF8
-#else
-#  define LV_TXT_UTF8        0
-#endif
+/* Drag threshold in pixels */
+#define LV_INDEV_DEF_DRAG_LIMIT           CONFIG_LV_INDEV_DEF_DRAG_LIMIT
+
+/* Drag throw slow-down in [%]. Greater value -> faster slow-down */
+#define LV_INDEV_DEF_DRAG_THROW           CONFIG_LV_INDEV_DEF_DRAG_THROW
+
+/* Long press time in milliseconds.
+ * Time to send `LV_EVENT_LONG_PRESSSED`) */
+#define LV_INDEV_DEF_LONG_PRESS_TIME      CONFIG_LV_INDEV_DEF_LONG_PRESS_TIME
 
-#define LV_TXT_BREAK_CHARS   CONFIG_LV_TXT_BREAK_CHARS
+/* Repeated trigger period in long press [ms]
+ * Time between `LV_EVENT_LONG_PRESSED_REPEAT */
+#define LV_INDEV_DEF_LONG_PRESS_REP_TIME  CONFIG_LV_INDEV_DEF_LONG_PRESS_REP_TIME
 
-/* Graphics feature usage */
+/*==================
+ * Feature usage
+ *==================*/
 
+/*1: Enable the Animations */
 #ifdef CONFIG_USE_LV_ANIMATION
-#  define USE_LV_ANIMATION   CONFIG_USE_LV_ANIMATION
+#define LV_USE_ANIMATION        CONFIG_USE_LV_ANIMATION
 #else
-#  define USE_LV_ANIMATION   0
+#define LV_USE_ANIMATION        0
 #endif
 
+#if LV_USE_ANIMATION
+
+/*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
+typedef void * lv_anim_user_data_t;
+
+#endif
+
+/* 1: Enable shadow drawing*/
 #ifdef CONFIG_USE_LV_SHADOW
-#  define USE_LV_SHADOW      CONFIG_USE_LV_SHADOW
+#define LV_USE_SHADOW           CONFIG_USE_LV_SHADOW
 #else
-#  define USE_LV_SHADOW      0
+#define LV_USE_SHADOW           0
 #endif
 
+/* 1: Enable object groups (for keyboard/encoder navigation) */
 #ifdef CONFIG_USE_LV_GROUP
-  #define USE_LV_GROUP       CONFIG_USE_LV_GROUP
+#define LV_USE_GROUP            CONFIG_USE_LV_GROUP
 #else
-#  define USE_LV_GROUP       0
+#define LV_USE_GROUP            0
 #endif
+#if LV_USE_GROUP
+typedef void * lv_group_user_data_t;
+#endif  /*LV_USE_GROUP*/
 
+/* 1: Enable GPU interface*/
 #ifdef CONFIG_USE_LV_GPU
-#  define USE_LV_GPU         CONFIG_USE_LV_GPU
+#define LV_USE_GPU              CONFIG_USE_LV_GPU
 #else
-#  define USE_LV_GPU         0
-#endif
-
-#ifdef CONFIG_USE_LV_REAL_DRAW
-#  define USE_LV_REAL_DRAW   CONFIG_USE_LV_REAL_DRAW
-#else
-#  define USE_LV_REAL_DRAW   0
+#define LV_USE_GPU              0
 #endif
 
+/* 1: Enable file system (might be required for images */
 #ifdef CONFIG_USE_LV_FILESYSTEM
-#  define USE_LV_FILESYSTEM  CONFIG_USE_LV_FILESYSTEM
+#define LV_USE_FILESYSTEM       CONFIG_USE_LV_FILESYSTEM
 #else
-#  define USE_LV_FILESYSTEM  0
+#define LV_USE_FILESYSTEM       0
 #endif
 
-/* Number of languages for labels to store (0: to disable this feature) */
-
-#ifdef CONFIG_USE_LV_MULTI_LANG
-#  define USE_LV_MULTI_LANG  CONFIG_USE_LV_MULTI_LANG
-#else
-#  define USE_LV_MULTI_LANG  0
+#if LV_USE_FILESYSTEM
+/*Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`)*/
+typedef void * lv_fs_drv_user_data_t;
 #endif
 
-/* 1: use a custom tick source (removing the need to manually update the
- * tick with `lv_tick_inc`)
- */
-
-#define LV_TICK_CUSTOM     0
+/*1: Add a `user_data` to drivers and objects*/
+#define LV_USE_USER_DATA        0
 
-/* LOG USAGE*/
+/*========================
+ * Image decoder and cache
+ *========================*/
 
-#ifdef CONFIG_USE_LV_LOG
-#  define USE_LV_LOG         CONFIG_USE_LV_LOG
-#  if   defined(CONFIG_LV_LOG_LEVEL_TRACE)
-#    define LV_LOG_LEVEL     LV_LOG_LEVEL_TRACE
-#  elif defined(CONFIG_LV_LOG_LEVEL_INFO)
-#    define LV_LOG_LEVEL     LV_LOG_LEVEL_INFO
-#  elif defined(CONFIG_LV_LOG_LEVEL_WARN)
-#    define LV_LOG_LEVEL     LV_LOG_LEVEL_WARN
-#  elif defined(CONFIG_LV_LOG_LEVEL_ERROR)
-#    define LV_LOG_LEVEL     LV_LOG_LEVEL_ERROR
-#  else
-#    error "Unknown log level selected"
-#  endif
-#  define LV_LOG_PRINTF      1      /* TODO: find a NuttX way to do logging */
-#else
-#  define USE_LV_LOG         0
-#  define LV_LOG_LEVEL       0
-#  define LV_LOG_PRINTF      0
-#endif
-
-/* THEME USAGE */
-/* Just for test */
-#ifdef CONFIG_LV_THEME_LIVE_UPDATE
-#  define LV_THEME_LIVE_UPDATE   CONFIG_LV_THEME_LIVE_UPDATE
+/* 1: Enable indexed (palette) images */
+#ifdef CONFIG_LV_IMG_CF_INDEXED
+#define LV_IMG_CF_INDEXED       CONFIG_LV_IMG_CF_INDEXED
 #else
-#  define LV_THEME_LIVE_UPDATE   0
+#define LV_IMG_CF_INDEXED       0
 #endif
 
-#ifdef CONFIG_USE_LV_THEME_TEMPL
-#  define USE_LV_THEME_TEMPL     CONFIG_USE_LV_THEME_TEMPL
+/* 1: Enable alpha indexed images */
+#ifdef  CONFIG_LV_IMG_CF_ALPHA
+#define LV_IMG_CF_ALPHA         CONFIG_LV_IMG_CF_ALPHA
 #else
-#  define USE_LV_THEME_TEMPL     0
+#define LV_IMG_CF_ALPHA         0
 #endif
 
-/* Built mainly from the built-in styles. Consumes very few RAM */
+/* 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. 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.
+ * LV_IMG_CACHE_DEF_SIZE must be >= 1 */
+#define LV_IMG_CACHE_DEF_SIZE       1
 
-#ifdef CONFIG_USE_LV_THEME_DEFAULT
-#  define USE_LV_THEME_DEFAULT   CONFIG_USE_LV_THEME_DEFAULT
-#else
-#  define USE_LV_THEME_DEFAULT   0
-#endif
+/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
+typedef void * lv_img_decoder_user_data_t;
 
-/* Dark futuristic theme */
+/*=====================
+ *  Compiler settings
+ *====================*/
+/* Define a custom attribute to `lv_tick_inc` function */
+#define LV_ATTRIBUTE_TICK_INC
 
-#ifdef CONFIG_USE_LV_THEME_ALIEN
-#  define USE_LV_THEME_ALIEN     CONFIG_USE_LV_THEME_ALIEN
-#else
-#  define USE_LV_THEME_ALIEN     0
-#endif
+/* Define a custom attribute to `lv_task_handler` function */
+#define LV_ATTRIBUTE_TASK_HANDLER
 
-/* Dark elegant theme */
+/* With size optimization (-Os) the compiler might not align data to
+ * 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
+ * E.g. __attribute__((aligned(4))) */
+#define LV_ATTRIBUTE_MEM_ALIGN
 
-#ifdef CONFIG_USE_LV_THEME_NIGHT
-#  define USE_LV_THEME_NIGHT     CONFIG_USE_LV_THEME_NIGHT
-#else
-#  define USE_LV_THEME_NIGHT     0
-#endif
+/* Attribute to mark large constant arrays for example
+ * font's bitmaps */
+#define LV_ATTRIBUTE_LARGE_CONST
 
-/* Mono color theme for monochrome displays */
+/* 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
+ *
+ * The default value just prevents a GCC warning.
+ */
+#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning
 
-#ifdef CONFIG_USE_LV_THEME_MONO
-#  define USE_LV_THEME_MONO      CONFIG_USE_LV_THEME_MONO
-#else
-#  define USE_LV_THEME_MONO      0
-#endif
+/*===================
+ *  HAL settings
+ *==================*/
 
-/* Flat theme with bold colors and light shadows (Planned) */
+/* 1: use a custom tick source.
+ * It removes the need to manually update the tick with `lv_tick_inc`) */
+#define LV_TICK_CUSTOM     0
+#if LV_TICK_CUSTOM == 1
+#define LV_TICK_CUSTOM_INCLUDE  "something.h"       /*Header for the sys time function*/
+#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())     /*Expression evaluating to current systime in ms*/
+#endif   /*LV_TICK_CUSTOM*/
 
-#ifdef CONFIG_USE_LV_THEME_MATERIAL
-#  define USE_LV_THEME_MATERIAL  CONFIG_USE_LV_THEME_MATERIAL
-#else
-#  define USE_LV_THEME_MATERIAL  0
-#endif
+typedef void * lv_disp_drv_user_data_t;             /*Type of user data in the display driver*/
+typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the input device driver*/
 
-/* Peaceful, mainly black and white theme (Planned) */
+/*================
+ * Log settings
+ *===============*/
 
-#ifdef CONFIG_USE_LV_THEME_ZEN
-#  define USE_LV_THEME_ZEN       CONFIG_USE_LV_THEME_ZEN
+/*1: Enable the log module*/
+#ifdef CONFIG_USE_LV_LOG
+#define LV_USE_LOG      CONFIG_USE_LV_LOG
 #else
-#  define USE_LV_THEME_ZEN       0
+#define LV_USE_LOG      0
 #endif
 
-/* Water-like theme based on the movie "Finding Nemo" */
-
-#ifdef CONFIG_USE_LV_THEME_NEMO
-#  define USE_LV_THEME_NEMO      CONFIG_USE_LV_THEME_NEMO
-#else
-#  define USE_LV_THEME_NEMO      0
+#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_NONE        Do not log anything
+ */
+#ifdef CONFIG_LV_LOG_LEVEL_TRACE
+#  define LV_LOG_LEVEL    LV_LOG_LEVEL_TRACE
 #endif
 
-/* FONT USAGE */
+#ifdef CONFIG_LV_LOG_LEVEL_INFO
+#  define LV_LOG_LEVEL    LV_LOG_LEVEL_INFO
+#endif
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_10
-#  define USE_LV_FONT_DEJAVU_10             CONFIG_USE_LV_FONT_DEJAVU_10
-#else
-#  define USE_LV_FONT_DEJAVU_10             0
+#ifdef CONFIG_LV_LOG_LEVEL_WARN
+#  define LV_LOG_LEVEL    LV_LOG_LEVEL_WARN
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_10_LATIN_SUP
-#  define USE_LV_FONT_DEJAVU_10_LATIN_SUP CONFIG_USE_LV_FONT_DEJAVU_10_LATIN_SUP
-#else
-#  define USE_LV_FONT_DEJAVU_10_LATIN_SUP 0
+#ifdef CONFIG_LV_LOG_LEVEL_ERROR
+#  define LV_LOG_LEVEL    LV_LOG_LEVEL_ERROR
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_10_CYRILLIC
-#  define USE_LV_FONT_DEJAVU_10_CYRILLIC    CONFIG_USE_LV_FONT_DEJAVU_10_CYRILLIC
-#else
-#  define USE_LV_FONT_DEJAVU_10_CYRILLIC    0
+#ifdef CONFIG_LV_LOG_LEVEL_NONE
+#  define LV_LOG_LEVEL    LV_LOG_LEVEL_NONE
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_SYMBOL_10
-#  define USE_LV_FONT_SYMBOL_10       CONFIG_USE_LV_FONT_SYMBOL_10
+/* 1: Print the log with 'printf';
+ * 0: user need to register a callback with `lv_log_register_print_cb`*/
+#ifdef CONFIG_LV_LOG_PRINTF
+#  define LV_LOG_PRINTF   CONFIG_LV_LOG_PRINTF
 #else
-#  define USE_LV_FONT_SYMBOL_10       0
+#  define LV_LOG_PRINTF   0
 #endif
+#endif  /*LV_USE_LOG*/
 
-/* Size 20 */
+/*=================
+ * Debug settings
+ *================*/
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_20
-#  define USE_LV_FONT_DEJAVU_20             CONFIG_USE_LV_FONT_DEJAVU_20
-#else
-#  define USE_LV_FONT_DEJAVU_20             0
-#endif
+/* If Debug is enabled LittelvGL validates the parameters of the functions.
+ * If an invalid parameter is found an error log message is printed and
+ * the MCU halts at the error. (`LV_USE_LOG` should be enabled)
+ * If you are debugging the MCU you can pause
+ * the debugger to see exactly where  the issue is.
+ *
+ * The behavior of asserts can be overwritten by redefining them here.
+ * E.g. #define LV_ASSERT_MEM(p)  <my_assert_code>
+ */
+#define LV_USE_DEBUG        0
+#if LV_USE_DEBUG
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_20_LATIN_SUP
-#  define USE_LV_FONT_DEJAVU_20_LATIN_SUP CONFIG_USE_LV_FONT_DEJAVU_20_LATIN_SUP
-#else
-#  define USE_LV_FONT_DEJAVU_20_LATIN_SUP 0
-#endif
+/*Check if the parameter is NULL. (Quite fast) */
+#define LV_USE_ASSERT_NULL      1
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_20_CYRILLIC
-#  define USE_LV_FONT_DEJAVU_20_CYRILLIC    CONFIG_USE_LV_FONT_DEJAVU_20_CYRILLIC
-#else
-#  define USE_LV_FONT_DEJAVU_20_CYRILLIC    0
-#endif
+/*Checks is the memory is successfully allocated or no. (Quite fast)*/
+#define LV_USE_ASSERT_MEM       1
 
-#ifdef CONFIG_USE_LV_FONT_SYMBOL_20
-#  define USE_LV_FONT_SYMBOL_20       CONFIG_USE_LV_FONT_SYMBOL_20
-#else
-#  define USE_LV_FONT_SYMBOL_20       0
-#endif
+/* Check the strings.
+ * Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)
+ * If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
+#define LV_USE_ASSERT_STR       0
 
-/* Size 30 */
+/* Check NULL, the object's type and existence (e.g. not deleted). (Quite slow)
+ * If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
+#define LV_USE_ASSERT_OBJ       0
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_30
-#  define USE_LV_FONT_DEJAVU_30             CONFIG_USE_LV_FONT_DEJAVU_30
-#else
-#  define USE_LV_FONT_DEJAVU_30             0
-#endif
+/*Check if the styles are properly initialized. (Fast)*/
+#define LV_USE_ASSERT_STYLE     1
+
+#endif /*LV_USE_DEBUG*/
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_30_LATIN_SUP
-#  define USE_LV_FONT_DEJAVU_30_LATIN_SUP CONFIG_USE_LV_FONT_DEJAVU_30_LATIN_SUP
+/*================
+ *  THEME USAGE
+ *================*/
+#ifdef CONFIG_LV_THEME_LIVE_UPDATE
+#define LV_THEME_LIVE_UPDATE    CONFIG_LV_THEME_LIVE_UPDATE
 #else
-#  define USE_LV_FONT_DEJAVU_30_LATIN_SUP 0
+#define LV_THEME_LIVE_UPDATE    0   /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_30_CYRILLIC
-#  define USE_LV_FONT_DEJAVU_30_CYRILLIC    CONFIG_USE_LV_FONT_DEJAVU_30_CYRILLIC
+#ifdef CONFIG_LV_THEME_LIVE_TEMPL
+#define LV_USE_THEME_TEMPL      CONFIG_LV_USE_THEME_TEMPL
 #else
-#  define USE_LV_FONT_DEJAVU_30_CYRILLIC    0
+#define LV_USE_THEME_TEMPL      0   /*Just for test*/
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_SYMBOL_30
-#  define USE_LV_FONT_SYMBOL_30       CONFIG_USE_LV_FONT_SYMBOL_30
+#ifdef CONFIG_LV_USE_THEME_DEFAULT
+#define LV_USE_THEME_DEFAULT    CONFIG_LV_USE_THEME_DEFAULT
 #else
-#  define USE_LV_FONT_SYMBOL_30       0
+#define LV_USE_THEME_DEFAULT    0   /*Built mainly from the built-in styles. Consumes very few RAM*/
 #endif
 
-/*Size 40*/
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_40
-#  define USE_LV_FONT_DEJAVU_40             CONFIG_USE_LV_FONT_DEJAVU_40
+#ifdef CONFIG_LV_USE_THEME_ALIEN
+#define LV_USE_THEME_ALIEN      CONFIG_LV_USE_THEME_ALIEN
 #else
-#  define USE_LV_FONT_DEJAVU_40             0
+#define LV_USE_THEME_ALIEN      0   /*Dark futuristic theme*/
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_SYMBOL_40
-#  define USE_LV_FONT_SYMBOL_40       CONFIG_USE_LV_FONT_SYMBOL_40
+#ifdef CONFIG_LV_USE_THEME_NIGHT
+#define LV_USE_THEME_NIGHT      CONFIG_LV_USE_THEME_NIGHT
 #else
-#  define USE_LV_FONT_SYMBOL_40       0
+#define LV_USE_THEME_NIGHT      0   /*Dark elegant theme*/
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_40_LATIN_SUP
-#  define USE_LV_FONT_DEJAVU_40_LATIN_SUP CONFIG_USE_LV_FONT_DEJAVU_40_LATIN_SUP
+#ifdef CONFIG_LV_USE_THEME_MONO
+#define LV_USE_THEME_MONO       CONFIG_LV_USE_THEME_MONO
 #else
-#  define USE_LV_FONT_DEJAVU_40_LATIN_SUP 0
+#define LV_USE_THEME_MONO       0   /*Mono color theme for monochrome displays*/
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_DEJAVU_40_CYRILLIC
-#  define USE_LV_FONT_DEJAVU_40_CYRILLIC    CONFIG_USE_LV_FONT_DEJAVU_40_CYRILLIC
+#ifdef  CONFIG_LV_USE_THEME_MATERIAL
+#define LV_USE_THEME_MATERIAL   CONFIG_LV_USE_THEME_MATERIAL
 #else
-#  define USE_LV_FONT_DEJAVU_40_CYRILLIC    0
+#define LV_USE_THEME_MATERIAL   0   /*Flat theme with bold colors and light shadows*/
 #endif
 
-#ifdef CONFIG_USE_LV_FONT_MONOSPACE_8
-#  define USE_LV_FONT_MONOSPACE_8          CONFIG_USE_LV_FONT_MONOSPACE_8
+#ifdef CONFIG_LV_USE_THEME_ZEN
+#define LV_USE_THEME_ZEN        CONFIG_LV_USE_THEME_ZEN
 #else
-#  define USE_LV_FONT_MONOSPACE_8          0
+#define LV_USE_THEME_ZEN        0   /*Peaceful, mainly light theme */
 #endif
 
-#if   defined(CONFIG_LV_FONT_DEFAULT_DEJAVU_10)
-#  define LV_FONT_DEFAULT       &lv_font_dejavu_10
-#elif defined(CONFIG_LV_FONT_DEFAULT_DEJAVU_20)
-#  define LV_FONT_DEFAULT       &lv_font_dejavu_20
-#elif defined(CONFIG_LV_FONT_DEFAULT_DEJAVU_30)
-#  define LV_FONT_DEFAULT       &lv_font_dejavu_30
-#elif defined(CONFIG_LV_FONT_DEFAULT_DEJAVU_40)
-#  define LV_FONT_DEFAULT       &lv_font_dejavu_40
-#elif defined(CONFIG_LV_FONT_DEFAULT_MONOSPACE_8)
-#  define LV_FONT_DEFAULT       &lv_font_monospace_8
+#ifdef CONFIG_LV_USE_THEME_NEMO
+#define LV_USE_THEME_NEMO       CONFIG_LV_USE_THEME_NEMO
 #else
-#  error "At least one font must be defined and selected as the default font"
+#define LV_USE_THEME_NEMO       0   /*Water-like theme based on the movie "Finding Nemo"*/
 #endif
 
-/* LV_OBJ SETTINGS
- *
- * LV_OBJ_FREE_NUM_TYPE - Type of free number attribute (comment out disable free number)
- * LV_OBJ_FREE_PTR      - Enable the free pointer attribute
- */
+/*==================
+ *    FONT USAGE
+ *===================*/
 
-#define LV_OBJ_FREE_NUM_TYPE uint32_t
+/* The built-in fonts contains the ASCII range and some Symbols with  4 bit-per-pixel.
+ * The symbols are available via `LV_SYMBOL_...` defines
+ * More info about fonts: https://docs.littlevgl.com/#Fonts
+ * To create a new font go to: https://littlevgl.com/ttf-font-to-c-array
+ */
 
-#ifdef CONFIG_LV_OBJ_FREE_PTR
-#  define LV_OBJ_FREE_PTR    CONFIG_LV_OBJ_FREE_PTR
+/* Robot fonts with bpp = 4
+ * https://fonts.google.com/specimen/Roboto  */
+#ifdef CONFIG_USE_LV_FONT_ROBOTO_12
+#define LV_FONT_ROBOTO_12     CONFIG_USE_LV_FONT_ROBOTO_12
 #else
-#  define LV_OBJ_FREE_PTR    0
+#define LV_FONT_ROBOTO_12     0
 #endif
 
-#ifdef CONFIG_LV_OBJ_REALIGN
-#  define LV_OBJ_REALIGN    CONFIG_LV_OBJ_REALIGN
+#ifdef CONFIG_USE_LV_FONT_ROBOTO_16
+#define LV_FONT_ROBOTO_16     CONFIG_USE_LV_FONT_ROBOTO_16
 #else
-#  define LV_OBJ_REALIGN    0
+#define LV_FONT_ROBOTO_16     0
 #endif
 
-/* LV OBJ X USAGE */
-/* Simple object */
-
-/* Label (dependencies: - */
-
-#ifdef CONFIG_USE_LV_LABEL
-#  define USE_LV_LABEL       CONFIG_USE_LV_LABEL
-#  ifdef CONFIG_LV_LABEL_SCROLL_SPEED
-#    define LV_LABEL_SCROLL_SPEED  CONFIG_LV_LABEL_SCROLL_SPEED
-#  else
-#    define LV_LABEL_SCROLL_SPEED  25
-#  endif
+#ifdef CONFIG_USE_LV_FONT_ROBOTO_22
+#define LV_FONT_ROBOTO_22     CONFIG_USE_LV_FONT_ROBOTO_22
 #else
-#  define USE_LV_LABEL       0
+#define LV_FONT_ROBOTO_22     0
 #endif
 
-/* Image (dependencies: lv_label (if symbols are enabled) from misc: FSINT,
- * UFS)
- */
-
-#ifdef CONFIG_USE_LV_IMG
-#  define USE_LV_IMG         CONFIG_USE_LV_IMG
+#ifdef CONFIG_USE_LV_FONT_ROBOTO_28
+#define LV_FONT_ROBOTO_28     CONFIG_USE_LV_FONT_ROBOTO_28
 #else
-#  define USE_LV_IMG         0
+#define LV_FONT_ROBOTO_28     0
 #endif
 
-#ifdef CONFIG_LV_IMG_CF_INDEXED
-#  define LV_IMG_CF_INDEXED  CONFIG_LV_IMG_CF_INDEXED
-#else
-#  define LV_IMG_CF_INDEXED  0
-#endif
+/* Demonstrate special features */
+#define LV_FONT_ROBOTO_12_SUBPX 1
+#define LV_FONT_ROBOTO_28_COMPRESSED 1  /*bpp = 3*/
 
-#ifdef CONFIG_LV_IMG_CF_ALPHA
-#  define LV_IMG_CF_ALPHA    CONFIG_LV_IMG_CF_ALPHA
+/*Pixel perfect monospace font
+ * http://pelulamu.net/unscii/ */
+#ifdef CONFIG_USE_LV_FONT_UNSCII_8
+#define LV_FONT_UNSCII_8      CONFIG_USE_LV_FONT_UNSCII_8
 #else
-#  define LV_IMG_CF_ALPHA    0
+#define LV_FONT_UNSCII_8      0
 #endif
 
-/* Line (dependencies: - */
+/* Optionally declare your custom fonts here.
+ * You can use these fonts as default font too
+ * and they will be available globally. E.g.
+ * #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \
+ *                                LV_FONT_DECLARE(my_font_2)
+ */
+#define LV_FONT_CUSTOM_DECLARE
 
-#ifdef CONFIG_USE_LV_LINE
-#  define USE_LV_LINE        CONFIG_USE_LV_LINE
-#else
-#  define USE_LV_LINE        0
+/*Always set a default font from the built-in fonts*/
+#ifdef CONFIG_LV_FONT_DEFAULT_ROBOTO_12
+#define LV_FONT_DEFAULT        &lv_font_roboto_12
 #endif
 
-#ifdef CONFIG_USE_LV_ARC
-#  define USE_LV_ARC         CONFIG_USE_LV_ARC
-#else
-#  define USE_LV_ARC         0
+#ifdef CONFIG_LV_FONT_DEFAULT_ROBOTO_16
+#define LV_FONT_DEFAULT        &lv_font_roboto_16
 #endif
 
-/* Container objects */
-/* Container (dependencies: - */
-
-#ifdef CONFIG_USE_LV_CONT
-#  define USE_LV_CONT        CONFIG_USE_LV_CONT
-#else
-#  define USE_LV_CONT        0
+#ifdef CONFIG_LV_FONT_DEFAULT_ROBOTO_22
+#define LV_FONT_DEFAULT        &lv_font_roboto_22
 #endif
 
-/* Page (dependencies: lv_cont) */
-
-#ifdef CONFIG_USE_LV_PAGE
-#  define USE_LV_PAGE        CONFIG_USE_LV_PAGE
-#else
-#  define USE_LV_PAGE        0
+#ifdef CONFIG_LV_FONT_DEFAULT_ROBOTO_28
+#define LV_FONT_DEFAULT        &lv_font_roboto_28
 #endif
 
-/* Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page) */
-
-#ifdef CONFIG_USE_LV_WIN
-#  define USE_LV_WIN         CONFIG_USE_LV_WIN
-#else
-#  define USE_LV_WIN         0
+#ifdef CONFIG_LV_FONT_DEFAULT_UNSCII_8
+#define LV_FONT_DEFAULT        &lv_font_unscii_8
 #endif
 
-/* Tab (dependencies: lv_page, lv_btnm) */
+/* Enable it if you have fonts with a lot of characters.
+ * The limit depends on the font size, font face and bpp
+ * but with > 10,000 characters if you see issues probably you need to enable it.*/
+#define LV_FONT_FMT_TXT_LARGE   0
 
-#ifdef CONFIG_USE_LV_TABVIEW
-#  define USE_LV_TABVIEW     CONFIG_USE_LV_TABVIEW
-#  ifdef CONFIG_LV_TABVIEW_ANIM_TIME
-#    define LV_TABVIEW_ANIM_TIME   CONFIG_LV_TABVIEW_ANIM_TIME
-#  else
-#    define LV_TABVIEW_ANIM_TIME   0
-#  endif
+/* Set the pixel order of the display.
+ * Important only if "subpx fonts" are used.
+ * With "normal" font it doesn't matter.
+ */
+#define LV_FONT_SUBPX_BGR    0
+
+/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
+typedef void * lv_font_user_data_t;
+
+/*=================
+ *  Text settings
+ *=================*/
+
+/* Select a character encoding for strings.
+ * Your IDE or editor should have the same character encoding
+ * - LV_TXT_ENC_UTF8
+ * - LV_TXT_ENC_ASCII
+ * */
+#define LV_TXT_ENC LV_TXT_ENC_UTF8
+
+ /*Can break (wrap) texts on these chars*/
+#define LV_TXT_BREAK_CHARS                  " ,.;:-_"
+
+/* If a word is at least this long, will break wherever "prettiest"
+ * To disable, set to a value <= 0 */
+#define LV_TXT_LINE_BREAK_LONG_LEN          12
+
+/* Minimum number of characters in a long word to put on a line before a break.
+ * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
+#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN  3
+
+/* Minimum number of characters in a long word to put on a line after a break.
+ * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
+#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
+
+/* The control character to use for signalling text recoloring. */
+#define LV_TXT_COLOR_CMD "#"
+
+/* Support bidirectional texts.
+ * Allows mixing Left-to-Right and Right-to-Left texts.
+ * The direction will be processed according to the Unicode Bidirectioanl Algorithm:
+ * https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
+#define LV_USE_BIDI     0
+#if LV_USE_BIDI
+/* Set the default direction. Supported values:
+ * `LV_BIDI_DIR_LTR` Left-to-Right
+ * `LV_BIDI_DIR_RTL` Right-to-Left
+ * `LV_BIDI_DIR_AUTO` detect texts base direction */
+#define LV_BIDI_BASE_DIR_DEF  LV_BIDI_DIR_AUTO
+#endif
+
+/*Change the built in (v)snprintf functions*/
+#define LV_SPRINTF_CUSTOM   0
+#if LV_SPRINTF_CUSTOM
+#  define LV_SPRINTF_INCLUDE <stdio.h>
+#  define lv_snprintf     snprintf
+#  define lv_vsnprintf    vsnprintf
+#endif  /*LV_SPRINTF_CUSTOM*/
+
+/*===================
+ *  LV_OBJ SETTINGS
+ *==================*/
+
+/*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
+typedef void * lv_obj_user_data_t;
+
+/*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
+#ifdef CONFIG_LV_OBJ_REALIGN
+#define LV_USE_OBJ_REALIGN          CONFIG_LV_OBJ_REALIGN
 #else
-#  define USE_LV_TABVIEW     0
-#
+#define LV_USE_OBJ_REALIGN          0
 #endif
 
-/* Titleview (dependencies: lv_page) */
+/* Enable to make the object clickable on a larger area.
+ * LV_EXT_CLICK_AREA_OFF or 0: Disable this feature
+ * LV_EXT_CLICK_AREA_TINY: The extra area can be adjusted horizontally and vertically (0..255 px)
+ * LV_EXT_CLICK_AREA_FULL: The extra area can be adjusted in all 4 directions (-32k..+32k px)
+ */
+#define LV_USE_EXT_CLICK_AREA  LV_EXT_CLICK_AREA_OFF
+
+/*==================
+ *  LV OBJ X USAGE
+ *================*/
+/*
+ * Documentation of the object types: https://docs.littlevgl.com/#Object-types
+ */
 
-#ifdef CONFIG_USE_LV_TILEVIEW
-#  define USE_LV_TILEVIEW     CONFIG_USE_LV_TILEVIEW
-#  ifdef CONFIG_LV_TILEVIEW_ANIM_TIME
-#    define LV_TILEVIEW_ANIM_TIME   CONFIG_LV_TILEVIEW_ANIM_TIME
-#  else
-#    define LV_TILEVIEW_ANIM_TIME   0
-#  endif
+/*Arc (dependencies: -)*/
+#ifdef CONFIG_USE_LV_ARC
+#define LV_USE_ARC      CONFIG_USE_LV_ARC
 #else
-#  define USE_LV_TILEVIEW     0
+#define LV_USE_ARC      0
 #endif
 
-/* Data visualizer objects */
-/* Bar (dependencies: -) */
-
+/*Bar (dependencies: -)*/
 #ifdef CONFIG_USE_LV_BAR
-#  define USE_LV_BAR        CONFIG_USE_LV_BAR
+#define LV_USE_BAR      CONFIG_USE_LV_BAR
 #else
-#  define USE_LV_BAR        0
+#define LV_USE_BAR      0
 #endif
 
-/* Line meter (dependencies: bar; misc: trigo) */
-
-#ifdef CONFIG_USE_LV_LMETER
-#  define USE_LV_LMETER      CONFIG_USE_LV_LMETER
+/*Button (dependencies: lv_cont*/
+#ifdef CONFIG_USE_LV_BTN
+#define LV_USE_BTN      CONFIG_USE_LV_BTN
 #else
-#  define USE_LV_LMETER      0
+#define LV_USE_BTN      0
 #endif
 
-/* Gauge (dependencies:bar, lmeter; misc: trigo) */
-
-#ifdef CONFIG_USE_LV_GAUGE
-#  define USE_LV_GAUGE       CONFIG_USE_LV_GAUGE
+#if LV_USE_BTN != 0
+/*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/
+#ifdef CONFIG_LV_BTN_INK_EFFECT
+#define LV_BTN_INK_EFFECT      CONFIG_LV_BTN_INK_EFFECT
 #else
-#  define USE_LV_GAUGE       0
+#define LV_BTN_INK_EFFECT      0
 #endif
 
-/* Chart (dependencies: -) */
+#endif
 
-#ifdef CONFIG_USE_LV_CHART
-#  define USE_LV_CHART       CONFIG_USE_LV_CHART
+/*Button matrix (dependencies: -)*/
+#ifdef CONFIG_USE_LV_BTNM
+#define LV_USE_BTNM      CONFIG_USE_LV_BTNM
 #else
-#  define USE_LV_CHART       0
+#define LV_USE_BTNM      0
 #endif
 
-/* Table (dependencies: lv_label) */
-
-#ifdef CONFIG_USE_LV_TABLE
-#  define USE_LV_TABLE       CONFIG_USE_LV_TABLE
-#  if defined(CONFIG_LV_TABLE_COL_MAX) && CONFIG_LV_TABLE_COL_MAX > 0
-#    define LV_TABLE_COL_MAX CONFIG_LV_TABLE_COL_MAX
-#  else
-#    error "LV_TABLE_COL_MAX must be greater than 0"
-#  endif
+/*Calendar (dependencies: -)*/
+#ifdef CONFIG_USE_LV_CALENDAR
+#define LV_USE_CALENDAR      CONFIG_USE_LV_CALENDAR
 #else
-#  define USE_LV_TABLE       0
+#define LV_USE_CALENDAR      0
 #endif
 
-/* LED (dependencies: -) */
-
-#ifdef CONFIG_USE_LV_LED
-#  define USE_LV_LED         CONFIG_USE_LV_LED
+/*Canvas (dependencies: lv_img)*/
+#ifdef CONFIG_USE_LV_CANVAS
+#define LV_USE_CANVAS      CONFIG_USE_LV_CANVAS
 #else
-#  define USE_LV_LED         0
+#define LV_USE_CANVAS      0
 #endif
 
-/* Message box (dependencies: lv_rect, lv_btnm, lv_label) */
 
-#ifdef CONFIG_USE_LV_MBOX
-#  define USE_LV_MBOX        CONFIG_USE_LV_MBOX
+
+/*Check box (dependencies: lv_btn, lv_label)*/
+#ifdef CONFIG_USE_LV_CB
+#define LV_USE_CB      CONFIG_USE_LV_CB
 #else
-#  define USE_LV_MBOX        0
+#define LV_USE_CB      0
 #endif
 
-/* Text area (dependencies: lv_label, lv_page) */
-
-#ifdef CONFIG_USE_LV_TA
-#  define USE_LV_TA          CONFIG_USE_LV_TA
+/*Chart (dependencies: -)*/
+#ifdef CONFIG_USE_LV_CHART
+#define LV_USE_CHART      CONFIG_USE_LV_CHART
 #else
-#  define USE_LV_TA          0
+#define LV_USE_CHART      0
 #endif
 
-/* Spinbox (dependencies: lv_ta) */
-
-#ifdef CONFIG_USE_LV_SPINBOX
-#  define USE_LV_SPINBOX     CONFIG_USE_LV_SPINBOX
-#else
-#  define USE_LV_SPINBOX     0
+#if LV_USE_CHART
+#  define LV_CHART_AXIS_TICK_LABEL_MAX_LEN    CONFIG_LV_CHART_AXIS_TICK_LABEL_MAX_LEN
 #endif
 
-/* Calendar (dependencies: -) */
+/*Container (dependencies: -*/
+#define LV_USE_CONT     1
 
-#ifdef CONFIG_USE_LV_CALENDAR
-#  define USE_LV_CALENDAR    CONFIG_USE_LV_CALENDAR
-#else
-#  define USE_LV_CALENDAR    0
+/*Color picker (dependencies: -*/
+#define LV_USE_CPICKER   1
+
+/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
+#define LV_USE_DDLIST    1
+#if LV_USE_DDLIST != 0
+/*Open and close default animation time [ms] (0: no animation)*/
+#  define LV_DDLIST_DEF_ANIM_TIME     200
 #endif
 
-/* Preload (dependencies: lv_arc) */
+/*Gauge (dependencies:lv_bar, lv_lmeter)*/
+#define LV_USE_GAUGE    1
 
-#ifdef CONFIG_USE_LV_PRELOAD
-#  define USE_LV_PRELOAD              CONFIG_USE_LV_PRELOAD
-#  define LV_PRELOAD_DEF_ARC_LENGTH   CONFIG_LV_PRELOAD_DEF_ARC_LENGTH
-#  define LV_PRELOAD_DEF_SPIN_TIME    CONFIG_LV_PRELOAD_DEF_SPIN_TIME
-#  ifdef CONFIG_LV_PRELOAD_DEF_ANIM_SPINNING_ARC
-#    define LV_PRELOAD_DEF_ANIM       LV_PRELOAD_TYPE_SPINNING_ARC
-#  elif  CONFIG_LV_PRELOAD-DEF_ANIM_FILLSPIN_ARC
-#    define LV_PRELOAD_DEF_ANIM       LV_PRELOAD_TYPE_FILLSPIN_ARC
-#  endif
-#else
-#  define USE_LV_PRELOAD     0
+/*Image (dependencies: lv_label*/
+#define LV_USE_IMG      1
+
+/*Image Button (dependencies: lv_btn*/
+#define LV_USE_IMGBTN   1
+#if LV_USE_IMGBTN
+/*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
+#  define LV_IMGBTN_TILED 0
 #endif
 
-/*Canvas (dependencies: lv_img)*/
+/*Keyboard (dependencies: lv_btnm)*/
+#define LV_USE_KB       1
 
-#ifdef CONFIG_USE_LV_CANVAS
-#  define USE_LV_CANVAS      CONFIG_USE_LV_CANVAS
-#else
-#  define USE_LV_CANVAS      0
-#endif
+/*Label (dependencies: -*/
+#define LV_USE_LABEL    1
+#if LV_USE_LABEL != 0
+/*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode*/
+#  define LV_LABEL_DEF_SCROLL_SPEED       25
 
-/* User input objects */
+/* Waiting period at beginning/end of animation cycle */
+#  define LV_LABEL_WAIT_CHAR_COUNT        3
 
-/* Button (dependencies: lv_cont */
+/*Enable selecting text of the label */
+#  define LV_LABEL_TEXT_SEL               0
 
-#ifdef CONFIG_USE_LV_BTN
-#  define USE_LV_BTN         CONFIG_USE_LV_BTN
-#else
-#  define USE_LV_BTN         0
+/*Store extra some info in labels (12 bytes) to speed up drawing of very long texts*/
+#  define LV_LABEL_LONG_TXT_HINT          0
 #endif
 
-/* Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION) */
+/*LED (dependencies: -)*/
+#define LV_USE_LED      1
 
-#ifdef CONFIG_LV_BTN_INK_EFFECT
-#  define LV_BTN_INK_EFFECT  CONFIG_LV_BTN_INK_EFFECT
-#else
-#  define LV_BTN_INK_EFFECT  0
+/*Line (dependencies: -*/
+#define LV_USE_LINE     1
+
+/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
+#define LV_USE_LIST     1
+#if LV_USE_LIST != 0
+/*Default animation time of focusing to a list element [ms] (0: no animation)  */
+#  define LV_LIST_DEF_ANIM_TIME  100
 #endif
 
-/* Image Button (dependencies: lv_btn */
+/*Line meter (dependencies: *;)*/
+#define LV_USE_LMETER   1
 
-#ifdef CONFIG_USE_LV_IMGBTN
-#  define USE_LV_IMGBTN      CONFIG_USE_LV_IMGBTN
-#  ifdef CONFIG_LV_IMGBTN_TILED
-#    define LV_IMGBTN_TILED  CONFIG_LV_IMGBTN_TILED
-#  else
-#    define LV_IMGBTN_TILED  0
-#  endif
-#else
-#  define CONFIG)USE_LV_IMGBTN 0
+/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
+#define LV_USE_MBOX     1
+
+/*Page (dependencies: lv_cont)*/
+#define LV_USE_PAGE     1
+#if LV_USE_PAGE != 0
+/*Focus default animation time [ms] (0: no animation)*/
+#  define LV_PAGE_DEF_ANIM_TIME     400
 #endif
 
-/* Button matrix (dependencies: -) */
-#ifdef CONFIG_USE_LV_BTNM
-#  define USE_LV_BTNM        CONFIG_USE_LV_BTNM
-#else
-#  define USE_LV_BTNM        0
+/*Preload (dependencies: lv_arc, lv_anim)*/
+#define LV_USE_PRELOAD      1
+#if LV_USE_PRELOAD != 0
+#  define LV_PRELOAD_DEF_ARC_LENGTH   60      /*[deg]*/
+#  define LV_PRELOAD_DEF_SPIN_TIME    1000    /*[ms]*/
+#  define LV_PRELOAD_DEF_ANIM         LV_PRELOAD_TYPE_SPINNING_ARC
 #endif
 
-/* Keyboard (dependencies: lv_btnm) */
+/*Roller (dependencies: lv_ddlist)*/
+#define LV_USE_ROLLER    1
+#if LV_USE_ROLLER != 0
+/*Focus animation time [ms] (0: no animation)*/
+#  define LV_ROLLER_DEF_ANIM_TIME     200
 
-#ifdef CONFIG_USE_LV_KB
-#  define USE_LV_KB          CONFIG_USE_LV_KB
-#else
-#  define USE_LV_KB          0
+/*Number of extra "pages" when the roller is infinite*/
+#  define LV_ROLLER_INF_PAGES         7
 #endif
 
-/* Check box (dependencies: lv_btn, lv_label) */
+/*Slider (dependencies: lv_bar)*/
+#define LV_USE_SLIDER    1
 
-#ifdef CONFIG_USE_LV_CB
-#  define USE_LV_CB          CONFIG_USE_LV_CB
-#else
-#  define USE_LV_CB          0
-#endif
+/*Spinbox (dependencies: lv_ta)*/
+#define LV_USE_SPINBOX       1
 
-/* Switch (dependencies: lv_slider) */
+/*Switch (dependencies: lv_slider)*/
+#define LV_USE_SW       1
 
-#ifdef CONFIG_USE_LV_SW
-#  define USE_LV_SW          CONFIG_USE_LV_SW
-#else
-#  define USE_LV_SW          0
+/*Text area (dependencies: lv_label, lv_page)*/
+#define LV_USE_TA       1
+#if LV_USE_TA != 0
+#  define LV_TA_DEF_CURSOR_BLINK_TIME 400     /*ms*/
+#  define LV_TA_DEF_PWD_SHOW_TIME     1500    /*ms*/
 #endif
 
-/* List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for
- * icons))
- */
-
-#ifdef CONFIG_USE_LV_LIST
-#  define USE_LV_LIST        CONFIG_USE_LV_LIST
-#else
-#  define USE_LV_LIST        0
+/*Table (dependencies: lv_label)*/
+#define LV_USE_TABLE    1
+#if LV_USE_TABLE
+#  define LV_TABLE_COL_MAX    12
 #endif
 
-/* Drop down list (dependencies: lv_page, lv_label) */
+/*Tab (dependencies: lv_page, lv_btnm)*/
+#define LV_USE_TABVIEW      1
+#  if LV_USE_TABVIEW != 0
+/*Time of slide animation [ms] (0: no animation)*/
+#  define LV_TABVIEW_DEF_ANIM_TIME    300
+#endif
 
-#ifdef CONFIG_USE_LV_DDLIST
-#  define USE_LV_DDLIST      CONFIG_USE_LV_DDLIST
-#else
-#  define USE_LV_DDLIST      0
+/*Tileview (dependencies: lv_page) */
+#define LV_USE_TILEVIEW     1
+#if LV_USE_TILEVIEW
+/*Time of slide animation [ms] (0: no animation)*/
+#  define LV_TILEVIEW_DEF_ANIM_TIME   300
 #endif
 
-/* Roller (dependencies: lv_ddlist) */
+/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
+#define LV_USE_WIN      1
 
-#ifdef CONFIG_USE_LV_ROLLER
-#  define USE_LV_ROLLER      CONFIG_USE_LV_ROLLER
-#else
-#  define USE_LV_ROLLER      0
+/*==================
+ * Non-user section
+ *==================*/
+
+#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)    /* Disable warnings for Visual Studio*/
+#  define _CRT_SECURE_NO_WARNINGS
 #endif
 
-/* Slider (dependencies: lv_bar) */
+/*--END OF LV_CONF_H--*/
 
-#ifdef CONFIG_USE_LV_SLIDER
-#  define USE_LV_SLIDER      CONFIG_USE_LV_SLIDER
-#else
-#  define USE_LV_SLIDER      0
-#endif
+/*Be sure every define has a default value*/
+#include "lvgl/src/lv_conf_checker.h"
 
-#endif /*__APPS_GRAPHICS_LITTLEVGL_LV_CONF_H*/
+#endif /*LV_CONF_H*/


[incubator-nuttx-apps] 03/15: apps/examples/lvgldemo: Update fb flush callback for LVGL V6.1.2

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 25876e822206b4146affb4cc58a5072af4d44f0f
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Tue Apr 7 01:00:56 2020 +0000

    apps/examples/lvgldemo: Update fb flush callback for LVGL V6.1.2
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I72a6ff628f2ea2b0b505e444c84b266ba3a28d87
---
 examples/lvgldemo/fbdev.c | 80 +++++++++++++++++++++++++----------------------
 examples/lvgldemo/fbdev.h |  9 +++---
 2 files changed, 47 insertions(+), 42 deletions(-)

diff --git a/examples/lvgldemo/fbdev.c b/examples/lvgldemo/fbdev.c
index 2e6b53d..e462c60 100644
--- a/examples/lvgldemo/fbdev.c
+++ b/examples/lvgldemo/fbdev.c
@@ -171,8 +171,8 @@ int fbdev_init(void)
    * address mapping to make the memory accessible to the application.
    */
 
-  state.fbmem = mmap(NULL, state.pinfo.fblen, PROT_READ|PROT_WRITE,
-                     MAP_SHARED|MAP_FILE, state.fd, 0);
+  state.fbmem = mmap(NULL, state.pinfo.fblen, PROT_READ | PROT_WRITE,
+                     MAP_SHARED | MAP_FILE, state.fd, 0);
   if (state.fbmem == MAP_FAILED)
     {
       int errcode = errno;
@@ -205,12 +205,16 @@ int fbdev_init(void)
  *
  ****************************************************************************/
 
-void fbdev_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
-                 FAR const lv_color_t *color_p)
+void fbdev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                 lv_color_t *color_p)
 {
 #ifdef CONFIG_LCD_UPDATE
   struct nxgl_rect_s rect;
 #endif
+  int32_t x1 = area->x1;
+  int32_t y1 = area->y1;
+  int32_t x2 = area->x2;
+  int32_t y2 = area->y2;
   int32_t act_x1;
   int32_t act_y1;
   int32_t act_x2;
@@ -253,7 +257,7 @@ void fbdev_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   if (state.pinfo.bpp == 8)
     {
-      uint8_t *fbp8 = (uint8_t*)state.fbmem;
+      uint8_t *fbp8 = (uint8_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
@@ -272,7 +276,7 @@ void fbdev_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   if (state.pinfo.bpp == 16)
     {
-      uint16_t *fbp16 = (uint16_t*)state.fbmem;
+      uint16_t *fbp16 = (uint16_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
@@ -291,7 +295,7 @@ void fbdev_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   if (state.pinfo.bpp == 24 || state.pinfo.bpp == 32)
     {
-      uint32_t *fbp32 = (uint32_t*)state.fbmem;
+      uint32_t *fbp32 = (uint32_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
@@ -318,7 +322,7 @@ void fbdev_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   /* Tell the flushing is ready */
 
-  lv_flush_ready();
+  lv_disp_flush_ready(disp_drv);
 }
 
 /****************************************************************************
@@ -387,7 +391,7 @@ void fbdev_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   if (state.pinfo.bpp == 8)
     {
-      uint8_t *fbp8 = (uint8_t*)state.fbmem;
+      uint8_t *fbp8 = (uint8_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
@@ -403,7 +407,7 @@ void fbdev_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   if (state.pinfo.bpp == 16)
     {
-      uint16_t *fbp16 = (uint16_t*)state.fbmem;
+      uint16_t *fbp16 = (uint16_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
@@ -419,7 +423,7 @@ void fbdev_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   if (state.pinfo.bpp == 24 || state.pinfo.bpp == 32)
     {
-      uint32_t *fbp32 = (uint32_t*)state.fbmem;
+      uint32_t *fbp32 = (uint32_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
@@ -508,58 +512,58 @@ void fbdev_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 
   if (state.pinfo.bpp == 8)
     {
-      uint8_t *fbp8 = (uint8_t*)state.fbmem;
+      uint8_t *fbp8 = (uint8_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
       for (y = act_y1; y <= act_y2; y++)
         {
-            for (x = act_x1; x <= act_x2; x++)
-              {
-                location = x + (y * state.vinfo.xres);
-                fbp8[location] = color_p->full;
-                color_p++;
-              }
-
-            color_p += x2 - act_x2;
+          for (x = act_x1; x <= act_x2; x++)
+            {
+              location = x + (y * state.vinfo.xres);
+              fbp8[location] = color_p->full;
+              color_p++;
+            }
+
+          color_p += x2 - act_x2;
         }
     }
 
   if (state.pinfo.bpp == 16)
     {
-      uint16_t *fbp16 = (uint16_t*)state.fbmem;
+      uint16_t *fbp16 = (uint16_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
       for (y = act_y1; y <= act_y2; y++)
         {
-            for (x = act_x1; x <= act_x2; x++)
-              {
-                location = x + (y * state.vinfo.xres);
-                fbp16[location] = color_p->full;
-                color_p++;
-              }
-
-            color_p += x2 - act_x2;
+          for (x = act_x1; x <= act_x2; x++)
+            {
+              location = x + (y * state.vinfo.xres);
+              fbp16[location] = color_p->full;
+              color_p++;
+            }
+
+          color_p += x2 - act_x2;
         }
     }
 
   if (state.pinfo.bpp == 24 || state.pinfo.bpp == 32)
     {
-      uint32_t *fbp32 = (uint32_t*)state.fbmem;
+      uint32_t *fbp32 = (uint32_t *)state.fbmem;
       uint32_t x;
       uint32_t y;
 
       for (y = act_y1; y <= act_y2; y++)
         {
-            for (x = act_x1; x <= act_x2; x++)
-              {
-                location = x + (y * state.vinfo.xres);
-                fbp32[location] = color_p->full;
-                color_p++;
-              }
-
-            color_p += x2 - act_x2;
+          for (x = act_x1; x <= act_x2; x++)
+            {
+              location = x + (y * state.vinfo.xres);
+              fbp32[location] = color_p->full;
+              color_p++;
+            }
+
+          color_p += x2 - act_x2;
         }
     }
 
diff --git a/examples/lvgldemo/fbdev.h b/examples/lvgldemo/fbdev.h
index 0df0f34..24446d3 100644
--- a/examples/lvgldemo/fbdev.h
+++ b/examples/lvgldemo/fbdev.h
@@ -53,14 +53,15 @@ extern "C"
  ****************************************************************************/
 
 int fbdev_init(void);
-void fbdev_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
-                 FAR const lv_color_t *color_p);
-void fbdev_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
+void fbdev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                 lv_color_t *color_p);
+void fbdev_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
+                lv_color_t color);
 void fbdev_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
                FAR const lv_color_t *color_p);
 
 #ifdef __cplusplus
-} /* extern "C" */
+}
 #endif
 
 #endif /*__APPS_EXAMPLES_LVGLDEMO_FBDEV_H */


[incubator-nuttx-apps] 09/15: examples/lvgldemo: Port all demos to LVGL V6.1.2

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 94b8dbe7aa043dbae1ca1ba2ceaaf5b34105cc0d
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Thu Apr 9 09:14:22 2020 +0000

    examples/lvgldemo: Port all demos to LVGL V6.1.2
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: Ie139af71e88d887bffefcd9b97977124c5a9e1c3
---
 examples/lvgldemo/Kconfig           |   5 +
 examples/lvgldemo/demo.h            |   6 +
 examples/lvgldemo/lv_test_theme_1.c | 559 +++++++++++++++++-------------------
 examples/lvgldemo/lv_test_theme_2.c | 409 +++++++++++++-------------
 4 files changed, 469 insertions(+), 510 deletions(-)

diff --git a/examples/lvgldemo/Kconfig b/examples/lvgldemo/Kconfig
index c2de77a..b7f1778 100644
--- a/examples/lvgldemo/Kconfig
+++ b/examples/lvgldemo/Kconfig
@@ -39,6 +39,11 @@ config EXAMPLES_LVGLDEMO_WALLPAPER
 	depends on EXAMPLES_LVGLDEMO_SIMPLE
 	default y
 
+config EXAMPLES_LVGLDEMO_SLIDE_SHOW
+	bool "Use slide"
+	depends on EXAMPLES_LVGLDEMO_SIMPLE
+	default n
+
 choice
 	prompt "Selected Theme"
 	depends on EXAMPLES_LVGLDEMO_THEME_1
diff --git a/examples/lvgldemo/demo.h b/examples/lvgldemo/demo.h
index 37251d1..18e9050 100644
--- a/examples/lvgldemo/demo.h
+++ b/examples/lvgldemo/demo.h
@@ -50,6 +50,12 @@
 #  define LV_DEMO_WALLPAPER 0
 #endif
 
+#ifdef CONFIG_EXAMPLES_LVGLDEMO_SLIDE_SHOW
+#  define LV_DEMO_SLIDE_SHOW 1
+#else
+#  define LV_DEMO_SLIDE_SHOW 0
+#endif
+
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
diff --git a/examples/lvgldemo/lv_test_theme_1.c b/examples/lvgldemo/lv_test_theme_1.c
index 8aefb4f..cd8fec6 100644
--- a/examples/lvgldemo/lv_test_theme_1.c
+++ b/examples/lvgldemo/lv_test_theme_1.c
@@ -83,183 +83,164 @@ static void create_tab3(FAR lv_obj_t *parent);
  *
  ****************************************************************************/
 
-static void create_tab1(FAR lv_obj_t *parent)
+static void create_tab1(lv_obj_t * parent)
 {
-  FAR lv_theme_t *th;
-  FAR lv_obj_t *h;
-  FAR lv_obj_t *btn;
-  FAR lv_obj_t *btn_label;
-  FAR lv_obj_t *label;
-  FAR lv_obj_t *btnm;
-  FAR lv_obj_t *table;
-  FAR lv_obj_t *sw_h;
-  FAR lv_obj_t *sw;
-  FAR lv_obj_t *bar;
-  FAR lv_obj_t *slider;
-  FAR lv_obj_t *line;
-  FAR lv_obj_t *cb;
-  FAR lv_obj_t *list_btn;
-  FAR lv_obj_t *list;
-  FAR lv_obj_t *roller;
-
-  static lv_style_t h_style;
-  static const char *btnm_str[] =
-  {
-    "1", "2", "3", SYMBOL_OK, SYMBOL_CLOSE, ""
-  };
-
-  static const lv_point_t line_p[] =
-  {
-    { 0, 0 }, { LV_HOR_RES / 5, 0 }
-  };
-
-  lv_page_set_scrl_layout(parent, LV_LAYOUT_PRETTY);
-
-  th = lv_theme_get_current();
-
-  lv_style_copy(&h_style, &lv_style_transp);
-  h_style.body.padding.inner    = LV_DPI / 4;
-  h_style.body.padding.hor      = LV_DPI / 4;
-  h_style.body.padding.ver      = LV_DPI / 6;
-
-  h = lv_cont_create(parent, NULL);
-  lv_obj_set_style(h, &h_style);
-  lv_obj_set_click(h, false);
-  lv_cont_set_fit(h, true, true);
-  lv_cont_set_layout(h, LV_LAYOUT_COL_M);
-
-  btn = lv_btn_create(h, NULL);
-  lv_btn_set_style(btn, LV_BTN_STYLE_REL, th->btn.rel);
-  lv_btn_set_style(btn, LV_BTN_STYLE_PR, th->btn.pr);
-  lv_btn_set_style(btn, LV_BTN_STYLE_TGL_REL, th->btn.tgl_rel);
-  lv_btn_set_style(btn, LV_BTN_STYLE_TGL_PR, th->btn.tgl_pr);
-  lv_btn_set_style(btn, LV_BTN_STYLE_INA, th->btn.ina);
-  lv_btn_set_fit(btn, true, true);
-  lv_btn_set_toggle(btn, true);
-
-  btn_label = lv_label_create(btn, NULL);
-  lv_label_set_text(btn_label, "Button");
-
-  btn = lv_btn_create(h, btn);
-  lv_btn_toggle(btn);
-  btn_label = lv_label_create(btn, NULL);
-  lv_label_set_text(btn_label, "Toggled");
-
-  btn = lv_btn_create(h, btn);
-  lv_btn_set_state(btn, LV_BTN_STATE_INA);
-  btn_label = lv_label_create(btn, NULL);
-  lv_label_set_text(btn_label, "Inactive");
-
-  label = lv_label_create(h, NULL);
-  lv_label_set_text(label, "Primary");
-  lv_obj_set_style(label, th->label.prim);
-
-  label = lv_label_create(h, NULL);
-  lv_label_set_text(label, "Secondary");
-  lv_obj_set_style(label, th->label.sec);
-
-  label = lv_label_create(h, NULL);
-  lv_label_set_text(label, "Hint");
-  lv_obj_set_style(label, th->label.hint);
-
-  btnm = lv_btnm_create(h, NULL);
-  lv_obj_set_size(btnm, LV_HOR_RES / 4, 2 * LV_DPI / 3);
-  lv_btnm_set_map(btnm, btnm_str);
-  lv_btnm_set_toggle(btnm, true, 3);
-
-#if LVGL_VERSION_MAJOR == 5 && LVGL_VERSION_MINOR >= 3
-  table = lv_table_create(h, NULL);
-  lv_table_set_col_cnt(table, 3);
-  lv_table_set_row_cnt(table, 4);
-  lv_table_set_col_width(table, 0, LV_DPI / 3);
-  lv_table_set_col_width(table, 1, LV_DPI / 2);
-  lv_table_set_col_width(table, 2, LV_DPI / 2);
-  lv_table_set_cell_merge_right(table, 0, 0, true);
-  lv_table_set_cell_merge_right(table, 0, 1, true);
-
-  lv_table_set_cell_value(table, 0, 0, "Table");
-  lv_table_set_cell_align(table, 0, 0, LV_LABEL_ALIGN_CENTER);
-
-  lv_table_set_cell_value(table, 1, 0, "1");
-  lv_table_set_cell_value(table, 1, 1, "13");
-  lv_table_set_cell_align(table, 1, 1, LV_LABEL_ALIGN_RIGHT);
-  lv_table_set_cell_value(table, 1, 2, "ms");
-
-  lv_table_set_cell_value(table, 2, 0, "2");
-  lv_table_set_cell_value(table, 2, 1, "46");
-  lv_table_set_cell_align(table, 2, 1, LV_LABEL_ALIGN_RIGHT);
-  lv_table_set_cell_value(table, 2, 2, "ms");
-
-  lv_table_set_cell_value(table, 3, 0, "3");
-  lv_table_set_cell_value(table, 3, 1, "61");
-  lv_table_set_cell_align(table, 3, 1, LV_LABEL_ALIGN_RIGHT);
-  lv_table_set_cell_value(table, 3, 2, "ms");
-#endif
-
-  h = lv_cont_create(parent, h);
-
-  sw_h = lv_cont_create(h, NULL);
-  lv_cont_set_style(sw_h, &lv_style_transp);
-  lv_cont_set_fit(sw_h, false, true);
-  lv_obj_set_width(sw_h, LV_HOR_RES / 4);
-  lv_cont_set_layout(sw_h, LV_LAYOUT_PRETTY);
-
-  sw = lv_sw_create(sw_h, NULL);
-#if LVGL_VERSION_MAJOR == 5 && LVGL_VERSION_MINOR >= 3
-  lv_sw_set_anim_time(sw, 250);
-#endif
-
-  sw = lv_sw_create(sw_h, sw);
-  lv_sw_on(sw);
-
-  bar = lv_bar_create(h, NULL);
-  lv_bar_set_value(bar, 70);
-
-  slider = lv_slider_create(h, NULL);
-  lv_bar_set_value(slider, 70);
-
-  line   = lv_line_create(h, NULL);
-  lv_line_set_points(line, line_p, 2);
-  lv_line_set_style(line, th->line.decor);
-
-  cb = lv_cb_create(h, NULL);
-
-  cb = lv_cb_create(h, cb);
-  lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
-
-  lv_obj_t * ddlist = lv_ddlist_create(h, NULL);
-  lv_ddlist_open(ddlist, false);
-  lv_ddlist_set_selected(ddlist, 1);
-
-  h = lv_cont_create(parent, h);
-
-  list = lv_list_create(h, NULL);
-  list_btn = lv_list_add(list, SYMBOL_GPS,  "GPS",  NULL);
-  lv_obj_set_size(list, LV_HOR_RES / 4, LV_VER_RES / 2);
-  lv_btn_set_toggle(list_btn, true);
-  lv_list_add(list, SYMBOL_WIFI, "WiFi", NULL);
-  lv_list_add(list, SYMBOL_GPS, "GPS", NULL);
-  lv_list_add(list, SYMBOL_AUDIO, "Audio", NULL);
-  lv_list_add(list, SYMBOL_VIDEO, "Video", NULL);
-  lv_list_add(list, SYMBOL_CALL, "Call", NULL);
-  lv_list_add(list, SYMBOL_BELL, "Bell", NULL);
-  lv_list_add(list, SYMBOL_FILE, "File", NULL);
-  lv_list_add(list, SYMBOL_EDIT, "Edit", NULL);
-  lv_list_add(list, SYMBOL_CUT,  "Cut",  NULL);
-  lv_list_add(list, SYMBOL_COPY, "Copy", NULL);
-
-  roller = lv_roller_create(h, NULL);
-  lv_roller_set_options(roller,
-                        "Monday\n"
-                        "Tuesday\n"
-                        "Wednesday\n"
-                        "Thursday\n"
-                        "Friday\n"
-                        "Saturday\n"
-                        "Sunday");
-
-  lv_roller_set_selected(roller, 1, false);
-  lv_roller_set_visible_row_count(roller, 3);
+    lv_page_set_scrl_layout(parent, LV_LAYOUT_PRETTY);
+
+    lv_theme_t * th = lv_theme_get_current();
+
+    static lv_style_t h_style;
+    lv_style_copy(&h_style, &lv_style_transp);
+    h_style.body.padding.inner = LV_DPI / 10;
+    h_style.body.padding.left = LV_DPI / 4;
+    h_style.body.padding.right = LV_DPI / 4;
+    h_style.body.padding.top = LV_DPI / 10;
+    h_style.body.padding.bottom = LV_DPI / 10;
+
+    lv_obj_t * h = lv_cont_create(parent, NULL);
+    lv_obj_set_style(h, &h_style);
+    lv_obj_set_click(h, false);
+    lv_cont_set_fit(h, LV_FIT_TIGHT);
+    lv_cont_set_layout(h, LV_LAYOUT_COL_M);
+
+    lv_obj_t * btn = lv_btn_create(h, NULL);
+    lv_btn_set_fit(btn, LV_FIT_TIGHT);
+    lv_btn_set_toggle(btn, true);
+    lv_obj_t * btn_label = lv_label_create(btn, NULL);
+    lv_label_set_text(btn_label, "Button");
+
+    btn = lv_btn_create(h, btn);
+    lv_btn_toggle(btn);
+    btn_label = lv_label_create(btn, NULL);
+    lv_label_set_text(btn_label, "Toggled");
+
+    btn = lv_btn_create(h, btn);
+    lv_btn_set_state(btn, LV_BTN_STATE_INA);
+    btn_label = lv_label_create(btn, NULL);
+    lv_label_set_text(btn_label, "Inactive");
+
+    lv_obj_t * label = lv_label_create(h, NULL);
+    lv_label_set_text(label, "Primary");
+    lv_obj_set_style(label, th->style.label.prim);
+
+    label = lv_label_create(h, NULL);
+    lv_label_set_text(label, "Secondary");
+    lv_obj_set_style(label, th->style.label.sec);
+
+    label = lv_label_create(h, NULL);
+    lv_label_set_text(label, "Hint");
+    lv_obj_set_style(label, th->style.label.hint);
+
+    static const char * btnm_str[] =
+      {
+        "1", "2", "3", LV_SYMBOL_OK, LV_SYMBOL_CLOSE, ""
+      };
+
+    lv_obj_t * btnm = lv_btnm_create(h, NULL);
+    lv_obj_set_size(btnm, lv_disp_get_hor_res(NULL) / 4, 2 * LV_DPI / 3);
+    lv_btnm_set_map(btnm, btnm_str);
+    lv_btnm_set_btn_ctrl_all(btnm, LV_BTNM_CTRL_TGL_ENABLE);
+    lv_btnm_set_one_toggle(btnm, true);
+
+    lv_obj_t * table = lv_table_create(h, NULL);
+    lv_table_set_col_cnt(table, 3);
+    lv_table_set_row_cnt(table, 4);
+    lv_table_set_col_width(table, 0, LV_DPI / 3);
+    lv_table_set_col_width(table, 1, LV_DPI / 2);
+    lv_table_set_col_width(table, 2, LV_DPI / 2);
+    lv_table_set_cell_merge_right(table, 0, 0, true);
+    lv_table_set_cell_merge_right(table, 0, 1, true);
+
+    lv_table_set_cell_value(table, 0, 0, "Table");
+    lv_table_set_cell_align(table, 0, 0, LV_LABEL_ALIGN_CENTER);
+
+    lv_table_set_cell_value(table, 1, 0, "1");
+    lv_table_set_cell_value(table, 1, 1, "13");
+    lv_table_set_cell_align(table, 1, 1, LV_LABEL_ALIGN_RIGHT);
+    lv_table_set_cell_value(table, 1, 2, "ms");
+
+    lv_table_set_cell_value(table, 2, 0, "2");
+    lv_table_set_cell_value(table, 2, 1, "46");
+    lv_table_set_cell_align(table, 2, 1, LV_LABEL_ALIGN_RIGHT);
+    lv_table_set_cell_value(table, 2, 2, "ms");
+
+    lv_table_set_cell_value(table, 3, 0, "3");
+    lv_table_set_cell_value(table, 3, 1, "61");
+    lv_table_set_cell_align(table, 3, 1, LV_LABEL_ALIGN_RIGHT);
+    lv_table_set_cell_value(table, 3, 2, "ms");
+
+    h = lv_cont_create(parent, h);
+
+    lv_obj_t * sw_h = lv_cont_create(h, NULL);
+    lv_cont_set_style(sw_h, LV_CONT_STYLE_MAIN, &lv_style_transp);
+    lv_cont_set_fit2(sw_h, LV_FIT_NONE, LV_FIT_TIGHT);
+    lv_obj_set_width(sw_h, LV_HOR_RES / 4);
+    lv_cont_set_layout(sw_h, LV_LAYOUT_PRETTY);
+
+    lv_obj_t * sw = lv_sw_create(sw_h, NULL);
+    lv_sw_set_anim_time(sw, 250);
+
+    sw = lv_sw_create(sw_h, sw);
+    lv_sw_on(sw, LV_ANIM_OFF);
+
+    lv_obj_t * bar = lv_bar_create(h, NULL);
+    lv_bar_set_value(bar, 70, false);
+
+    lv_obj_t * slider = lv_slider_create(h, NULL);
+    lv_bar_set_value(slider, 70, false);
+
+    lv_obj_t * line = lv_line_create(h, NULL);
+    static lv_point_t line_p[2];
+    line_p[0].x = 0;
+    line_p[0].y = 0;
+    line_p[1].x = lv_disp_get_hor_res(NULL) / 5;
+    line_p[1].y = 0;
+
+    lv_line_set_points(line, line_p, 2);
+    lv_line_set_style(line, LV_LINE_STYLE_MAIN, th->style.line.decor);
+
+    lv_obj_t * cb = lv_cb_create(h, NULL);
+
+    cb = lv_cb_create(h, cb);
+    lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
+
+    lv_obj_t * ddlist = lv_ddlist_create(h, NULL);
+    lv_ddlist_set_fix_width(ddlist, lv_obj_get_width(ddlist) + LV_DPI / 2);
+    lv_ddlist_set_draw_arrow(ddlist, true);
+
+    h = lv_cont_create(parent, h);
+
+    lv_obj_t * list = lv_list_create(h, NULL);
+    lv_obj_set_size(list,
+                    lv_disp_get_hor_res(NULL) / 4,
+                    lv_disp_get_ver_res(NULL) / 2);
+    lv_obj_t * list_btn;
+    list_btn = lv_list_add_btn(list, LV_SYMBOL_GPS,  "GPS");
+    lv_btn_set_toggle(list_btn, true);
+
+    lv_list_add_btn(list, LV_SYMBOL_WIFI, "WiFi");
+    lv_list_add_btn(list, LV_SYMBOL_GPS, "GPS");
+    lv_list_add_btn(list, LV_SYMBOL_AUDIO, "Audio");
+    lv_list_add_btn(list, LV_SYMBOL_VIDEO, "Video");
+    lv_list_add_btn(list, LV_SYMBOL_CALL, "Call");
+    lv_list_add_btn(list, LV_SYMBOL_BELL, "Bell");
+    lv_list_add_btn(list, LV_SYMBOL_FILE, "File");
+    lv_list_add_btn(list, LV_SYMBOL_EDIT, "Edit");
+    lv_list_add_btn(list, LV_SYMBOL_CUT,  "Cut");
+    lv_list_add_btn(list, LV_SYMBOL_COPY, "Copy");
+
+    lv_obj_t * roller = lv_roller_create(h, NULL);
+    lv_roller_set_options(roller,
+                          "Monday\n"
+                          "Tuesday\n"
+                          "Wednesday\n"
+                          "Thursday\n"
+                          "Friday\n"
+                          "Saturday\n"
+                          "Sunday",
+                          true);
+    lv_roller_set_selected(roller, 1, false);
+    lv_roller_set_visible_row_count(roller, 3);
 }
 
 /****************************************************************************
@@ -280,56 +261,45 @@ static void create_tab1(FAR lv_obj_t *parent)
 
 static void create_tab2(lv_obj_t * parent)
 {
-  lv_coord_t w;
-  lv_obj_t *chart;
-  lv_chart_series_t *s1;
-  lv_obj_t *gauge;
-  lv_obj_t *arc;
-  lv_obj_t *ta;
-  lv_obj_t *kb;
-#if USE_LV_ANIMATION
-  lv_obj_t *loader;
-#endif
-
-  w = lv_page_get_scrl_width(parent);
-
-  chart = lv_chart_create(parent, NULL);
-  lv_obj_set_size(chart, w / 3, LV_VER_RES / 3);
-  lv_obj_set_pos(chart, LV_DPI / 10, LV_DPI / 10);
-
-  s1 = lv_chart_add_series(chart, LV_COLOR_RED);
-  lv_chart_set_next(chart, s1, 30);
-  lv_chart_set_next(chart, s1, 20);
-  lv_chart_set_next(chart, s1, 10);
-  lv_chart_set_next(chart, s1, 12);
-  lv_chart_set_next(chart, s1, 20);
-  lv_chart_set_next(chart, s1, 27);
-  lv_chart_set_next(chart, s1, 35);
-  lv_chart_set_next(chart, s1, 55);
-  lv_chart_set_next(chart, s1, 70);
-  lv_chart_set_next(chart, s1, 75);
-
-  gauge = lv_gauge_create(parent, NULL);
-  lv_gauge_set_value(gauge, 0, 40);
-  lv_obj_set_size(gauge, w / 4, w / 4);
-  lv_obj_align(gauge, chart, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 4);
-
-  arc = lv_arc_create(parent, NULL);
-  lv_obj_align(arc, gauge, LV_ALIGN_OUT_BOTTOM_MID, 0, LV_DPI / 8);
-
-  ta = lv_ta_create(parent, NULL);
-  lv_obj_set_size(ta, w / 3, LV_VER_RES / 4);
-  lv_obj_align(ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -LV_DPI / 10, LV_DPI / 10);
-  lv_ta_set_cursor_type(ta, LV_CURSOR_BLOCK);
-
-  kb = lv_kb_create(parent, NULL);
-  lv_obj_set_size(kb, 2 * w / 3, LV_VER_RES / 3);
-  lv_obj_align(kb, ta, LV_ALIGN_OUT_BOTTOM_RIGHT, 0, LV_DPI);
-  lv_kb_set_ta(kb, ta);
-
-#if USE_LV_ANIMATION
-  loader = lv_preload_create(parent, NULL);
-  lv_obj_align(loader, NULL, LV_ALIGN_CENTER, 0, -LV_DPI);
+    lv_coord_t w = lv_page_get_scrl_width(parent);
+
+    lv_obj_t * chart = lv_chart_create(parent, NULL);
+    lv_chart_set_type(chart, LV_CHART_TYPE_AREA);
+    lv_obj_set_size(chart, w / 3, lv_disp_get_ver_res(NULL) / 3);
+    lv_obj_set_pos(chart, LV_DPI / 10, LV_DPI / 10);
+    lv_chart_series_t * s1 = lv_chart_add_series(chart, LV_COLOR_RED);
+    lv_chart_set_next(chart, s1, 30);
+    lv_chart_set_next(chart, s1, 20);
+    lv_chart_set_next(chart, s1, 10);
+    lv_chart_set_next(chart, s1, 12);
+    lv_chart_set_next(chart, s1, 20);
+    lv_chart_set_next(chart, s1, 27);
+    lv_chart_set_next(chart, s1, 35);
+    lv_chart_set_next(chart, s1, 55);
+    lv_chart_set_next(chart, s1, 70);
+    lv_chart_set_next(chart, s1, 75);
+
+    lv_obj_t * gauge = lv_gauge_create(parent, NULL);
+    lv_gauge_set_value(gauge, 0, 40);
+    lv_obj_set_size(gauge, w / 4, w / 4);
+    lv_obj_align(gauge, chart, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 4);
+
+    lv_obj_t * arc = lv_arc_create(parent, NULL);
+    lv_obj_align(arc, gauge, LV_ALIGN_OUT_BOTTOM_MID, 0, LV_DPI / 8);
+
+    lv_obj_t * ta = lv_ta_create(parent, NULL);
+    lv_obj_set_size(ta, w / 3, lv_disp_get_ver_res(NULL) / 4);
+    lv_obj_align(ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -LV_DPI / 10, LV_DPI / 10);
+    lv_ta_set_cursor_type(ta, LV_CURSOR_BLOCK);
+
+    lv_obj_t * kb = lv_kb_create(parent, NULL);
+    lv_obj_set_size(kb, 2 * w / 3, lv_disp_get_ver_res(NULL) / 3);
+    lv_obj_align(kb, ta, LV_ALIGN_OUT_BOTTOM_RIGHT, 0, LV_DPI);
+    lv_kb_set_ta(kb, ta);
+
+#if LV_USE_ANIMATION
+    lv_obj_t * loader = lv_preload_create(parent, NULL);
+    lv_obj_align(loader, NULL, LV_ALIGN_CENTER, 0, - LV_DPI);
 #endif
 }
 
@@ -351,89 +321,82 @@ static void create_tab2(lv_obj_t * parent)
 
 static void create_tab3(lv_obj_t *parent)
 {
-  FAR lv_obj_t *win;
-  FAR lv_obj_t *label;
-  FAR lv_obj_t *lmeter;
-  FAR lv_obj_t *led1;
-  FAR lv_obj_t *led2;
-  FAR lv_obj_t *page;
-  FAR lv_obj_t *cal;
-  FAR lv_obj_t *mbox;
-
-  static lv_calendar_date_t highlighted_days[2];
-
-  static const char *mbox_btn_map[] =
-  {
-    "\211", "\222Got it!", "\211", ""
-  };
-
   /* Create a Window */
 
-  win = lv_win_create(parent, NULL);
-
-  lv_win_add_btn(win, SYMBOL_CLOSE, lv_win_close_action);
-  lv_win_add_btn(win, SYMBOL_DOWN, NULL);
-  lv_obj_set_size(win, LV_HOR_RES / 2, LV_VER_RES / 2);
+  lv_obj_t *win = lv_win_create(parent, NULL);
+  lv_obj_t *win_btn = lv_win_add_btn(win, LV_SYMBOL_CLOSE);
+  lv_obj_set_event_cb(win_btn, lv_win_close_event_cb);
+  lv_win_add_btn(win, LV_SYMBOL_DOWN);
+  lv_obj_set_size(win, lv_disp_get_hor_res(NULL) / 2,
+                       lv_disp_get_ver_res(NULL) / 2);
   lv_obj_set_pos(win, LV_DPI / 20, LV_DPI / 20);
   lv_obj_set_top(win, true);
 
   /* Create a Label in the Window */
 
-  label = lv_label_create(win, NULL);
+  lv_obj_t *label = lv_label_create(win, NULL);
   lv_label_set_text(label, "Label in the window");
 
-  /* Create a Line meter in the Window */
+  /* Create a  Line meter in the Window */
 
-  lmeter = lv_lmeter_create(win, NULL);
+  lv_obj_t *lmeter = lv_lmeter_create(win, NULL);
   lv_obj_align(lmeter, label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 2);
   lv_lmeter_set_value(lmeter, 70);
 
-  /* Create 2 LEDs in the Window */
+  /* Create a 2 LEDs in the Window */
 
-  led1 = lv_led_create(win, NULL);
+  lv_obj_t *led1 = lv_led_create(win, NULL);
   lv_obj_align(led1, lmeter, LV_ALIGN_OUT_RIGHT_MID, LV_DPI / 2, 0);
   lv_led_on(led1);
 
-  led2 = lv_led_create(win, NULL);
+  lv_obj_t *led2 = lv_led_create(win, NULL);
   lv_obj_align(led2, led1, LV_ALIGN_OUT_RIGHT_MID, LV_DPI / 2, 0);
   lv_led_off(led2);
 
   /* Create a Page */
 
-  page = lv_page_create(parent, NULL);
-  lv_obj_set_size(page, LV_HOR_RES / 3, LV_VER_RES / 2);
+  lv_obj_t *page = lv_page_create(parent, NULL);
+  lv_obj_set_size(page, lv_disp_get_hor_res(NULL) / 3,
+                        lv_disp_get_ver_res(NULL) / 2);
   lv_obj_set_top(page, true);
-  lv_obj_align(page, win, LV_ALIGN_IN_TOP_RIGHT,  LV_DPI, LV_DPI);
+  lv_obj_align(page, win, LV_ALIGN_IN_TOP_RIGHT, LV_DPI, LV_DPI);
 
   label = lv_label_create(page, NULL);
   lv_label_set_text(label,
-              "Lorem ipsum dolor sit amet, repudiare voluptatibus pri cu.\n"
-              "Ei mundi pertinax posidonium eum, cum tempor maiorum at,\n"
-              "mea fuisset assentior ad. Usu cu suas civibus iudicabit.\n"
-              "Eum eu congue tempor facilisi. Tale hinc unum te vim.\n"
-              "Te cum populo animal eruditi, labitur inciderint at nec.\n\n"
-              "Eius corpora et quo. Everti voluptaria instructior est id,\n"
-              "vel in falli primis. Mea ei porro essent admodum,\n"
-              "his ei malis quodsi, te quis aeterno his.\n"
-              "Qui tritani recusabo reprehendunt ne,\n"
-              "per duis explicari at. Simul mediocritatem mei et.");
-
-  lv_page_set_scrl_fit(page, true, true);
+                    "Lorem ipsum dolor sit amet, "
+                    "repudiare voluptatibus pri cu.\n"
+                    "Ei mundi pertinax posidonium eum,"
+                    " cum tempor maiorum at,\n"
+                    "mea fuisset assentior ad. "
+                    "Usu cu suas civibus iudicabit.\n"
+                    "Eum eu congue tempor facilisi. "
+                    "Tale hinc unum te vim.\n"
+                    "Te cum populo animal eruditi,"
+                    "labitur inciderint at nec.\n\n"
+                    "Eius corpora et quo. Everti"
+                    "voluptaria instructior est id,\n"
+                    "vel in falli primis."
+                    "Mea ei porro essent admodum,\n"
+                    "his ei malis quodsi, te quis aeterno his.\n"
+                    "Qui tritani recusabo reprehendunt ne,\n"
+                    "per duis explicari at."
+                    " Simul mediocritatem mei et.");
 
   /* Create a Calendar */
 
-  cal = lv_calendar_create(parent, NULL);
+  lv_obj_t *cal = lv_calendar_create(parent, NULL);
   lv_obj_set_size(cal, 5 * LV_DPI / 2, 5 * LV_DPI / 2);
   lv_obj_align(cal, page, LV_ALIGN_OUT_RIGHT_TOP, -LV_DPI / 2, LV_DPI / 3);
   lv_obj_set_top(cal, true);
 
-  highlighted_days[0].day   = 5;
+  static lv_calendar_date_t highlighted_days[2];
+  highlighted_days[0].day = 5;
   highlighted_days[0].month = 5;
-  highlighted_days[0].year  = 2019;
+  highlighted_days[0].year = 2018;
 
-  highlighted_days[1].day   = 8;
+  highlighted_days[1].day = 8;
   highlighted_days[1].month = 5;
-  highlighted_days[1].year  = 2019;
+  highlighted_days[1].year = 2018;
 
   lv_calendar_set_highlighted_dates(cal, highlighted_days, 2);
   lv_calendar_set_today_date(cal, &highlighted_days[0]);
@@ -441,10 +404,19 @@ static void create_tab3(lv_obj_t *parent)
 
   /* Create a Message box */
 
-  mbox = lv_mbox_create(parent, NULL);
+  static const char *mbox_btn_map[] =
+    {
+      " ", "Got it!", " ", ""
+    };
+
+  lv_obj_t *mbox = lv_mbox_create(parent, NULL);
   lv_mbox_set_text(mbox,
-          "Click on the window or the page to bring it to the foreground");
-  lv_mbox_add_btns(mbox, mbox_btn_map, NULL);
+                   "Click on the window or the page"
+                   " to bring it to the foreground");
+  lv_mbox_add_btns(mbox, mbox_btn_map);
+  lv_btnm_set_btn_ctrl(lv_mbox_get_btnm(mbox), 0, LV_BTNM_CTRL_HIDDEN);
+  lv_btnm_set_btn_width(lv_mbox_get_btnm(mbox), 1, 7);
+  lv_btnm_set_btn_ctrl(lv_mbox_get_btnm(mbox), 2, LV_BTNM_CTRL_HIDDEN);
   lv_obj_set_top(mbox, true);
 }
 
@@ -456,7 +428,8 @@ static void create_tab3(lv_obj_t *parent)
  * Name: lv_test_theme_1
  *
  * Description:
- *   Create a test screen with a lot objects and apply the given theme on them
+ *   Create a test screen with a lot objects and apply
+ * the given theme on them
  *
  * Input Parameters:
  *   th - pointer to a theme
@@ -469,32 +442,22 @@ static void create_tab3(lv_obj_t *parent)
  *
  ****************************************************************************/
 
-void lv_test_theme_1(lv_theme_t *th)
+void lv_test_theme_1(lv_theme_t * th)
 {
-  FAR lv_obj_t *scr;
-  FAR lv_obj_t *tv;
-  FAR lv_obj_t *tab1;
-  FAR lv_obj_t *tab2;
-  FAR lv_obj_t *tab3;
-
   lv_theme_set_current(th);
 
-  /* If `LV_THEME_LIVE_UPDATE  1` `th` is not used directly so get the real
-   * theme after set
-   */
+  /* If `LV_THEME_LIVE_UPDATE  1` `th` is not used directly so get the real theme after set */
 
   th = lv_theme_get_current();
-
-  scr = lv_cont_create(NULL, NULL);
-  lv_scr_load(scr);
-  lv_cont_set_style(scr, th->bg);
-
-  tv = lv_tabview_create(scr, NULL);
-  lv_obj_set_size(tv, LV_HOR_RES, LV_VER_RES);
-
-  tab1 = lv_tabview_add_tab(tv, "Tab 1");
-  tab2 = lv_tabview_add_tab(tv, "Tab 2");
-  tab3 = lv_tabview_add_tab(tv, "Tab 3");
+  FAR lv_obj_t * scr = lv_cont_create(NULL, NULL);
+  lv_disp_load_scr(scr);
+
+  FAR lv_obj_t * tv = lv_tabview_create(scr, NULL);
+  lv_obj_set_size(tv, lv_disp_get_hor_res(NULL),
+                      lv_disp_get_ver_res(NULL));
+  FAR lv_obj_t * tab1 = lv_tabview_add_tab(tv, "Tab 1");
+  FAR lv_obj_t * tab2 = lv_tabview_add_tab(tv, "Tab 2");
+  FAR lv_obj_t * tab3 = lv_tabview_add_tab(tv, "Tab 3");
 
   create_tab1(tab1);
   create_tab2(tab2);
diff --git a/examples/lvgldemo/lv_test_theme_2.c b/examples/lvgldemo/lv_test_theme_2.c
index 29022a0..bcc016c 100644
--- a/examples/lvgldemo/lv_test_theme_2.c
+++ b/examples/lvgldemo/lv_test_theme_2.c
@@ -36,7 +36,6 @@
 #include <graphics/lvgl.h>
 
 #include "lv_test_theme_2.h"
-#include "lv_misc/lv_math.h"
 
 #ifdef CONFIG_EXAMPLES_LVGLDEMO_THEME_2
 
@@ -55,9 +54,10 @@
 static void header_create(void);
 static void sb_create(void);
 static void content_create(void);
-static lv_res_t theme_select_action(lv_obj_t *roller);
-static lv_res_t hue_select_action(lv_obj_t *roller);
+static void theme_select_event_handler(lv_obj_t *roller, lv_event_t event);
+static void hue_select_event_cb(lv_obj_t *roller, lv_event_t event);
 static void init_all_themes(uint16_t hue);
+static void bar_set_value(lv_obj_t *bar, int16_t value);
 
 /****************************************************************************
  * Private Data
@@ -68,26 +68,27 @@ static lv_obj_t   *sb;
 static lv_obj_t   *content;
 static lv_theme_t *th_act;
 
-static const char *th_options = {
-#if USE_LV_THEME_NIGHT
+static const char *th_options =
+{
+#if LV_USE_THEME_NIGHT
   "Night"
 #endif
-#if USE_LV_THEME_MATERIAL
+#if LV_USE_THEME_MATERIAL
   "\nMaterial"
 #endif
-#if USE_LV_THEME_ALIEN
+#if LV_USE_THEME_ALIEN
   "\nAlien"
 #endif
-#if USE_LV_THEME_ZEN
+#if LV_USE_THEME_ZEN
   "\nZen"
 #endif
-#if USE_LV_THEME_NEMO
+#if LV_USE_THEME_NEMO
   "\nNemo"
 #endif
-#if USE_LV_THEME_MONO
+#if LV_USE_THEME_MONO
   "\nMono"
 #endif
-#if USE_LV_THEME_DEFAULT
+#if LV_USE_THEME_DEFAULT
   "\nDefault"
 #endif
   ""
@@ -121,34 +122,22 @@ static lv_theme_t *themes[8];
 
 static void header_create(void)
 {
-  lv_obj_t *sym;
-  lv_obj_t *clock;
-
-  /* Create the global header object */
-
-  header = lv_cont_create(lv_scr_act(), NULL);
-  lv_obj_set_width(header, LV_HOR_RES);
+  header = lv_cont_create(lv_disp_get_scr_act(NULL), NULL);
+  lv_obj_set_width(header, lv_disp_get_hor_res(NULL));
 
-  /* Add a few symbols */
-
-  sym = lv_label_create(header, NULL);
+  lv_obj_t *sym = lv_label_create(header, NULL);
   lv_label_set_text(sym,
-                    SYMBOL_GPS " "
-                    SYMBOL_WIFI " "
-                    SYMBOL_BLUETOOTH " "
-                    SYMBOL_VOLUME_MAX);
-
+                    LV_SYMBOL_GPS
+                    LV_SYMBOL_WIFI
+                    LV_SYMBOL_BLUETOOTH
+                    LV_SYMBOL_VOLUME_MAX);
   lv_obj_align(sym, NULL, LV_ALIGN_IN_RIGHT_MID, -LV_DPI / 10, 0);
 
-  /* Create a fake clock */
-
-  clock = lv_label_create(header, NULL);
+  lv_obj_t *clock = lv_label_create(header, NULL);
   lv_label_set_text(clock, "14:21");
   lv_obj_align(clock, NULL, LV_ALIGN_IN_LEFT_MID, LV_DPI / 10, 0);
 
-  /* Let the height set automatically */
-
-  lv_cont_set_fit(header, false, true);
+  lv_cont_set_fit2(header, LV_FIT_NONE, LV_FIT_TIGHT);
   lv_obj_set_pos(header, 0, 0);
 }
 
@@ -170,42 +159,42 @@ static void header_create(void)
 
 static void sb_create(void)
 {
-  lv_obj_t *th_label;
-  lv_obj_t *th_roller;
-  lv_obj_t *hue_label;
-  lv_obj_t *hue_roller;
+  lv_coord_t hres = lv_disp_get_hor_res(NULL);
+  lv_coord_t vres = lv_disp_get_ver_res(NULL);
 
-  sb = lv_page_create(lv_scr_act(), NULL);
+  sb = lv_page_create(lv_disp_get_scr_act(NULL), NULL);
   lv_page_set_scrl_layout(sb, LV_LAYOUT_COL_M);
   lv_page_set_style(sb, LV_PAGE_STYLE_BG, &lv_style_transp_tight);
   lv_page_set_style(sb, LV_PAGE_STYLE_SCRL, &lv_style_transp);
 
-  th_label = lv_label_create(sb, NULL);
+  lv_obj_t *th_label = lv_label_create(sb, NULL);
   lv_label_set_text(th_label, "Theme");
 
-  th_roller = lv_roller_create(sb, NULL);
-  lv_roller_set_options(th_roller, th_options);
-  lv_roller_set_action(th_roller, theme_select_action);
+  lv_obj_t *th_roller = lv_roller_create(sb, NULL);
+  lv_roller_set_options(th_roller, th_options, true);
+  lv_obj_set_event_cb(th_roller, theme_select_event_handler);
 
-  hue_label = lv_label_create(sb, NULL);
+  lv_obj_t *hue_label = lv_label_create(sb, NULL);
   lv_label_set_text(hue_label, "\nColor");
 
-  hue_roller = lv_roller_create(sb, NULL);
-  lv_roller_set_options(hue_roller,
-                "0\n30\n60\n90\n120\n150\n180\n210\n240\n270\n300\n330");
-  lv_roller_set_action(hue_roller, hue_select_action);
-
-#if LV_HOR_RES > LV_VER_RES
-  lv_obj_set_height(sb, LV_VER_RES - lv_obj_get_height(header));
-  lv_cont_set_fit(sb, true, false);
-  lv_page_set_scrl_fit(sb, true, false);
-  lv_obj_align(sb, header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
-  lv_page_set_sb_mode(sb, LV_SB_MODE_DRAG);
-#else
-  lv_obj_set_size(sb, LV_HOR_RES, LV_VER_RES / 2 - lv_obj_get_height(header));
-  lv_obj_align(sb, header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
-  lv_page_set_sb_mode(sb, LV_SB_MODE_AUTO);
-#endif
+  lv_obj_t *hue_roller = lv_roller_create(sb, NULL);
+  lv_roller_set_options(hue_roller, "0\n30\n60\n90\n120\n150\n"
+                                    "180\n210\n240\n270\n300\n330", true);
+  lv_obj_set_event_cb(hue_roller, hue_select_event_cb);
+
+  if (hres > vres)
+    {
+      lv_obj_set_height(sb, vres - lv_obj_get_height(header));
+      lv_cont_set_fit2(sb, LV_FIT_TIGHT, LV_FIT_NONE);
+      lv_obj_align(sb, header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
+      lv_page_set_sb_mode(sb, LV_SB_MODE_DRAG);
+    }
+  else
+    {
+      lv_obj_set_size(sb, hres, vres / 2 - lv_obj_get_height(header));
+      lv_obj_align(sb, header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
+      lv_page_set_sb_mode(sb, LV_SB_MODE_AUTO);
+    }
 }
 
 /****************************************************************************
@@ -227,67 +216,44 @@ static void sb_create(void)
 
 static void content_create(void)
 {
-  FAR lv_obj_t *btn;
-  FAR lv_obj_t *label;
-  FAR lv_obj_t *sw;
-  FAR lv_obj_t *bar;
-  FAR lv_obj_t *slider;
-  FAR lv_obj_t *lmeter;
-  FAR lv_obj_t *gauge;
-  FAR lv_obj_t *ta;
-  FAR lv_obj_t *ddlist;
-  FAR lv_obj_t *kb;
-  FAR lv_obj_t *mbox;
-  FAR lv_obj_t *roller;
-
-  lv_coord_t max_w;
-
-  lv_anim_t a;
-
-  static const char *nums = "One\nTwo\nThree\nFour";
+  lv_coord_t hres = lv_disp_get_hor_res(NULL);
+  lv_coord_t vres = lv_disp_get_ver_res(NULL);
 
-  static const char *days =
-    "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday";
+  content = lv_page_create(lv_disp_get_scr_act(NULL), NULL);
 
-  static const char *mbox_btns[] =
-  {
-    "Ok", ""
-  };
-
-  content = lv_page_create(lv_scr_act(), NULL);
-
-#if LV_HOR_RES > LV_VER_RES
-  lv_obj_set_size(content, LV_HOR_RES - lv_obj_get_width(
-                    sb), LV_VER_RES - lv_obj_get_height(header));
-  lv_obj_set_pos(content,  lv_obj_get_width(sb), lv_obj_get_height(header));
-#else
-  lv_obj_set_size(content, LV_HOR_RES, LV_VER_RES / 2);
-  lv_obj_set_pos(content,  0, LV_VER_RES / 2);
-#endif
+  if (hres > vres)
+    {
+      lv_obj_set_size(content,
+                      hres - lv_obj_get_width(sb),
+                      vres - lv_obj_get_height(header));
+      lv_obj_set_pos(content,
+                     lv_obj_get_width(sb),
+                     lv_obj_get_height(header));
+    }
+  else
+    {
+      lv_obj_set_size(content, hres, vres / 2);
+      lv_obj_set_pos(content, 0, vres / 2);
+    }
 
   lv_page_set_scrl_layout(content, LV_LAYOUT_PRETTY);
+  lv_page_set_scrl_fit2(content, LV_FIT_FLOOD, LV_FIT_TIGHT);
 
-  max_w = lv_page_get_fit_width(content);
+  lv_coord_t max_w = lv_page_get_fit_width(content);
 
   /* Button */
 
-  btn = lv_btn_create(content, NULL);
+  lv_obj_t *btn = lv_btn_create(content, NULL);
   lv_btn_set_ink_in_time(btn, 200);
   lv_btn_set_ink_wait_time(btn, 100);
   lv_btn_set_ink_out_time(btn, 500);
-
-  label = lv_label_create(btn, NULL);
+  lv_obj_t *label = lv_label_create(btn, NULL);
   lv_label_set_text(label, "Button");
 
   /* Switch */
 
-  sw = lv_sw_create(content, NULL);
-
-#if USE_LV_ANIMATION
-#if LVGL_VERSION_MAJOR == 5 && LVGL_VERSION_MINOR >= 3
+  lv_obj_t *sw = lv_sw_create(content, NULL);
   lv_sw_set_anim_time(sw, 250);
-#endif
-#endif
 
   /* Check box */
 
@@ -295,165 +261,172 @@ static void content_create(void)
 
   /* Bar */
 
-  bar = lv_bar_create(content, NULL);
+  lv_obj_t *bar = lv_bar_create(content, NULL);
   lv_obj_set_width(bar, LV_MATH_MIN(max_w, 3 * LV_DPI / 2));
-
-#if USE_LV_ANIMATION
-  a.var             = bar;
-  a.start           = 0;
-  a.end             = 100;
-  a.fp              = (lv_anim_fp_t)lv_bar_set_value;
-  a.path            = lv_anim_path_linear;
-  a.end_cb          = NULL;
-  a.act_time        = 0;
-  a.time            = 1000;
-  a.playback        = 1;
-  a.playback_pause  = 100;
-  a.repeat          = 1;
-  a.repeat_pause    = 100;
+#if LV_USE_ANIMATION
+  lv_anim_t a;
+  a.var = bar;
+  a.start = 0;
+  a.end = 100;
+  a.exec_cb = (lv_anim_exec_xcb_t)bar_set_value;
+  a.path_cb = lv_anim_path_linear;
+  a.ready_cb = NULL;
+  a.act_time = 0;
+  a.time = 1000;
+  a.playback = 1;
+  a.playback_pause = 100;
+  a.repeat = 1;
+  a.repeat_pause = 100;
   lv_anim_create(&a);
 #endif
 
   /* Slider */
 
-  slider = lv_slider_create(content, NULL);
+  lv_obj_t *slider = lv_slider_create(content, NULL);
   lv_obj_set_width(slider, LV_MATH_MIN(max_w, 3 * LV_DPI / 2));
-  lv_slider_set_value(slider, 30);
+  lv_slider_set_value(slider, 30, false);
 
   /* Roller */
 
-  roller = lv_roller_create(content, NULL);
-  lv_roller_set_options(roller, days);
+  static const char *days = "Monday\nTuesday\nWednesday\n"
+                            "Thursday\nFriday\nSaturday\nSunday";
+  lv_obj_t *roller = lv_roller_create(content, NULL);
+  lv_roller_set_options(roller, days, false);
 
   /* Drop down list */
 
-  ddlist   = lv_ddlist_create(content, NULL);
+  static const char *nums = "One\nTwo\nThree\nFour";
+  lv_obj_t *ddlist = lv_ddlist_create(content, NULL);
   lv_ddlist_set_options(ddlist, nums);
 
   /* Line meter */
 
-  lmeter = lv_lmeter_create(content, NULL);
+  lv_obj_t *lmeter = lv_lmeter_create(content, NULL);
   lv_obj_set_click(lmeter, false);
-#if USE_LV_ANIMATION
-  a.var             = lmeter;
-  a.start           = 0;
-  a.end             = 100;
-  a.fp              = (lv_anim_fp_t)lv_lmeter_set_value;
-  a.path            = lv_anim_path_linear;
-  a.end_cb          = NULL;
-  a.act_time        = 0;
-  a.time            = 1000;
-  a.playback        = 1;
-  a.playback_pause  = 100;
-  a.repeat          = 1;
-  a.repeat_pause    = 100;
+#if LV_USE_ANIMATION
+  a.var = lmeter;
+  a.start = 0;
+  a.end = 100;
+  a.exec_cb = (lv_anim_exec_xcb_t)lv_lmeter_set_value;
+  a.path_cb = lv_anim_path_linear;
+  a.ready_cb = NULL;
+  a.act_time = 0;
+  a.time = 1000;
+  a.playback = 1;
+  a.playback_pause = 100;
+  a.repeat = 1;
+  a.repeat_pause = 100;
   lv_anim_create(&a);
 #endif
 
   /* Gauge */
 
-  gauge = lv_gauge_create(content, NULL);
+  lv_obj_t *gauge = lv_gauge_create(content, NULL);
   lv_gauge_set_value(gauge, 0, 47);
   lv_obj_set_size(gauge, LV_MATH_MIN(max_w, LV_DPI * 3 / 2),
-                  LV_MATH_MIN(max_w, LV_DPI * 3 / 2));
+                         LV_MATH_MIN(max_w, LV_DPI * 3 / 2));
   lv_obj_set_click(gauge, false);
 
   /* Text area */
 
-  ta = lv_ta_create(content, NULL);
+  lv_obj_t *ta = lv_ta_create(content, NULL);
   lv_obj_set_width(ta, LV_MATH_MIN(max_w, LV_DPI * 3 / 2));
   lv_ta_set_one_line(ta, true);
   lv_ta_set_text(ta, "Type...");
 
   /* Keyboard */
 
-  kb = lv_kb_create(content, NULL);
-  lv_obj_set_width(kb, LV_MATH_MIN(max_w, LV_DPI * 3));
+  lv_obj_t *kb = lv_kb_create(content, NULL);
+  lv_obj_set_width(kb, max_w - LV_DPI / 4);
   lv_kb_set_ta(kb, ta);
 
-  /* Message Box */
-
-  mbox = lv_mbox_create(lv_scr_act(), NULL);
+  lv_obj_t *mbox = lv_mbox_create(lv_disp_get_scr_act(NULL), NULL);
   lv_obj_set_drag(mbox, true);
   lv_mbox_set_text(mbox, "Choose a theme and a color on the left!");
 
-  lv_mbox_add_btns(mbox, mbox_btns, NULL);
+  static const char *mbox_btns[] =
+      {
+        "Ok", ""
+      };
+
+  lv_mbox_add_btns(mbox, mbox_btns);
 
   lv_obj_align(mbox, NULL, LV_ALIGN_CENTER, 0, 0);
 }
 
 /****************************************************************************
- * Name: theme_select_action
+ * Name: theme_select_event_handler
  *
  * Description:
- *   Callback for the theme selection roller
+ *   Callback for the theme selection event
  *
  * Input Parameters:
  *   roller - the roller object that triggered the action
- *
- * Returned Value:
- *   LV_RES_OK in all cases
+ *   event - the theme select evnet type
  *
  * Assumptions/Limitations:
  *
  ****************************************************************************/
 
-static lv_res_t theme_select_action(lv_obj_t *roller)
+static void theme_select_event_handler(lv_obj_t *roller, lv_event_t event)
 {
-  uint16_t opt;
-
-  opt = lv_roller_get_selected(roller);
-
-  th_act = themes[opt];
-  lv_theme_set_current(th_act);
-
-  lv_obj_align(header, NULL, LV_ALIGN_IN_TOP_MID, 0, 0);
-  lv_obj_align(sb, header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
-
-#if LV_HOR_RES > LV_VER_RES
-  lv_obj_set_size(content,
-                  LV_HOR_RES - lv_obj_get_width(sb),
-                  LV_VER_RES - lv_obj_get_height(header));
-  lv_obj_set_pos(content,  lv_obj_get_width(sb), lv_obj_get_height(header));
-#else
-  lv_obj_set_size(content, LV_HOR_RES, LV_VER_RES / 2);
-  lv_obj_set_pos(content,  0, LV_VER_RES / 2);
-#endif
-
-  lv_page_focus(sb, roller, 200);
-
-  return LV_RES_OK;
+  if (event == LV_EVENT_VALUE_CHANGED)
+    {
+      lv_coord_t hres = lv_disp_get_hor_res(NULL);
+      lv_coord_t vres = lv_disp_get_ver_res(NULL);
+
+      uint16_t opt = lv_roller_get_selected(roller);
+      th_act = themes[opt];
+      lv_theme_set_current(th_act);
+
+      lv_obj_align(header, NULL, LV_ALIGN_IN_TOP_MID, 0, 0);
+      lv_obj_align(sb, header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
+
+      if (hres > vres)
+        {
+          lv_obj_set_size(content,
+                          hres - lv_obj_get_width(sb),
+                          vres - lv_obj_get_height(header));
+          lv_obj_set_pos(content,
+                         lv_obj_get_width(sb),
+                         lv_obj_get_height(header));
+        }
+      else
+        {
+          lv_obj_set_size(content, hres, vres / 2);
+          lv_obj_set_pos(content, 0, vres / 2);
+        }
+
+      lv_page_focus(sb, roller, LV_ANIM_ON);
+    }
 }
 
 /****************************************************************************
- * Name: hue_select_action
+ * Name: hue_select_event_cb
  *
  * Description:
- *   Callback for the hue roller object upon selection change
+ *   Callback for the hue selection event
  *
  * Input Parameters:
  *   roller - the roller object that triggered the action
- *
- * Returned Value:
- *   LV_RES_OK in all cases
+ *   event - the hue select evnet type
  *
  * Assumptions/Limitations:
  *
  ****************************************************************************/
 
-static lv_res_t hue_select_action(lv_obj_t * roller)
+static void hue_select_event_cb(lv_obj_t *roller, lv_event_t event)
 {
-  uint16_t hue;
-
-  hue = lv_roller_get_selected(roller) * 30;
-
-  init_all_themes(hue);
+  if (event == LV_EVENT_VALUE_CHANGED)
+    {
+      uint16_t hue = lv_roller_get_selected(roller) * 30;
 
-  lv_theme_set_current(th_act);
+      init_all_themes(hue);
 
-  lv_page_focus(sb, roller, 200);
+      lv_theme_set_current(th_act);
 
-  return LV_RES_OK;
+      lv_page_focus(sb, roller, LV_ANIM_ON);
+    }
 }
 
 /****************************************************************************
@@ -475,38 +448,54 @@ static lv_res_t hue_select_action(lv_obj_t * roller)
 
 static void init_all_themes(uint16_t hue)
 {
-  int i = 0;
-
-#if USE_LV_THEME_NIGHT
-  themes[i++] = lv_theme_night_init(hue, NULL);
+    int i = 0;
+#if LV_USE_THEME_NIGHT
+    themes[i++] = lv_theme_night_init(hue, NULL);
 #endif
 
-#if USE_LV_THEME_MATERIAL
-  themes[i++] = lv_theme_material_init(hue, NULL);
+#if LV_USE_THEME_MATERIAL
+    themes[i++] = lv_theme_material_init(hue, NULL);
 #endif
 
-#if USE_LV_THEME_ALIEN
-  themes[i++] = lv_theme_alien_init(hue, NULL);
+#if LV_USE_THEME_ALIEN
+    themes[i++] = lv_theme_alien_init(hue, NULL);
 #endif
 
-#if USE_LV_THEME_ZEN
-  themes[i++] = lv_theme_zen_init(hue, NULL);
+#if LV_USE_THEME_ZEN
+    themes[i++] = lv_theme_zen_init(hue, NULL);
 #endif
 
-#if USE_LV_THEME_NEMO
-  themes[i++] = lv_theme_nemo_init(hue, NULL);
+#if LV_USE_THEME_NEMO
+    themes[i++] = lv_theme_nemo_init(hue, NULL);
 #endif
 
-#if USE_LV_THEME_MONO
-  themes[i++] = lv_theme_mono_init(hue, NULL);
+#if LV_USE_THEME_MONO
+    themes[i++] = lv_theme_mono_init(hue, NULL);
 #endif
 
-#if USE_LV_THEME_DEFAULT
-  themes[i++] = lv_theme_default_init(hue, NULL);
+#if LV_USE_THEME_DEFAULT
+    themes[i++] = lv_theme_default_init(hue, NULL);
 #endif
 }
 
 /****************************************************************************
+ * Name: bar_set_value
+ *
+ * Description:
+ *   Initialize all compiled-in themes to a hue
+ *
+ * Input Parameters:
+ *   bar - bar instance
+ *   value - value of bar
+ *
+ ****************************************************************************/
+
+static void bar_set_value(lv_obj_t *bar, int16_t value)
+{
+    lv_bar_set_value(bar, value, LV_ANIM_OFF);
+}
+
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
@@ -528,14 +517,10 @@ static void init_all_themes(uint16_t hue)
 
 void lv_test_theme_2(void)
 {
-  lv_obj_t *scr;
-
   /* By doing this, we hide the first (empty) option. */
 
   if (th_options[0] == '\n')
-    {
-      th_options++;
-    }
+    th_options++;
 
   init_all_themes(0);
   th_act = themes[0];
@@ -547,8 +532,8 @@ void lv_test_theme_2(void)
 
   lv_theme_set_current(th_act);
 
-  scr = lv_obj_create(NULL, NULL);
-  lv_scr_load(scr);
+  lv_obj_t *scr = lv_obj_create(NULL, NULL);
+  lv_disp_load_scr(scr);
 
   header_create();
   sb_create();


[incubator-nuttx-apps] 08/15: apps/examples/lvgldemo: Port new simple demo from LVGL V6.1.2

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 13606dc253fce671519e267d5765565a412e093c
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Tue Apr 7 01:37:14 2020 +0000

    apps/examples/lvgldemo: Port new simple demo from LVGL V6.1.2
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I1051edc15b6f66ce34d2f813964e0e8630ec351f
---
 examples/lvgldemo/demo.c | 529 ++++++++++++++++++++++++++---------------------
 1 file changed, 293 insertions(+), 236 deletions(-)

diff --git a/examples/lvgldemo/demo.c b/examples/lvgldemo/demo.c
index 5b3e189..b7d3723 100644
--- a/examples/lvgldemo/demo.c
+++ b/examples/lvgldemo/demo.c
@@ -52,16 +52,17 @@
  ****************************************************************************/
 
 static void write_create(lv_obj_t *parent);
-static lv_res_t keyboard_open_close(lv_obj_t *ta);
-static lv_res_t keyboard_hide_action(lv_obj_t *keyboard);
-static void kb_hide_anim_end(lv_obj_t *keyboard);
+static void text_area_event_handler(lv_obj_t *text_area, lv_event_t event);
+static void keyboard_event_cb(lv_obj_t *keyboard, lv_event_t event);
+#if LV_USE_ANIMATION
+static void kb_hide_anim_end(lv_anim_t *a);
+#endif
 static void list_create(lv_obj_t *parent);
 static void chart_create(lv_obj_t *parent);
-static lv_res_t slider_action(lv_obj_t *slider);
-static lv_res_t list_btn_action(lv_obj_t *slider);
-
+static void slider_event_handler(lv_obj_t *slider, lv_event_t event);
+static void list_btn_event_handler(lv_obj_t *slider, lv_event_t event);
 #if LV_DEMO_SLIDE_SHOW
-static void tab_switcher(void *tv);
+static void tab_switcher(lv_task_t *task);
 #endif
 
 /****************************************************************************
@@ -72,12 +73,18 @@ FAR static lv_obj_t *chart;
 FAR static lv_obj_t *ta;
 FAR static lv_obj_t *kb;
 
+static const char *mbox_btns[] =
+{
+  "Got it",
+  ""
+};
+
 static lv_style_t style_kb;
 static lv_style_t style_kb_rel;
 static lv_style_t style_kb_pr;
 
 #if LV_DEMO_WALLPAPER
-LV_IMG_DECLARE(img_bubble_pattern);
+LV_IMG_DECLARE(img_bubble_pattern)
 #endif
 
 /****************************************************************************
@@ -89,14 +96,13 @@ LV_IMG_DECLARE(img_bubble_pattern);
  ****************************************************************************/
 
 /****************************************************************************
- * Name: write_create
+ * Name: kb_hide_anim_end
  *
  * Description:
- *   Create a text-area and keyboard, each composing half of the
- *   parent container.
+ *   Process the evnet of anim
  *
  * Input Parameters:
- *   parent  - the lv_page_t* container to create the "write" page within
+ *   a  - the handler of anim
  *
  * Returned Value:
  *   none
@@ -106,109 +112,190 @@ LV_IMG_DECLARE(img_bubble_pattern);
  *
  ****************************************************************************/
 
-static void write_create(lv_obj_t *parent)
+#if LV_USE_ANIMATION
+static void kb_hide_anim_end(lv_anim_t *a)
 {
-  static lv_style_t style_ta;
-
-  lv_page_set_style(parent, LV_PAGE_STYLE_BG, &lv_style_transp_fit);
-  lv_page_set_style(parent, LV_PAGE_STYLE_SCRL, &lv_style_transp_fit);
-
-  lv_page_set_sb_mode(parent, LV_SB_MODE_OFF);
-
-  lv_style_copy(&style_ta, &lv_style_pretty);
-  style_ta.body.opa     = LV_OPA_30;
-  style_ta.body.radius  = 0;
-  style_ta.text.color   = LV_COLOR_HEX3(0x222);
+  lv_obj_del(a->var);
+  kb = NULL;
+}
+#endif
 
-  ta = lv_ta_create(parent, NULL);
-  lv_obj_set_size(ta, lv_page_get_scrl_width(parent),
-                      lv_obj_get_height(parent) / 2);
-  lv_ta_set_style(ta, LV_TA_STYLE_BG, &style_ta);
-  lv_ta_set_text(ta, "");
-  lv_page_set_rel_action(ta, keyboard_open_close);
+/****************************************************************************
+ * Name: text_area_event_handler
+ *
+ * Description:
+ *   Process the evnet of text area
+ *
+ * Input Parameters:
+ *   text_area  - the handler of text area controller
+ *   event      - event type
+ *
+ * Returned Value:
+ *   none
+ *
+ * Assumptions/Limitations:
+ *
+ *
+ ****************************************************************************/
 
-  lv_style_copy(&style_kb, &lv_style_plain);
-  style_kb.body.opa             = LV_OPA_70;
-  style_kb.body.main_color      = LV_COLOR_HEX3(0x333);
-  style_kb.body.grad_color      = LV_COLOR_HEX3(0x333);
-  style_kb.body.padding.hor     = 0;
-  style_kb.body.padding.ver     = 0;
-  style_kb.body.padding.inner   = 0;
+static void text_area_event_handler(lv_obj_t *text_area, lv_event_t event)
+{
+  (void)text_area;
 
-  lv_style_copy(&style_kb_rel, &lv_style_plain);
-  style_kb_rel.body.empty           = 1;
-  style_kb_rel.body.radius          = 0;
-  style_kb_rel.body.border.width    = 1;
-  style_kb_rel.body.border.color    = LV_COLOR_SILVER;
-  style_kb_rel.body.border.opa      = LV_OPA_50;
-  style_kb_rel.body.main_color      = LV_COLOR_HEX3(0x333);
-  style_kb_rel.body.grad_color      = LV_COLOR_HEX3(0x333);
-  style_kb_rel.text.color           = LV_COLOR_WHITE;
+  /* Text area is on the scrollable part of the page but we need the page itself */
 
-  lv_style_copy(&style_kb_pr, &lv_style_plain);
-  style_kb_pr.body.radius       = 0;
-  style_kb_pr.body.opa          = LV_OPA_50;
-  style_kb_pr.body.main_color   = LV_COLOR_WHITE;
-  style_kb_pr.body.grad_color   = LV_COLOR_WHITE;
-  style_kb_pr.body.border.width = 1;
-  style_kb_pr.body.border.color = LV_COLOR_SILVER;
+  lv_obj_t *parent = lv_obj_get_parent(lv_obj_get_parent(ta));
 
-  keyboard_open_close(ta);
+  if (event == LV_EVENT_CLICKED)
+    {
+      if (kb == NULL)
+        {
+          kb = lv_kb_create(parent, NULL);
+          lv_obj_set_size(kb,
+                          lv_obj_get_width_fit(parent),
+                          lv_obj_get_height_fit(parent) / 2);
+          lv_obj_align(kb, ta, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
+          lv_kb_set_ta(kb, ta);
+          lv_kb_set_style(kb, LV_KB_STYLE_BG, &style_kb);
+          lv_kb_set_style(kb, LV_KB_STYLE_BTN_REL, &style_kb_rel);
+          lv_kb_set_style(kb, LV_KB_STYLE_BTN_PR, &style_kb_pr);
+          lv_obj_set_event_cb(kb, keyboard_event_cb);
+
+#if LV_USE_ANIMATION
+          lv_anim_t a;
+          a.var = kb;
+          a.start = LV_VER_RES;
+          a.end = lv_obj_get_y(kb);
+          a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y;
+          a.path_cb = lv_anim_path_linear;
+          a.ready_cb = NULL;
+          a.act_time = 0;
+          a.time = 300;
+          a.playback = 0;
+          a.playback_pause = 0;
+          a.repeat = 0;
+          a.repeat_pause = 0;
+          lv_anim_create(&a);
+#endif
+        }
+    }
 }
 
 /****************************************************************************
- * Name: keyboard_open_close
+ * Name: keyboard_event_cb
  *
  * Description:
- *   Toggle the display of the keyboard on the "Write" tab
+ *   Process the evnet of keyboard
  *
  * Input Parameters:
- *   text_area - a pointer to the lv_obj_t text area for the keyboard
+ *   keyboard   - the handler of keyboard controller
+ *   event      - event type
  *
  * Returned Value:
- *   LV_RES_OK on success, some other LV_RES_ value otherwise.
+ *   none
  *
  * Assumptions/Limitations:
  *
  *
  ****************************************************************************/
 
-static lv_res_t keyboard_open_close(lv_obj_t *text_area)
+static void keyboard_event_cb(lv_obj_t *keyboard, lv_event_t event)
 {
-  lv_obj_t *parent;
+  (void)keyboard;
 
-  /* Text area is on the scrollable part of the page but we need
-   * the page itself
-   */
+  lv_kb_def_event_cb(kb, event);
 
-  parent = lv_obj_get_parent(lv_obj_get_parent(ta));
-
-  if (kb)
+  if (event == LV_EVENT_APPLY || event == LV_EVENT_CANCEL)
     {
-      return keyboard_hide_action(kb);
+#if LV_USE_ANIMATION
+      lv_anim_t a;
+      a.var = kb;
+      a.start = lv_obj_get_y(kb);
+      a.end = LV_VER_RES;
+      a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y;
+      a.path_cb = lv_anim_path_linear;
+      a.ready_cb = kb_hide_anim_end;
+      a.act_time = 0;
+      a.time = 300;
+      a.playback = 0;
+      a.playback_pause = 0;
+      a.repeat = 0;
+      a.repeat_pause = 0;
+      lv_anim_create(&a);
+#else
+      lv_obj_del(kb);
+      kb = NULL;
+#endif
     }
-  else
-    {
-      kb = lv_kb_create(parent, NULL);
+}
 
-      lv_obj_set_size(kb, lv_page_get_scrl_width(parent),
-                      lv_obj_get_height(parent) / 2);
-      lv_obj_align(kb, ta, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
+/****************************************************************************
+ * Name: write_create
+ *
+ * Description:
+ *   Create a text-area and keyboard, each composing half of the
+ *   parent container.
+ *
+ * Input Parameters:
+ *   parent  - the lv_page_t* container to create the "write" page within
+ *
+ * Returned Value:
+ *   none
+ *
+ * Assumptions/Limitations:
+ *
+ *
+ ****************************************************************************/
 
-      lv_kb_set_ta(kb, ta);
+static void write_create(lv_obj_t *parent)
+{
+  lv_page_set_style(parent, LV_PAGE_STYLE_BG, &lv_style_transp_fit);
+  lv_page_set_style(parent, LV_PAGE_STYLE_SCRL, &lv_style_transp_fit);
 
-      lv_kb_set_style(kb, LV_KB_STYLE_BG, &style_kb);
-      lv_kb_set_style(kb, LV_KB_STYLE_BTN_REL, &style_kb_rel);
-      lv_kb_set_style(kb, LV_KB_STYLE_BTN_PR, &style_kb_pr);
+  lv_page_set_sb_mode(parent, LV_SB_MODE_OFF);
 
-      lv_kb_set_hide_action(kb, keyboard_hide_action);
-      lv_kb_set_ok_action(kb, keyboard_hide_action);
+  static lv_style_t style_ta;
+  lv_style_copy(&style_ta, &lv_style_pretty);
+  style_ta.body.opa = LV_OPA_30;
+  style_ta.body.radius = 0;
+  style_ta.text.color = lv_color_hex3(0x222);
 
-#if USE_LV_ANIMATION
-      lv_obj_animate(kb, LV_ANIM_FLOAT_BOTTOM | LV_ANIM_IN, 300, 0, NULL);
-#endif
-      return LV_RES_OK;
-    }
+  ta = lv_ta_create(parent, NULL);
+  lv_obj_set_size(ta,
+                  lv_page_get_scrl_width(parent),
+                  lv_obj_get_height(parent) / 2);
+  lv_ta_set_style(ta, LV_TA_STYLE_BG, &style_ta);
+  lv_ta_set_text(ta, "");
+  lv_obj_set_event_cb(ta, text_area_event_handler);
+  lv_style_copy(&style_kb, &lv_style_plain);
+  lv_ta_set_text_sel(ta, true);
+
+  style_kb.body.opa = LV_OPA_70;
+  style_kb.body.main_color = lv_color_hex3(0x333);
+  style_kb.body.grad_color = lv_color_hex3(0x333);
+  style_kb.body.padding.left = 0;
+  style_kb.body.padding.right = 0;
+  style_kb.body.padding.top = 0;
+  style_kb.body.padding.bottom = 0;
+  style_kb.body.padding.inner = 0;
+
+  lv_style_copy(&style_kb_rel, &lv_style_plain);
+  style_kb_rel.body.opa = LV_OPA_TRANSP;
+  style_kb_rel.body.radius = 0;
+  style_kb_rel.body.border.width = 1;
+  style_kb_rel.body.border.color = LV_COLOR_SILVER;
+  style_kb_rel.body.border.opa = LV_OPA_50;
+  style_kb_rel.body.main_color = lv_color_hex3(0x333);
+  style_kb_rel.body.grad_color = lv_color_hex3(0x333);
+  style_kb_rel.text.color = LV_COLOR_WHITE;
+
+  lv_style_copy(&style_kb_pr, &lv_style_plain);
+  style_kb_pr.body.radius = 0;
+  style_kb_pr.body.opa = LV_OPA_50;
+  style_kb_pr.body.main_color = LV_COLOR_WHITE;
+  style_kb_pr.body.grad_color = LV_COLOR_WHITE;
+  style_kb_pr.body.border.width = 1;
+  style_kb_pr.body.border.color = LV_COLOR_SILVER;
 }
 
 /****************************************************************************
@@ -246,28 +333,6 @@ static lv_res_t keyboard_hide_action(lv_obj_t *keyboard)
 }
 
 /****************************************************************************
- * Name: kb_hide_anim_end
- *
- * Description:
- *   A callback to delete (free) the object passed as a parameter.
- *
- * Input Parameters:
- *   keyboard - An lv_obj_t * to be deleted.
- *
- * Returned Value:
- *   None
- *
- * Assumptions/Limitations:
- *
- *
- ****************************************************************************/
-
-static void kb_hide_anim_end(lv_obj_t *keyboard)
-{
-  lv_obj_del(keyboard);
-}
-
-/****************************************************************************
  * Name: list_create
  *
  * Description:
@@ -287,65 +352,66 @@ static void kb_hide_anim_end(lv_obj_t *keyboard)
 
 static void list_create(lv_obj_t *parent)
 {
-  static lv_style_t style_btn_rel;
-  static lv_style_t style_btn_pr;
-
-  FAR lv_obj_t *list;
-  FAR lv_obj_t *mbox;
-
-  FAR static const char *mbox_btns[] = {
-    "Got it", ""
-  };
+  lv_coord_t hres = lv_disp_get_hor_res(NULL);
 
   lv_page_set_style(parent, LV_PAGE_STYLE_BG, &lv_style_transp_fit);
   lv_page_set_style(parent, LV_PAGE_STYLE_SCRL, &lv_style_transp_fit);
 
-  lv_page_set_scrl_fit(parent, false, false);
-  lv_page_set_scrl_height(parent, lv_obj_get_height(parent));
   lv_page_set_sb_mode(parent, LV_SB_MODE_OFF);
 
   /* Create styles for the buttons */
 
+  static lv_style_t style_btn_rel;
+  static lv_style_t style_btn_pr;
   lv_style_copy(&style_btn_rel, &lv_style_btn_rel);
-  style_btn_rel.body.main_color     = LV_COLOR_HEX3(0x333);
-  style_btn_rel.body.grad_color     = LV_COLOR_BLACK;
-  style_btn_rel.body.border.color   = LV_COLOR_SILVER;
-  style_btn_rel.body.border.width   = 1;
-  style_btn_rel.body.border.opa     = LV_OPA_50;
-  style_btn_rel.body.radius         = 0;
+  style_btn_rel.body.main_color = lv_color_hex3(0x333);
+  style_btn_rel.body.grad_color = LV_COLOR_BLACK;
+  style_btn_rel.body.border.color = LV_COLOR_SILVER;
+  style_btn_rel.body.border.width = 1;
+  style_btn_rel.body.border.opa = LV_OPA_50;
+  style_btn_rel.body.radius = 0;
 
   lv_style_copy(&style_btn_pr, &style_btn_rel);
-  style_btn_pr.body.main_color  = LV_COLOR_MAKE(0x55, 0x96, 0xd8);
-  style_btn_pr.body.grad_color  = LV_COLOR_MAKE(0x37, 0x62, 0x90);
-  style_btn_pr.text.color       = LV_COLOR_MAKE(0xbb, 0xd5, 0xf1);
-
-  list = lv_list_create(parent, NULL);
+  style_btn_pr.body.main_color = lv_color_make(0x55, 0x96, 0xd8);
+  style_btn_pr.body.grad_color = lv_color_make(0x37, 0x62, 0x90);
+  style_btn_pr.text.color = lv_color_make(0xbb, 0xd5, 0xf1);
 
+  lv_obj_t *list = lv_list_create(parent, NULL);
   lv_obj_set_height(list, 2 * lv_obj_get_height(parent) / 3);
-
-  lv_list_set_style(list, LV_LIST_STYLE_BG,      &lv_style_transp_tight);
-  lv_list_set_style(list, LV_LIST_STYLE_SCRL,    &lv_style_transp_tight);
+  lv_list_set_style(list, LV_LIST_STYLE_BG, &lv_style_transp_tight);
+  lv_list_set_style(list, LV_LIST_STYLE_SCRL, &lv_style_transp_tight);
   lv_list_set_style(list, LV_LIST_STYLE_BTN_REL, &style_btn_rel);
-  lv_list_set_style(list, LV_LIST_STYLE_BTN_PR,  &style_btn_pr);
-
+  lv_list_set_style(list, LV_LIST_STYLE_BTN_PR, &style_btn_pr);
   lv_obj_align(list, NULL, LV_ALIGN_IN_TOP_MID, 0, LV_DPI / 4);
 
-  lv_list_add(list, SYMBOL_FILE,      "New",    list_btn_action);
-  lv_list_add(list, SYMBOL_DIRECTORY, "Open",   list_btn_action);
-  lv_list_add(list, SYMBOL_TRASH,     "Delete", list_btn_action);
-  lv_list_add(list, SYMBOL_EDIT,      "Edit",   list_btn_action);
-  lv_list_add(list, SYMBOL_SAVE,      "Save",   list_btn_action);
-  lv_list_add(list, SYMBOL_WIFI,      "WiFi",   list_btn_action);
-  lv_list_add(list, SYMBOL_GPS,       "GPS",    list_btn_action);
+  lv_obj_t *list_btn;
+  list_btn = lv_list_add_btn(list, LV_SYMBOL_FILE, "New");
+  lv_obj_set_event_cb(list_btn, list_btn_event_handler);
+
+  list_btn = lv_list_add_btn(list, LV_SYMBOL_DIRECTORY, "Open");
+  lv_obj_set_event_cb(list_btn, list_btn_event_handler);
+
+  list_btn = lv_list_add_btn(list, LV_SYMBOL_TRASH, "Delete");
+  lv_obj_set_event_cb(list_btn, list_btn_event_handler);
+
+  list_btn = lv_list_add_btn(list, LV_SYMBOL_EDIT, "Edit");
+  lv_obj_set_event_cb(list_btn, list_btn_event_handler);
+
+  list_btn = lv_list_add_btn(list, LV_SYMBOL_SAVE, "Save");
+  lv_obj_set_event_cb(list_btn, list_btn_event_handler);
 
-  mbox = lv_mbox_create(parent, NULL);
+  list_btn = lv_list_add_btn(list, LV_SYMBOL_WIFI, "WiFi");
+  lv_obj_set_event_cb(list_btn, list_btn_event_handler);
 
-  lv_mbox_set_text(mbox, "Click a button to copy its text to the Text area ");
-  lv_obj_set_width(mbox, LV_HOR_RES - LV_DPI);
+  list_btn = lv_list_add_btn(list, LV_SYMBOL_GPS, "GPS");
+  lv_obj_set_event_cb(list_btn, list_btn_event_handler);
 
-  /* The default action is close */
+  lv_obj_t *mbox = lv_mbox_create(parent, NULL);
+  lv_mbox_set_text(mbox, "Click a button to copy"
+                         "its text to the Text area ");
+  lv_obj_set_width(mbox, hres - LV_DPI);
 
-  lv_mbox_add_btns(mbox, mbox_btns, NULL);
+  lv_mbox_add_btns(mbox, mbox_btns);
   lv_obj_align(mbox, parent, LV_ALIGN_IN_TOP_MID, 0, LV_DPI / 2);
 }
 
@@ -395,37 +461,29 @@ static lv_res_t list_btn_action(lv_obj_t *btn)
 
 static void chart_create(lv_obj_t *parent)
 {
-  static lv_style_t style_chart;
-  static lv_style_t style_bar;
-  static lv_style_t style_indic;
-  static lv_style_t style_knob;
-
-  FAR lv_chart_series_t *ser1;
-
-  FAR lv_obj_t *slider;
+  lv_coord_t vres = lv_disp_get_ver_res(NULL);
 
-  lv_page_set_style(parent, LV_PAGE_STYLE_BG,   &lv_style_transp_fit);
+  lv_page_set_style(parent, LV_PAGE_STYLE_BG, &lv_style_transp_fit);
   lv_page_set_style(parent, LV_PAGE_STYLE_SCRL, &lv_style_transp_fit);
 
-  /* Make the parent a fixed size */
-
-  lv_page_set_scrl_fit(parent, false, false);
   lv_page_set_scrl_height(parent, lv_obj_get_height(parent));
   lv_page_set_sb_mode(parent, LV_SB_MODE_OFF);
 
+  static lv_style_t style_chart;
   lv_style_copy(&style_chart, &lv_style_pretty);
-  style_chart.body.opa      = LV_OPA_60;
-  style_chart.body.radius   = 0;
-  style_chart.line.color    = LV_COLOR_GRAY;
+  style_chart.body.opa = LV_OPA_60;
+  style_chart.body.radius = 0;
+  style_chart.line.color = LV_COLOR_GRAY;
 
   chart = lv_chart_create(parent, NULL);
-  lv_obj_set_size(chart, 2 * lv_obj_get_width(parent) / 3,
+  lv_obj_set_size(chart,
+                  2 * lv_obj_get_width(parent) / 3,
                   lv_obj_get_height(parent) / 2);
-  lv_obj_align(chart, NULL,  LV_ALIGN_IN_TOP_MID, 0, LV_DPI / 4);
+  lv_obj_align(chart, NULL, LV_ALIGN_IN_TOP_MID, 0, LV_DPI / 4);
   lv_chart_set_type(chart, LV_CHART_TYPE_COLUMN);
-  lv_chart_set_style(chart, &style_chart);
+  lv_chart_set_style(chart, LV_CHART_STYLE_MAIN, &style_chart);
   lv_chart_set_series_opa(chart, LV_OPA_70);
-
+  lv_chart_series_t *ser1;
   ser1 = lv_chart_add_series(chart, LV_COLOR_RED);
   lv_chart_set_next(chart, ser1, 40);
   lv_chart_set_next(chart, ser1, 30);
@@ -440,75 +498,79 @@ static void chart_create(lv_obj_t *parent)
 
   /* Create a bar, an indicator and a knob style */
 
+  static lv_style_t style_bar;
+  static lv_style_t style_indic;
+  static lv_style_t style_knob;
+
   lv_style_copy(&style_bar, &lv_style_pretty);
-  style_bar.body.main_color     = LV_COLOR_BLACK;
-  style_bar.body.grad_color     = LV_COLOR_GRAY;
-  style_bar.body.radius         = LV_RADIUS_CIRCLE;
-  style_bar.body.border.color   = LV_COLOR_WHITE;
-  style_bar.body.opa            = LV_OPA_60;
-  style_bar.body.padding.hor    = 0;
-  style_bar.body.padding.ver    = LV_DPI / 10;
+  style_bar.body.main_color = LV_COLOR_BLACK;
+  style_bar.body.grad_color = LV_COLOR_GRAY;
+  style_bar.body.radius = LV_RADIUS_CIRCLE;
+  style_bar.body.border.color = LV_COLOR_WHITE;
+  style_bar.body.opa = LV_OPA_60;
+  style_bar.body.padding.left = 0;
+  style_bar.body.padding.right = 0;
+  style_bar.body.padding.top = LV_DPI / 10;
+  style_bar.body.padding.bottom = LV_DPI / 10;
 
   lv_style_copy(&style_indic, &lv_style_pretty);
-  style_indic.body.grad_color   = LV_COLOR_MAROON;
-  style_indic.body.main_color   = LV_COLOR_RED;
-  style_indic.body.radius       = LV_RADIUS_CIRCLE;
+  style_indic.body.grad_color = LV_COLOR_MAROON;
+  style_indic.body.main_color = LV_COLOR_RED;
+  style_indic.body.radius = LV_RADIUS_CIRCLE;
   style_indic.body.shadow.width = LV_DPI / 10;
   style_indic.body.shadow.color = LV_COLOR_RED;
-  style_indic.body.padding.hor  = LV_DPI / 30;
-  style_indic.body.padding.ver  = LV_DPI / 30;
+  style_indic.body.padding.left = LV_DPI / 30;
+  style_indic.body.padding.right = LV_DPI / 30;
+  style_indic.body.padding.top = LV_DPI / 30;
+  style_indic.body.padding.bottom = LV_DPI / 30;
 
   lv_style_copy(&style_knob, &lv_style_pretty);
-  style_knob.body.radius    = LV_RADIUS_CIRCLE;
-  style_knob.body.opa       = LV_OPA_70;
+  style_knob.body.radius = LV_RADIUS_CIRCLE;
+  style_knob.body.opa = LV_OPA_70;
 
-  /* Create a second slider, align to bottom of the chart */
-
-  slider = lv_slider_create(parent, NULL);
+  /* Create a second slider */
 
+  lv_obj_t *slider = lv_slider_create(parent, NULL);
   lv_slider_set_style(slider, LV_SLIDER_STYLE_BG, &style_bar);
   lv_slider_set_style(slider, LV_SLIDER_STYLE_INDIC, &style_indic);
   lv_slider_set_style(slider, LV_SLIDER_STYLE_KNOB, &style_knob);
-
   lv_obj_set_size(slider, lv_obj_get_width(chart), LV_DPI / 3);
-
-  lv_obj_align(slider, chart, LV_ALIGN_OUT_BOTTOM_MID, 0,
-          (LV_VER_RES - chart->coords.y2 - lv_obj_get_height(slider)) / 2);
-
-  /* Simulate a user value set the refresh the chart */
-
-  lv_slider_set_action(slider, slider_action);
+  lv_obj_align(slider,
+                chart,
+                LV_ALIGN_OUT_BOTTOM_MID,
+                0,
+                (vres - chart->coords.y2 - lv_obj_get_height(slider)) / 2);
+  lv_obj_set_event_cb(slider, slider_event_handler);
   lv_slider_set_range(slider, 10, 1000);
-  lv_slider_set_value(slider, 700);
-
-  slider_action(slider);
+  lv_slider_set_value(slider, 700, false);
+  slider_event_handler(slider, LV_EVENT_VALUE_CHANGED);
 }
 
 /****************************************************************************
- * Name: slider_action
+ * Name: slider_event_handler
  *
  * Description:
  *   Callback of the slider on the chart page. Adjusts the Y-axis range
  *
  * Input Parameters:
  *   slider - the slider object that triggered this action
- *
+ *   event  - the event type
  * Returned Value:
- *   LV_RES_OK - the object is still valid
+ *   None
  *
  * Assumptions/Limitations:
  *   Anything else that one might need to know to use this function.
  *
  ****************************************************************************/
 
-static lv_res_t slider_action(lv_obj_t *slider)
+static void slider_event_handler(lv_obj_t *slider, lv_event_t event)
 {
-  int16_t v = lv_slider_get_value(slider);
-
-  v = 1000 * 100 / v;   /* Convert to range modify values linearly */
-  lv_chart_set_range(chart, 0, v);
-
-  return LV_RES_OK;
+  if (event == LV_EVENT_VALUE_CHANGED)
+    {
+      int16_t v = lv_slider_get_value(slider);
+      v = 1000 * 100 / v;
+      lv_chart_set_range(chart, 0, v);
+    }
 }
 
 #if LV_DEMO_SLIDE_SHOW
@@ -533,18 +595,16 @@ static lv_res_t slider_action(lv_obj_t *slider)
  * Called periodically (lv_task) to switch to the next tab
  */
 
-static void tab_switcher(void *tv)
+static void tab_switcher(lv_task_t *task)
 {
   static uint8_t tab = 0;
-
+  lv_obj_t *tv = task->user_data;
   tab++;
   if (tab >= 3)
-    {
-      tab = 0;
-    }
-
+    tab = 0;
   lv_tabview_set_tab_act(tv, tab, true);
 }
+
 #endif
 
 /****************************************************************************
@@ -570,51 +630,48 @@ static void tab_switcher(void *tv)
 
 void demo_create(void)
 {
-  static lv_style_t style_tv_btn_bg;
-  static lv_style_t style_tv_btn_rel;
-  static lv_style_t style_tv_btn_pr;
-
-  FAR lv_obj_t *tv;
-  FAR lv_obj_t *tab1;
-  FAR lv_obj_t *tab2;
-  FAR lv_obj_t *tab3;
+  lv_coord_t hres = lv_disp_get_hor_res(NULL);
+  lv_coord_t vres = lv_disp_get_ver_res(NULL);
 
 #if LV_DEMO_WALLPAPER
-  FAR lv_obj_t *wp;
-
-  wp = lv_img_create(lv_scr_act(), NULL);
+  lv_obj_t *wp = lv_img_create(lv_disp_get_scr_act(NULL), NULL);
   lv_img_set_src(wp, &img_bubble_pattern);
-  lv_obj_set_width(wp, LV_HOR_RES * 4);
+  lv_obj_set_width(wp, hres * 4);
   lv_obj_set_protect(wp, LV_PROTECT_POS);
 #endif
 
+  static lv_style_t style_tv_btn_bg;
   lv_style_copy(&style_tv_btn_bg, &lv_style_plain);
-  style_tv_btn_bg.body.main_color   = LV_COLOR_HEX(0x487fb7);
-  style_tv_btn_bg.body.grad_color   = LV_COLOR_HEX(0x487fb7);
-  style_tv_btn_bg.body.padding.ver  = 0;
+  style_tv_btn_bg.body.main_color = lv_color_hex(0x487fb7);
+  style_tv_btn_bg.body.grad_color = lv_color_hex(0x487fb7);
+  style_tv_btn_bg.body.padding.top = 0;
+  style_tv_btn_bg.body.padding.bottom = 0;
 
+  static lv_style_t style_tv_btn_rel;
   lv_style_copy(&style_tv_btn_rel, &lv_style_btn_rel);
-  style_tv_btn_rel.body.empty           = 1;
-  style_tv_btn_rel.body.border.width    = 0;
+  style_tv_btn_rel.body.opa = LV_OPA_TRANSP;
+  style_tv_btn_rel.body.border.width = 0;
 
+  static lv_style_t style_tv_btn_pr;
   lv_style_copy(&style_tv_btn_pr, &lv_style_btn_pr);
-  style_tv_btn_pr.body.radius       = 0;
-  style_tv_btn_pr.body.opa          = LV_OPA_50;
-  style_tv_btn_pr.body.main_color   = LV_COLOR_WHITE;
-  style_tv_btn_pr.body.grad_color   = LV_COLOR_WHITE;
+  style_tv_btn_pr.body.radius = 0;
+  style_tv_btn_pr.body.opa = LV_OPA_50;
+  style_tv_btn_pr.body.main_color = LV_COLOR_WHITE;
+  style_tv_btn_pr.body.grad_color = LV_COLOR_WHITE;
   style_tv_btn_pr.body.border.width = 0;
-  style_tv_btn_pr.text.color        = LV_COLOR_GRAY;
+  style_tv_btn_pr.text.color = LV_COLOR_GRAY;
 
-  tv = lv_tabview_create(lv_scr_act(), NULL);
+  lv_obj_t *tv = lv_tabview_create(lv_disp_get_scr_act(NULL), NULL);
+  lv_obj_set_size(tv, hres, vres);
 
 #if LV_DEMO_WALLPAPER
-  lv_obj_set_parent(wp, ((lv_tabview_ext_t*)tv->ext_attr)->content);
+  lv_obj_set_parent(wp, ((lv_tabview_ext_t *)tv->ext_attr)->content);
   lv_obj_set_pos(wp, 0, -5);
 #endif
 
-  tab1 = lv_tabview_add_tab(tv, "Write");
-  tab2 = lv_tabview_add_tab(tv, "List");
-  tab3 = lv_tabview_add_tab(tv, "Chart");
+  lv_obj_t *tab1 = lv_tabview_add_tab(tv, "Write");
+  lv_obj_t *tab2 = lv_tabview_add_tab(tv, "List");
+  lv_obj_t *tab3 = lv_tabview_add_tab(tv, "Chart");
 
 #if LV_DEMO_WALLPAPER == 0
   /* Blue bg instead of wallpaper */
@@ -637,4 +694,4 @@ void demo_create(void)
 #endif
 }
 
-#endif /* CONFIG_EXAMPLES_LVGLDEMO_SIMPLE */
+#endif /* CONFIG_EXAMPLES_LVGLDEMO_SIMPLE */
\ No newline at end of file


[incubator-nuttx-apps] 05/15: apps/examples/lvgldemo: Port tp_cal.c for LVGL V6.1.2

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 1fa30e59d344fbf7936e1b463669310d3977a7ce
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Tue Apr 7 01:30:55 2020 +0000

    apps/examples/lvgldemo: Port tp_cal.c for LVGL V6.1.2
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I1fead13274822276e08d3f54016b079b174a1544
---
 examples/lvgldemo/tp_cal.c | 355 +++++++++++++++++++++++----------------------
 1 file changed, 180 insertions(+), 175 deletions(-)

diff --git a/examples/lvgldemo/tp_cal.c b/examples/lvgldemo/tp_cal.c
index 4b5d7f8..3395b6b 100644
--- a/examples/lvgldemo/tp_cal.c
+++ b/examples/lvgldemo/tp_cal.c
@@ -68,7 +68,7 @@ enum tp_cal_state_e
  * Private Function Prototypes
  ****************************************************************************/
 
-static lv_res_t btn_click_action(lv_obj_t * scr);
+static void btn_click_action(FAR lv_obj_t *scr, lv_event_t event);
 
 /****************************************************************************
  * Private Data
@@ -92,196 +92,201 @@ static lv_obj_t *circ_area;
  *
  * Input Parameters:
  *   scr
+ *   event
  *
  * Returned Value:
  *   ?
  *
  ****************************************************************************/
 
-static lv_res_t btn_click_action(FAR lv_obj_t *scr)
+static void btn_click_action(FAR lv_obj_t *scr, lv_event_t event)
 {
-  if (state == TP_CAL_STATE_WAIT_TOP_LEFT)
+  if (event == LV_EVENT_CLICKED)
     {
-      lv_indev_t *indev = lv_indev_get_act();
-      char buf[64];
-#if USE_LV_ANIMATION
-      lv_anim_t a;
+      if (state == TP_CAL_STATE_WAIT_TOP_LEFT)
+        {
+          lv_indev_t *indev = lv_indev_get_act();
+          char buf[64];
+#if LV_USE_ANIMATION
+          lv_anim_t a;
 #endif
 
-      lv_indev_get_point(indev, &p[0]);
-
-      sprintf(buf, "x: %d\ny: %d", p[0].x, p[0].y);
-      lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
-      lv_label_set_text(label_coord, buf);
-
-      lv_label_set_text(label_main, "Click the circle in\n"
-                        "upper right-hand corner");
-
-      lv_obj_set_pos(label_main,
-                     (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
-                     (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
-
-#if USE_LV_ANIMATION
-      a.var            = circ_area;
-      a.start          = 0;
-      a.end            = LV_HOR_RES - CIRCLE_SIZE;
-      a.fp             = (lv_anim_fp_t) lv_obj_set_x;
-      a.path           = lv_anim_path_linear;
-      a.end_cb         = NULL;
-      a.act_time       = 0;
-      a.time           = 200;
-      a.playback       = 0;
-      a.playback_pause = 0;
-      a.repeat         = 0;
-      a.repeat_pause   = 0;
-      lv_anim_create(&a);
-      a.start          = 0;
-      a.end            = 0;
-      a.fp             = (lv_anim_fp_t)lv_obj_set_y;
-      a.end_cb         = NULL;
-      a.time           = 200;
-      lv_anim_create(&a);
+          lv_indev_get_point(indev, &p[0]);
+
+          sprintf(buf, "x: %d\ny: %d", p[0].x, p[0].y);
+          lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
+          lv_label_set_text(label_coord, buf);
+
+          lv_label_set_text(label_main, "Click the circle in\n"
+                          "upper right-hand corner");
+
+          lv_obj_set_pos(label_main,
+                        (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
+                        (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
+
+#if LV_USE_ANIMATION
+          a.var            = circ_area;
+          a.start          = 0;
+          a.end            = LV_HOR_RES - CIRCLE_SIZE;
+          a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_x;
+          a.path_cb        = (lv_anim_path_cb_t)lv_anim_path_linear;
+          a.ready_cb       = NULL;
+          a.act_time       = 0;
+          a.time           = 200;
+          a.playback       = 0;
+          a.playback_pause = 0;
+          a.repeat         = 0;
+          a.repeat_pause   = 0;
+          lv_anim_create(&a);
+          a.start          = 0;
+          a.end            = 0;
+          a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_y;
+          a.ready_cb       = NULL;
+          a.time           = 200;
+          lv_anim_create(&a);
 #else
-      lv_obj_set_pos(circ_area, LV_HOR_RES - CIRCLE_SIZE, 0);
+          lv_obj_set_pos(circ_area, LV_HOR_RES - CIRCLE_SIZE, 0);
 #endif
 
-      state            = TP_CAL_STATE_WAIT_TOP_RIGHT;
-    }
-  else if (state == TP_CAL_STATE_WAIT_TOP_RIGHT)
-    {
-      lv_indev_t *indev = lv_indev_get_act();
-      char buf[64];
+          state            = TP_CAL_STATE_WAIT_TOP_RIGHT;
+        }
+      else if (state == TP_CAL_STATE_WAIT_TOP_RIGHT)
+        {
+          lv_indev_t *indev = lv_indev_get_act();
+          char buf[64];
 
-#if USE_LV_ANIMATION
-      lv_anim_t a;
+#if LV_USE_ANIMATION
+          lv_anim_t a;
 #endif
 
-      lv_indev_get_point(indev, &p[1]);
-
-      sprintf(buf, "x: %d\ny: %d", p[1].x, p[1].y);
-      lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
-      lv_label_set_text(label_coord, buf);
-      lv_obj_set_pos(label_coord, LV_HOR_RES - lv_obj_get_width(label_coord),
-                     0);
-
-      lv_label_set_text(label_main, "Click the circle in\n"
-                        "lower right-hand corner");
-
-      lv_obj_set_pos(label_main,
-                     (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
-                     (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
-#if USE_LV_ANIMATION
-      a.var            = circ_area;
-      a.start          = LV_HOR_RES - CIRCLE_SIZE;
-      a.end            = LV_HOR_RES - CIRCLE_SIZE;
-      a.fp             = (lv_anim_fp_t)lv_obj_set_x;
-      a.path           = lv_anim_path_linear;
-      a.end_cb         = NULL;
-      a.act_time       = 0;
-      a.time           = 200;
-      a.playback       = 0;
-      a.playback_pause = 0;
-      a.repeat         = 0;
-      a.repeat_pause   = 0;
-      lv_anim_create(&a);
-
-      a.start          = 0;
-      a.end            = LV_VER_RES - CIRCLE_SIZE;
-      a.fp             = (lv_anim_fp_t) lv_obj_set_y;
-      a.end_cb         = NULL;
-      a.time           = 200;
-      lv_anim_create(&a);
+          lv_indev_get_point(indev, &p[1]);
+
+          sprintf(buf, "x: %d\ny: %d", p[1].x, p[1].y);
+          lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
+          lv_label_set_text(label_coord, buf);
+          lv_obj_set_pos(label_coord,
+                         LV_HOR_RES - lv_obj_get_width(label_coord),
+                         0);
+
+          lv_label_set_text(label_main, "Click the circle in\n"
+                            "lower right-hand corner");
+
+          lv_obj_set_pos(label_main,
+                         (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
+                         (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
+
+#if LV_USE_ANIMATION
+          a.var            = circ_area;
+          a.start          = LV_HOR_RES - CIRCLE_SIZE;
+          a.end            = LV_HOR_RES - CIRCLE_SIZE;
+          a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_x;
+          a.path_cb        = (lv_anim_path_cb_t)lv_anim_path_linear;
+          a.ready_cb       = NULL;
+          a.act_time       = 0;
+          a.time           = 200;
+          a.playback       = 0;
+          a.playback_pause = 0;
+          a.repeat         = 0;
+          a.repeat_pause   = 0;
+          lv_anim_create(&a);
+
+          a.start          = 0;
+          a.end            = LV_VER_RES - CIRCLE_SIZE;
+          a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_y;
+          a.ready_cb       = NULL;
+          a.time           = 200;
+          lv_anim_create(&a);
 #else
-      lv_obj_set_pos(circ_area, LV_HOR_RES - CIRCLE_SIZE, LV_VER_RES - CIRCLE_SIZE);
+          lv_obj_set_pos(circ_area,
+                        LV_HOR_RES - CIRCLE_SIZE, LV_VER_RES - CIRCLE_SIZE);
 #endif
 
-      state            = TP_CAL_STATE_WAIT_BOTTOM_RIGHT;
-    }
-  else if (state == TP_CAL_STATE_WAIT_BOTTOM_RIGHT)
-    {
-      lv_indev_t *indev = lv_indev_get_act();
-      char buf[64];
-#if USE_LV_ANIMATION
-      lv_anim_t a;
+          state            = TP_CAL_STATE_WAIT_BOTTOM_RIGHT;
+        }
+      else if (state == TP_CAL_STATE_WAIT_BOTTOM_RIGHT)
+        {
+          lv_indev_t *indev = lv_indev_get_act();
+          char buf[64];
+#if LV_USE_ANIMATION
+          lv_anim_t a;
 #endif
-      lv_indev_get_point(indev, &p[2]);
-
-      sprintf(buf, "x: %d\ny: %d", p[2].x, p[2].y);
-      lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
-      lv_label_set_text(label_coord, buf);
-      lv_obj_set_pos(label_coord, LV_HOR_RES - lv_obj_get_width(label_coord),
-                     LV_VER_RES - lv_obj_get_height(label_coord));
-
-      lv_label_set_text(label_main, "Click the circle in\n"
-                        "lower left-hand corner");
-
-      lv_obj_set_pos(label_main,
-                     (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
-                     (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
-
-#if USE_LV_ANIMATION
-      a.var            = circ_area;
-      a.start          = LV_HOR_RES - CIRCLE_SIZE;
-      a.end            = 0;
-      a.fp             = (lv_anim_fp_t)lv_obj_set_x;
-      a.path           = lv_anim_path_linear;
-      a.end_cb         = NULL;
-      a.act_time       = 0;
-      a.time           = 200;
-      a.playback       = 0;
-      a.playback_pause = 0;
-      a.repeat         = 0;
-      a.repeat_pause   = 0;
-      lv_anim_create(&a);
-
-      a.start         = LV_VER_RES - CIRCLE_SIZE;
-      a.end           = LV_VER_RES - CIRCLE_SIZE;
-      a.fp            = (lv_anim_fp_t) lv_obj_set_y;
-      a.end_cb        = NULL;
-      a.time          = 200;
-      lv_anim_create(&a);
+          lv_indev_get_point(indev, &p[2]);
+
+          sprintf(buf, "x: %d\ny: %d", p[2].x, p[2].y);
+          lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
+          lv_label_set_text(label_coord, buf);
+          lv_obj_set_pos(label_coord,
+                         LV_HOR_RES - lv_obj_get_width(label_coord),
+                         LV_VER_RES - lv_obj_get_height(label_coord));
+
+          lv_label_set_text(label_main, "Click the circle in\n"
+                            "lower left-hand corner");
+
+          lv_obj_set_pos(label_main,
+                        (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
+                        (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
+
+#if LV_USE_ANIMATION
+          a.var            = circ_area;
+          a.start          = LV_HOR_RES - CIRCLE_SIZE;
+          a.end            = 0;
+          a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_x;
+          a.path_cb        = (lv_anim_path_cb_t)lv_anim_path_linear;
+          a.ready_cb       = NULL;
+          a.act_time       = 0;
+          a.time           = 200;
+          a.playback       = 0;
+          a.playback_pause = 0;
+          a.repeat         = 0;
+          a.repeat_pause   = 0;
+          lv_anim_create(&a);
+
+          a.start         = LV_VER_RES - CIRCLE_SIZE;
+          a.end           = LV_VER_RES - CIRCLE_SIZE;
+          a.exec_cb       = (lv_anim_exec_xcb_t) lv_obj_set_y;
+          a.ready_cb      = NULL;
+          a.time          = 200;
+          lv_anim_create(&a);
 #else
-      lv_obj_set_pos(circ_area, 0, LV_VER_RES - CIRCLE_SIZE);
+          lv_obj_set_pos(circ_area, 0, LV_VER_RES - CIRCLE_SIZE);
 #endif
 
-      state           = TP_CAL_STATE_WAIT_BOTTOM_LEFT;
-    }
-
-  else if (state == TP_CAL_STATE_WAIT_BOTTOM_LEFT)
-    {
-      lv_indev_t *indev = lv_indev_get_act();
-      char buf[64];
-
-      lv_indev_get_point(indev, &p[3]);
-
-      lv_label_set_text(label_main, "Click the screen\n"
-                        "to leave calibration");
-
-      lv_obj_set_pos(label_main,
-                     (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
-                     (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
-
-      sprintf(buf, "x: %d\ny: %d", p[3].x, p[3].y);
-      lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
-      lv_label_set_text(label_coord, buf);
-      lv_obj_set_pos(label_coord, 0,
-                     LV_VER_RES - lv_obj_get_height(label_coord));
-
-      lv_obj_del(circ_area);
-
-      state = TP_CAL_STATE_WAIT_LEAVE;
+          state           = TP_CAL_STATE_WAIT_BOTTOM_LEFT;
+        }
+      else if (state == TP_CAL_STATE_WAIT_BOTTOM_LEFT)
+        {
+          lv_indev_t *indev = lv_indev_get_act();
+          char buf[64];
+
+          lv_indev_get_point(indev, &p[3]);
+
+          lv_label_set_text(label_main, "Click the screen\n"
+                            "to leave calibration");
+
+          lv_obj_set_pos(label_main,
+                        (LV_HOR_RES - lv_obj_get_width(label_main)) / 2,
+                        (LV_VER_RES - lv_obj_get_height(label_main)) / 2);
+
+          sprintf(buf, "x: %d\ny: %d", p[3].x, p[3].y);
+          lv_obj_t *label_coord = lv_label_create(lv_scr_act(), NULL);
+          lv_label_set_text(label_coord, buf);
+          lv_obj_set_pos(label_coord, 0,
+                          LV_VER_RES - lv_obj_get_height(label_coord));
+
+          lv_obj_del(circ_area);
+
+          state = TP_CAL_STATE_WAIT_LEAVE;
+        }
+      else if (state == TP_CAL_STATE_WAIT_LEAVE)
+        {
+          lv_scr_load(prev_scr);
+          tp_set_cal_values(&p[0], &p[1], &p[2], &p[3]);
+          state = TP_CAL_STATE_READY;
+        }
+      else if (state == TP_CAL_STATE_READY)
+        {
+        }
     }
-  else if (state == TP_CAL_STATE_WAIT_LEAVE)
-    {
-      lv_scr_load(prev_scr);
-      tp_set_cal_values(&p[0], &p[1], &p[2], &p[3]);
-      state = TP_CAL_STATE_READY;
-    }
-  else if (state == TP_CAL_STATE_READY)
-    {
-    }
-
-  return LV_RES_OK;
 }
 
 /****************************************************************************
@@ -305,7 +310,7 @@ static lv_res_t btn_click_action(FAR lv_obj_t *scr)
 void tp_cal_create(void)
 {
   static lv_style_t style_circ;
-#if USE_LV_ANIMATION
+#if LV_USE_ANIMATION
   lv_anim_t a;
 #endif
 
@@ -323,7 +328,7 @@ void tp_cal_create(void)
   lv_obj_set_size(big_btn, TP_MAX_VALUE, TP_MAX_VALUE);
   lv_btn_set_style(big_btn, LV_BTN_STYLE_REL, &lv_style_transp);
   lv_btn_set_style(big_btn, LV_BTN_STYLE_PR, &lv_style_transp);
-  lv_btn_set_action(big_btn, LV_BTN_ACTION_CLICK, btn_click_action);
+  lv_obj_set_event_cb(big_btn, btn_click_action);
   lv_btn_set_layout(big_btn, LV_LAYOUT_OFF);
 
   label_main = lv_label_create(lv_scr_act(), NULL);
@@ -342,13 +347,13 @@ void tp_cal_create(void)
   lv_obj_set_style(circ_area, &style_circ);
   lv_obj_set_click(circ_area, false);
 
-#if USE_LV_ANIMATION
+#if LV_USE_ANIMATION
   a.var            = circ_area;
   a.start          = LV_HOR_RES / 2;
   a.end            = 0;
-  a.fp             = (lv_anim_fp_t) lv_obj_set_x;
-  a.path           = lv_anim_path_linear;
-  a.end_cb         = NULL;
+  a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_x;
+  a.path_cb        = (lv_anim_path_cb_t)lv_anim_path_linear;
+  a.ready_cb       = NULL;
   a.act_time       = -500;
   a.time           = 200;
   a.playback       = 0;
@@ -359,8 +364,8 @@ void tp_cal_create(void)
 
   a.start          = LV_VER_RES / 2;
   a.end            = 0;
-  a.fp             = (lv_anim_fp_t) lv_obj_set_y;
-  a.end_cb         = NULL;
+  a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_y;
+  a.ready_cb       = NULL;
   a.time           = 200;
   lv_anim_create(&a);
 #endif


[incubator-nuttx-apps] 02/15: apps/examples/lvgldemo: Update touchpad read callback for LittleVGL V6.1

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 20f3db73170fcde715ec85a99121a372d8d05f8a
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Tue Apr 7 00:51:12 2020 +0000

    apps/examples/lvgldemo: Update touchpad read callback for LittleVGL V6.1
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I8df8ff81832ce651a4c2678d534a6aeb85cff6a7
---
 examples/lvgldemo/tp.c | 33 ++++++++++++++++++---------------
 examples/lvgldemo/tp.h |  6 +++++-
 2 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/examples/lvgldemo/tp.c b/examples/lvgldemo/tp.c
index 18f9c8a..9b48410 100644
--- a/examples/lvgldemo/tp.c
+++ b/examples/lvgldemo/tp.c
@@ -60,7 +60,8 @@
  * Private Data
  ****************************************************************************/
 
-static int fd;static bool calibrated = false;
+static int fd;
+static bool calibrated = false;
 static int x_range;
 static int y_range;
 static int x_offset;
@@ -118,6 +119,7 @@ errout:
  *   Read a TP data and store in 'data' argument
  *
  * Input Parameters:
+ *   indev_drv - Input device handler
  *   data - Store the x, y and state information here
  *
  * Returned Value:
@@ -125,7 +127,7 @@ errout:
  *
  ****************************************************************************/
 
-bool tp_read(FAR lv_indev_data_t *data)
+bool tp_read(struct _lv_indev_drv_t *indev_drv, lv_indev_data_t *data)
 {
   struct touch_sample_s sample;
   int nbytes;
@@ -150,7 +152,8 @@ bool tp_read(FAR lv_indev_data_t *data)
       return false;
     }
 
-  if (sample.point[0].flags & TOUCH_DOWN || sample.point[0].flags & TOUCH_MOVE)
+  if (sample.point[0].flags & TOUCH_DOWN
+      || sample.point[0].flags & TOUCH_MOVE)
     {
       if (calibrated)
         {
@@ -158,7 +161,6 @@ bool tp_read(FAR lv_indev_data_t *data)
             {
               last_x = sample.point[0].y;
               last_y = sample.point[0].x;
-
             }
           else
             {
@@ -174,7 +176,6 @@ bool tp_read(FAR lv_indev_data_t *data)
           last_x = (int)((int)last_x * LV_HOR_RES) / x_range;
           last_y = (int)((int)last_y * LV_VER_RES) / y_range;
 
-
           if (x_inv)
             {
               last_x = LV_HOR_RES - last_x;
@@ -194,13 +195,13 @@ bool tp_read(FAR lv_indev_data_t *data)
       last_state = LV_INDEV_STATE_PR;
     }
   else if (sample.point[0].flags & TOUCH_UP)
-   {
-     last_state = LV_INDEV_STATE_REL;
-   }
+    {
+      last_state = LV_INDEV_STATE_REL;
+    }
   else if (sample.point[0].flags & TOUCH_UP)
-   {
-     last_state = LV_INDEV_STATE_REL;
-   }
+    {
+      last_state = LV_INDEV_STATE_REL;
+    }
 
   /* Update touchpad data */
 
@@ -236,7 +237,9 @@ void tp_set_cal_values(FAR lv_point_t *ul, FAR lv_point_t *ur,
 
   if (abs(ul->x - ur->x) < LV_HOR_RES / 2)
     {
-      xy_inv = true;  /*No real change in x horizontally*/
+      /* No real change in x horizontally */
+
+      xy_inv = true;
     }
 
   if (xy_inv)
@@ -285,7 +288,7 @@ void tp_set_cal_values(FAR lv_point_t *ul, FAR lv_point_t *ur,
   calibrated = true;
 
   printf("tp_cal result\n");
-  printf("offset x:%d, y:%d\n",x_offset, y_offset);
-  printf("range x:%d, y:%d\n",x_range, y_range);
-  printf("invert x/y:%d, x:%d, y:%d\n\n", xy_inv,x_inv,y_inv);
+  printf("offset x:%d, y:%d\n", x_offset, y_offset);
+  printf("range x:%d, y:%d\n", x_range, y_range);
+  printf("invert x/y:%d, x:%d, y:%d\n\n", xy_inv, x_inv, y_inv);
 }
diff --git a/examples/lvgldemo/tp.h b/examples/lvgldemo/tp.h
index e77cab1..ea4ddf2 100644
--- a/examples/lvgldemo/tp.h
+++ b/examples/lvgldemo/tp.h
@@ -46,7 +46,9 @@
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
+
 /* Configuration ************************************************************/
+
 /* CONFIG_EXAMPLES_LGVLDEMO_MINOR - The minor device number.  Minor=N
  *   corresponds to touchscreen device /dev/input0.  Note this value must
  *   with CONFIG_EXAMPLES_LGVLDEMO_DEVPATH.  Default 0.
@@ -108,6 +110,7 @@ int tp_init(void);
  *   Read a TP data and store in 'data' argument
  *
  * Input Parameters:
+ *   indev_drv - Input device handler
  *   data - Store the x, y and state information here
  *
  * Returned Value:
@@ -115,7 +118,8 @@ int tp_init(void);
  *
  ****************************************************************************/
 
-bool tp_read(FAR lv_indev_data_t *data);
+bool tp_read(FAR struct _lv_indev_drv_t *indev_drv,
+             FAR lv_indev_data_t *data);
 
 /****************************************************************************
  * Name: tp_read


[incubator-nuttx-apps] 04/15: apps/graphics/littlevgl: Update include guard macro of lv_conf.h

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 6f2ed3dfd47eeff40c889cadfb2cb7cb8dd85dc3
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Tue Apr 7 01:07:09 2020 +0000

    apps/graphics/littlevgl: Update include guard macro of lv_conf.h
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I467354c5a26407eee6d1bc780f6accd091e9b3d2
---
 graphics/littlevgl/lv_conf.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/graphics/littlevgl/lv_conf.h b/graphics/littlevgl/lv_conf.h
index 911b456..752de81 100644
--- a/graphics/littlevgl/lv_conf.h
+++ b/graphics/littlevgl/lv_conf.h
@@ -38,8 +38,8 @@
  * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER
  */
 
-#ifndef LV_CONF_H
-#define LV_CONF_H
+#ifndef __APPS_GRAPHICS_LITTLEVGL_LV_CONF_H
+#define __APPS_GRAPHICS_LITTLEVGL_LV_CONF_H
 /* clang-format off */
 
 #include <nuttx/config.h>
@@ -809,9 +809,7 @@ typedef void * lv_obj_user_data_t;
 #  define _CRT_SECURE_NO_WARNINGS
 #endif
 
-/*--END OF LV_CONF_H--*/
-
 /*Be sure every define has a default value*/
 #include "lvgl/src/lv_conf_checker.h"
 
-#endif /*LV_CONF_H*/
+#endif /*__APPS_GRAPHICS_LITTLEVGL_LV_CONF_H*/


[incubator-nuttx-apps] 15/15: examples/lvgldemo: Fix nxstyle

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 771811c1d7a49c45422fdb9052269e44cea1132e
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Wed Apr 15 10:17:45 2020 +0000

    examples/lvgldemo: Fix nxstyle
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
---
 examples/lvgldemo/fbdev.h           | 2 +-
 examples/lvgldemo/lv_test_theme_1.c | 4 +++-
 examples/lvgldemo/lvgldemo.c        | 8 +++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/examples/lvgldemo/fbdev.h b/examples/lvgldemo/fbdev.h
index 24446d3..00d0d8a 100644
--- a/examples/lvgldemo/fbdev.h
+++ b/examples/lvgldemo/fbdev.h
@@ -64,4 +64,4 @@ void fbdev_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
 }
 #endif
 
-#endif /*__APPS_EXAMPLES_LVGLDEMO_FBDEV_H */
+#endif /* __APPS_EXAMPLES_LVGLDEMO_FBDEV_H */
diff --git a/examples/lvgldemo/lv_test_theme_1.c b/examples/lvgldemo/lv_test_theme_1.c
index cd8fec6..63ad796 100644
--- a/examples/lvgldemo/lv_test_theme_1.c
+++ b/examples/lvgldemo/lv_test_theme_1.c
@@ -446,7 +446,9 @@ void lv_test_theme_1(lv_theme_t * th)
 {
   lv_theme_set_current(th);
 
-  /* If `LV_THEME_LIVE_UPDATE  1` `th` is not used directly so get the real theme after set */
+  /* If `LV_THEME_LIVE_UPDATE  1` `th` is not used directly
+   * so get the real theme after set
+   */
 
   th = lv_theme_get_current();
   FAR lv_obj_t * scr = lv_cont_create(NULL, NULL);
diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c
index eedc5ed..e83adb6 100644
--- a/examples/lvgldemo/lvgldemo.c
+++ b/examples/lvgldemo/lvgldemo.c
@@ -61,8 +61,10 @@
 
 /* Should we perform board-specific driver initialization?  There are two
  * ways that board initialization can occur:  1) automatically via
- * board_late_initialize() during bootup if CONFIG_BOARD_LATE_INITIALIZE, or 2)
- * via a call to boardctl() if the interface is enabled (CONFIG_LIB_BOARDCTL=y).
+ * board_late_initialize() during bootupif CONFIG_BOARD_LATE_INITIALIZE
+ * or 2).
+ * via a call to boardctl() if the interface is enabled
+ * (CONFIG_LIB_BOARDCTL=y).
  * If this task is running as an NSH built-in application, then that
  * initialization has probably already been performed otherwise we do it
  * here.
@@ -225,7 +227,7 @@ int main(int argc, FAR char *argv[])
 #  error "No theme selected for this application"
 #endif
 
- lv_test_theme_1(theme);
+  lv_test_theme_1(theme);
 
 #elif defined(CONFIG_EXAMPLES_LVGLDEMO_THEME_2)
   lv_test_theme_2();


[incubator-nuttx-apps] 11/15: examples/littlevgl: Add missing btn event handler

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 2bb4cbf9ca13a01c4cb5065bd5a3f0830803c03a
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Wed Apr 15 06:54:51 2020 +0000

    examples/littlevgl: Add missing btn event handler
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I4048fbd4907e465fe8f3a1a57c8ff830730a5bc3
---
 examples/lvgldemo/demo.c | 52 ++++++++++--------------------------------------
 1 file changed, 11 insertions(+), 41 deletions(-)

diff --git a/examples/lvgldemo/demo.c b/examples/lvgldemo/demo.c
index b7d3723..0eceedf 100644
--- a/examples/lvgldemo/demo.c
+++ b/examples/lvgldemo/demo.c
@@ -142,7 +142,9 @@ static void text_area_event_handler(lv_obj_t *text_area, lv_event_t event)
 {
   (void)text_area;
 
-  /* Text area is on the scrollable part of the page but we need the page itself */
+  /* Text area is on the scrollable part of the
+   * page but we need the page itself
+   */
 
   lv_obj_t *parent = lv_obj_get_parent(lv_obj_get_parent(ta));
 
@@ -299,40 +301,6 @@ static void write_create(lv_obj_t *parent)
 }
 
 /****************************************************************************
- * Name: keyboard_hide_action
- *
- * Description:
- *   Called when the close or ok button is pressed on the keyboard
- *
- * Input Parameters:
- *   keyboard  - pointer to the keyboard, but unused
- *
- * Returned Value:
- *   LV_RES_OK if the *kb object was not deleted (freed),
- *   LV_RES_INV if it was deleted.
- *
- * Assumptions/Limitations:
- *   The animation routine will call kb_hide_anim_end() to delete (free)
- *   the object. The global lv_obj_t *kb is set to NULL after whether
- *   deleted or not. Assume *kb is valid entering this function.
- *
- ****************************************************************************/
-
-static lv_res_t keyboard_hide_action(lv_obj_t *keyboard)
-{
-#if USE_LV_ANIMATION
-  lv_obj_animate(kb, LV_ANIM_FLOAT_BOTTOM | LV_ANIM_OUT, 300, 0,
-                 kb_hide_anim_end);
-  kb = NULL;
-  return LV_RES_OK;
-#else
-  lv_obj_del(kb);
-  kb = NULL;
-  return LV_RES_INV;
-#endif
-}
-
-/****************************************************************************
  * Name: list_create
  *
  * Description:
@@ -416,7 +384,7 @@ static void list_create(lv_obj_t *parent)
 }
 
 /****************************************************************************
- * Name: list_btn_action
+ * Name: list_btn_event_handler
  *
  * Description:
  *   Callback for the buttons within the list on the list page. Appends
@@ -424,6 +392,7 @@ static void list_create(lv_obj_t *parent)
  *
  * Input Parameters:
  *   btn - The button object that triggered the action
+ *   event - The button
  *
  * Returned Value:
  *   LV_RES_OK - the object is still valid
@@ -433,12 +402,13 @@ static void list_create(lv_obj_t *parent)
  *
  ****************************************************************************/
 
-static lv_res_t list_btn_action(lv_obj_t *btn)
+static void list_btn_event_handler(lv_obj_t * btn, lv_event_t event)
 {
-  lv_ta_add_text(ta, lv_list_get_btn_text(btn));
-  lv_ta_add_char(ta, '\n');
-
-  return LV_RES_OK;
+  if (event == LV_EVENT_SHORT_CLICKED)
+    {
+      lv_ta_add_char(ta, '\n');
+      lv_ta_add_text(ta, lv_list_get_btn_text(btn));
+    }
 }
 
 /****************************************************************************


[incubator-nuttx-apps] 06/15: apps/examples/lvgldemo: Update the lvgl init procedure

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit b7e96b473d69e484d2a04a3eb8e102b2167bb883
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Tue Apr 7 01:43:02 2020 +0000

    apps/examples/lvgldemo: Update the lvgl init procedure
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I36d250d7839a86d486dcb8f720fcf12f9b954327
---
 examples/lvgldemo/lvgldemo.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c
index 07e4582..eedc5ed 100644
--- a/examples/lvgldemo/lvgldemo.c
+++ b/examples/lvgldemo/lvgldemo.c
@@ -148,6 +148,9 @@ int main(int argc, FAR char *argv[])
   lv_disp_drv_t disp_drv;
   pthread_t tick_thread;
 
+  lv_disp_buf_t disp_buf;
+  static lv_color_t buf[CONFIG_LV_VDB_SIZE];
+
 #ifdef NEED_BOARDINIT
   /* Perform board-specific driver initialization */
 
@@ -170,8 +173,10 @@ int main(int argc, FAR char *argv[])
 
   /* Basic LittlevGL display driver initialization */
 
+  lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
   lv_disp_drv_init(&disp_drv);
-  disp_drv.disp_flush = fbdev_flush;
+  disp_drv.flush_cb = fbdev_flush;
+  disp_drv.buffer = &disp_buf;
   lv_disp_drv_register(&disp_drv);
 
   /* Tick interface initialization */
@@ -189,7 +194,7 @@ int main(int argc, FAR char *argv[])
    * mouse position and state.
    */
 
-  indev_drv.read = tp_read;
+  indev_drv.read_cb = tp_read;
   lv_indev_drv_register(&indev_drv);
 
   /* Demo initialization */


[incubator-nuttx-apps] 13/15: graphics/littlevgl: Change tarball version from 5.3 to 6.1.2

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 4555e73b3e1b975fdc3f3afa1c64c0868713fb9c
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Wed Apr 15 09:50:35 2020 +0000

    graphics/littlevgl: Change tarball version from 5.3 to 6.1.2
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
---
 graphics/littlevgl/Makefile            | 24 +++++++++---------------
 graphics/littlevgl/lv_symbol_def.patch | 12 ------------
 2 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/graphics/littlevgl/Makefile b/graphics/littlevgl/Makefile
index 0ec3abc..b382a04 100644
--- a/graphics/littlevgl/Makefile
+++ b/graphics/littlevgl/Makefile
@@ -41,13 +41,13 @@ LVGL_DIR = .
 
 # LVGL Libraries
 
--include ./lvgl/lv_core/lv_core.mk
--include ./lvgl/lv_hal/lv_hal.mk
--include ./lvgl/lv_objx/lv_objx.mk
--include ./lvgl/lv_fonts/lv_fonts.mk
--include ./lvgl/lv_misc/lv_misc.mk
--include ./lvgl/lv_themes/lv_themes.mk
--include ./lvgl/lv_draw/lv_draw.mk
+-include ./lvgl/src/lv_core/lv_core.mk
+-include ./lvgl/src/lv_hal/lv_hal.mk
+-include ./lvgl/src/lv_objx/lv_objx.mk
+-include ./lvgl/src/lv_font/lv_font.mk
+-include ./lvgl/src/lv_misc/lv_misc.mk
+-include ./lvgl/src/lv_themes/lv_themes.mk
+-include ./lvgl/src/lv_draw/lv_draw.mk
 
 # Set up build configuration and environment
 
@@ -55,16 +55,13 @@ WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
 
 CONFIG_GRAPH_LVGL_URL ?= "https://github.com/littlevgl/lvgl/archive"
 
-LVGL_VERSION ?= 5.3
+LVGL_VERSION ?= 6.1.2
 LVGL_TARBALL = v$(LVGL_VERSION).zip
 WGET ?= wget
 
 LVGL_UNPACKNAME = lvgl
 UNPACK ?= unzip -o
 
-PATCH_FILES = lv_symbol_def.patch
-PATCH ?= patch -p0
-
 LVGL_UNPACKDIR =  $(WD)/$(LVGL_UNPACKNAME)
 
 CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/littlevgl}
@@ -79,13 +76,10 @@ $(LVGL_UNPACKNAME): $(LVGL_TARBALL)
 	$(Q) mv	lvgl-$(LVGL_VERSION) $(LVGL_UNPACKNAME)
 	$(Q) touch $(LVGL_UNPACKNAME)
 
-$(LVGL_UNPACKNAME)/.patched: $(LVGL_UNPACKNAME) $(PATCH_FILES)
-	$(Q) cat $(PATCH_FILES) | $(PATCH)
-	$(Q) touch $(LVGL_UNPACKNAME)/.patched
 
 lvgl/lvgl.h: $(LVGL_UNPACKNAME)
 
-$(APPDIR)/include/graphics/lvgl.h: $(LVGL_UNPACKNAME)/.patched lvgl/lvgl.h
+$(APPDIR)/include/graphics/lvgl.h: lvgl/lvgl.h
 	@echo "CP: lvgl/lvgl.h"
 	$(Q) cp lvgl/lvgl.h $(APPDIR)/include/graphics/lvgl.h
 
diff --git a/graphics/littlevgl/lv_symbol_def.patch b/graphics/littlevgl/lv_symbol_def.patch
deleted file mode 100644
index e828332..0000000
--- a/graphics/littlevgl/lv_symbol_def.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur lvgl/lv_misc/lv_symbol_def.h lvgl.fix/lv_misc/lv_symbol_def.h
---- lvgl/lv_misc/lv_symbol_def.h	2019-01-31 20:08:33.000000000 -0800
-+++ lvgl.fix/lv_misc/lv_symbol_def.h	2019-03-17 17:43:52.780724618 -0700
-@@ -73,7 +73,7 @@
- #define SYMBOL_BATTERY_EMPTY   _SYMBOL_VALUE1(F0)
- #define SYMBOL_BLUETOOTH       _SYMBOL_VALUE1(F1)
- #define LV_SYMBOL_GLYPH_LAST   0xF1
--#define SYMBOL_DUMMY           _SYMBOL_VALUE1(xFF)       /*Invalid symbol. If written before a string then `lv_img` will show it as a label*/
-+#define SYMBOL_DUMMY           _SYMBOL_VALUE1(FF)       /*Invalid symbol. If written before a string then `lv_img` will show it as a label*/
- 
- #else
- #define LV_SYMBOL_GLYPH_FIRST  0xF800


[incubator-nuttx-apps] 12/15: graphics/littlevgl: Update theme config symbol name in Kconfig

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 972a31c16a52d07ef9cb684d15f5a2c5bdd14a64
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Wed Apr 8 09:04:20 2020 +0000

    graphics/littlevgl: Update theme config symbol name in Kconfig
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: I34be5049fb42a0e293f088dfefe6e9025838403b
---
 graphics/littlevgl/Kconfig | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/graphics/littlevgl/Kconfig b/graphics/littlevgl/Kconfig
index 3b95206..d63eed0 100644
--- a/graphics/littlevgl/Kconfig
+++ b/graphics/littlevgl/Kconfig
@@ -228,35 +228,35 @@ config LV_THEME_LIVE_UPDATE
 	bool "Allow theme switching at run time. Uses 8..10 kB of RAM"
 	default n
 
-config USE_LV_THEME_TEMPL
+config LV_USE_THEME_TEMPL
 	bool "Use Template theme: just for test"
 	default n
 
-config USE_LV_THEME_DEFAULT
+config LV_USE_THEME_DEFAULT
 	bool "Use Default theme: uses the built-in style"
 	default n
 
-config USE_LV_THEME_ALIEN
+config LV_USE_THEME_ALIEN
 	bool "Use Alien theme: dark futuristic theme"
 	default n
 
-config USE_LV_THEME_NIGHT
+config LV_USE_THEME_NIGHT
 	bool "Use Night theme: dark elegant theme"
 	default n
 
-config USE_LV_THEME_MONO
+config LV_USE_THEME_MONO
 	bool "Use Mono theme: mono color theme"
 	default n
 
-config USE_LV_THEME_MATERIAL
+config LV_USE_THEME_MATERIAL
 	bool "Use Material theme: material theme with bold colors"
 	default n
 
-config USE_LV_THEME_ZEN
+config LV_USE_THEME_ZEN
 	bool "Use Zen theme: light, peaceful theme"
 	default n
 
-config USE_LV_THEME_NEMO
+config LV_USE_THEME_NEMO
 	bool "Use Nemo theme: Water-like theme based on the movie 'Finding Nemo'"
 	default n
 


[incubator-nuttx-apps] 14/15: graphics/littlevgl: Fix nxstyle

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit a749b421642154673dbb19f9f878d64a8de1c62c
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Wed Apr 15 10:08:03 2020 +0000

    graphics/littlevgl: Fix nxstyle
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
---
 graphics/littlevgl/lv_conf.h | 134 +++++++++++++++++++++++++++----------------
 1 file changed, 83 insertions(+), 51 deletions(-)

diff --git a/graphics/littlevgl/lv_conf.h b/graphics/littlevgl/lv_conf.h
index cd4c4fd..d04b392 100644
--- a/graphics/littlevgl/lv_conf.h
+++ b/graphics/littlevgl/lv_conf.h
@@ -44,7 +44,9 @@
 
 #include <stdint.h>
 
-/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
+/* Type of coordinates. Should be `int16_t`
+ * (or `int32_t` for extreme cases)
+ */
 
 typedef int16_t lv_coord_t;
 
@@ -56,7 +58,7 @@ typedef int16_t lv_coord_t;
  * Graphical settings
  ****************************************************************************/
 
-/* Maximal horizontal and vertical resolution to support by the library.*/
+/* Maximal horizontal and vertical resolution to support by the library. */
 
 #define LV_HOR_RES_MAX          CONFIG_LV_HOR_RES
 #define LV_VER_RES_MAX          CONFIG_LV_VER_RES
@@ -94,7 +96,9 @@ typedef int16_t lv_coord_t;
 
 /* Images pixels with this color will not be drawn (with chroma keying) */
 
-#define LV_COLOR_TRANSP    ((lv_color_t){.full = (CONFIG_LV_COLOR_TRANSP)})      /*LV_COLOR_LIME: pure green*/
+/* LV_COLOR_LIME: pure green */
+
+#define LV_COLOR_TRANSP    ((lv_color_t){.full = (CONFIG_LV_COLOR_TRANSP)})
 
 /* Enable chroma keying for indexed images. */
 
@@ -112,14 +116,14 @@ typedef int16_t lv_coord_t;
  * Can be changed in the display driver (`lv_disp_drv_t`).
  */
 
-#define LV_DISP_DEF_REFR_PERIOD      CONFIG_LV_DISP_DEF_REFR_PERIOD   /*[ms]*/
+#define LV_DISP_DEF_REFR_PERIOD      CONFIG_LV_DISP_DEF_REFR_PERIOD   /* [ms] */
 
 /* Dot Per Inch: used to initialize default sizes.
  * E.g. a button with width = LV_DPI / 2 -> half inch wide
  * (Not so important, you can adjust it to modify default sizes and spaces)
  */
 
-#define LV_DPI              CONFIG_LV_DPI     /*[px]*/
+#define LV_DPI              CONFIG_LV_DPI     /* [px] */
 
 /****************************************************************************
  * Memory manager settings
@@ -129,12 +133,14 @@ typedef int16_t lv_coord_t;
  * The graphical objects and other related data are stored here.
  */
 
-/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
+/* 1: use custom malloc/free, 0: use the built-in
+ * `lv_mem_alloc` and `lv_mem_free`
+ */
 
 #define LV_MEM_CUSTOM      0
 #if LV_MEM_CUSTOM == 0
 
-/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
+/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB) */
 
 #  define LV_MEM_SIZE    (32U * 1024U)
 
@@ -148,14 +154,16 @@ typedef int16_t lv_coord_t;
 
 #  define LV_MEM_ADR          0
 
-/* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
+/* Automatically defrag. on free. Defrag. means
+ * joining the adjacent free cells.
+ */
 
 #  define LV_MEM_AUTO_DEFRAG  1
-#else       /*LV_MEM_CUSTOM*/
-#  define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
-#  define LV_MEM_CUSTOM_ALLOC   malloc       /*Wrapper to malloc*/
-#  define LV_MEM_CUSTOM_FREE    free         /*Wrapper to free*/
-#endif     /*LV_MEM_CUSTOM*/
+#else       /* LV_MEM_CUSTOM */
+#  define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /* Header for the dynamic memory function */
+#  define LV_MEM_CUSTOM_ALLOC   malloc       /* Wrapper to malloc */
+#  define LV_MEM_CUSTOM_FREE    free         /* Wrapper to free */
+#endif     /* LV_MEM_CUSTOM */
 
 /* Garbage Collector settings
  * Used if lvgl is binded to higher level language and the memory is
@@ -164,9 +172,9 @@ typedef int16_t lv_coord_t;
 
 #define LV_ENABLE_GC 0
 #if LV_ENABLE_GC != 0
-#  define LV_GC_INCLUDE "gc.h"                           /*Include Garbage Collector related things*/
-#  define LV_MEM_CUSTOM_REALLOC   your_realloc           /*Wrapper to realloc*/
-#  define LV_MEM_CUSTOM_GET_SIZE  your_mem_get_size      /*Wrapper to lv_mem_get_size*/
+#  define LV_GC_INCLUDE "gc.h"                           /* Include Garbage Collector related things */
+#  define LV_MEM_CUSTOM_REALLOC   your_realloc           /* Wrapper to realloc */
+#  define LV_MEM_CUSTOM_GET_SIZE  your_mem_get_size      /* Wrapper to lv_mem_get_size */
 #endif /* LV_ENABLE_GC */
 
 /****************************************************************************
@@ -215,7 +223,9 @@ typedef int16_t lv_coord_t;
 
 #if LV_USE_ANIMATION
 
-/* Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`) */
+/* Declare the type of the user data of animations
+ * (can be e.g. `void *`, `int`, `struct`)
+ */
 
 typedef void * lv_anim_user_data_t;
 
@@ -238,7 +248,7 @@ typedef void * lv_anim_user_data_t;
 #endif
 #if LV_USE_GROUP
 typedef void * lv_group_user_data_t;
-#endif  /*LV_USE_GROUP*/
+#endif  /* LV_USE_GROUP */
 
 /* 1: Enable GPU interface */
 
@@ -257,7 +267,9 @@ typedef void * lv_group_user_data_t;
 #endif
 
 #if LV_USE_FILESYSTEM
-/* Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`) */
+/* Declare the type of the user data of file system drivers
+ * (can be e.g. `void *`, `int`, `struct`)
+ */
 
 typedef void * lv_fs_drv_user_data_t;
 #endif
@@ -298,7 +310,9 @@ typedef void * lv_fs_drv_user_data_t;
 
 #define LV_IMG_CACHE_DEF_SIZE       1
 
-/* Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`) */
+/* Declare the type of the user data of image decoder
+ * (can be e.g. `void *`, `int`, `struct`)
+ */
 
 typedef void * lv_img_decoder_user_data_t;
 
@@ -347,12 +361,12 @@ typedef void * lv_img_decoder_user_data_t;
 
 #define LV_TICK_CUSTOM     0
 #if LV_TICK_CUSTOM == 1
-#define LV_TICK_CUSTOM_INCLUDE  "something.h"       /*Header for the sys time function*/
-#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())     /*Expression evaluating to current systime in ms*/
-#endif   /*LV_TICK_CUSTOM*/
+#define LV_TICK_CUSTOM_INCLUDE  "something.h"       /* Header for the sys time function */
+#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())     /* Expression evaluating to current systime in ms */
+#endif   /* LV_TICK_CUSTOM */
 
 typedef void * lv_disp_drv_user_data_t;             /* Type of user data in the display driver */
-typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the input device driver*/
+typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the input device driver */
 
 /****************************************************************************
  * Log settings
@@ -404,7 +418,7 @@ typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the
 #else
 #  define LV_LOG_PRINTF   0
 #endif
-#endif  /*LV_USE_LOG*/
+#endif  /* LV_USE_LOG */
 
 /****************************************************************************
  * Debug settings
@@ -452,7 +466,7 @@ typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the
 
 #define LV_USE_ASSERT_STYLE     1
 
-#endif /*LV_USE_DEBUG*/
+#endif /* LV_USE_DEBUG */
 
 /****************************************************************************
  *  THEME USAGE
@@ -461,55 +475,55 @@ typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the
 #ifdef CONFIG_LV_THEME_LIVE_UPDATE
 #define LV_THEME_LIVE_UPDATE    CONFIG_LV_THEME_LIVE_UPDATE
 #else
-#define LV_THEME_LIVE_UPDATE    0   /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/
+#define LV_THEME_LIVE_UPDATE    0   /* 1: Allow theme switching at run time. Uses 8..10 kB of RAM */
 #endif
 
 #ifdef CONFIG_LV_THEME_LIVE_TEMPL
 #define LV_USE_THEME_TEMPL      CONFIG_LV_USE_THEME_TEMPL
 #else
-#define LV_USE_THEME_TEMPL      0   /*Just for test*/
+#define LV_USE_THEME_TEMPL      0   /* Just for test */
 #endif
 
 #ifdef CONFIG_LV_USE_THEME_DEFAULT
 #define LV_USE_THEME_DEFAULT    CONFIG_LV_USE_THEME_DEFAULT
 #else
-#define LV_USE_THEME_DEFAULT    0   /*Built mainly from the built-in styles. Consumes very few RAM*/
+#define LV_USE_THEME_DEFAULT    0   /* Built mainly from the built-in styles. Consumes very few RAM */
 #endif
 
 #ifdef CONFIG_LV_USE_THEME_ALIEN
 #define LV_USE_THEME_ALIEN      CONFIG_LV_USE_THEME_ALIEN
 #else
-#define LV_USE_THEME_ALIEN      0   /*Dark futuristic theme*/
+#define LV_USE_THEME_ALIEN      0   /* Dark futuristic theme */
 #endif
 
 #ifdef CONFIG_LV_USE_THEME_NIGHT
 #define LV_USE_THEME_NIGHT      CONFIG_LV_USE_THEME_NIGHT
 #else
-#define LV_USE_THEME_NIGHT      0   /*Dark elegant theme*/
+#define LV_USE_THEME_NIGHT      0   /* Dark elegant theme */
 #endif
 
 #ifdef CONFIG_LV_USE_THEME_MONO
 #define LV_USE_THEME_MONO       CONFIG_LV_USE_THEME_MONO
 #else
-#define LV_USE_THEME_MONO       0   /*Mono color theme for monochrome displays*/
+#define LV_USE_THEME_MONO       0   /* Mono color theme for monochrome displays */
 #endif
 
 #ifdef  CONFIG_LV_USE_THEME_MATERIAL
 #define LV_USE_THEME_MATERIAL   CONFIG_LV_USE_THEME_MATERIAL
 #else
-#define LV_USE_THEME_MATERIAL   0   /*Flat theme with bold colors and light shadows*/
+#define LV_USE_THEME_MATERIAL   0   /* Flat theme with bold colors and light shadows */
 #endif
 
 #ifdef CONFIG_LV_USE_THEME_ZEN
 #define LV_USE_THEME_ZEN        CONFIG_LV_USE_THEME_ZEN
 #else
-#define LV_USE_THEME_ZEN        0   /*Peaceful, mainly light theme */
+#define LV_USE_THEME_ZEN        0   /* Peaceful, mainly light theme */
 #endif
 
 #ifdef CONFIG_LV_USE_THEME_NEMO
 #define LV_USE_THEME_NEMO       CONFIG_LV_USE_THEME_NEMO
 #else
-#define LV_USE_THEME_NEMO       0   /*Water-like theme based on the movie "Finding Nemo"*/
+#define LV_USE_THEME_NEMO       0   /* Water-like theme based on the movie "Finding Nemo" */
 #endif
 
 /****************************************************************************
@@ -554,7 +568,7 @@ typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the
 /* Demonstrate special features */
 
 #define LV_FONT_ROBOTO_12_SUBPX 1
-#define LV_FONT_ROBOTO_28_COMPRESSED 1  /*bpp = 3*/
+#define LV_FONT_ROBOTO_28_COMPRESSED 1  /* bpp = 3 */
 
 /* Pixel perfect monospace font
  * http://pelulamu.net/unscii/
@@ -612,7 +626,9 @@ typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the
 
 #define LV_FONT_SUBPX_BGR    0
 
-/* Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`) */
+/* Declare the type of the user data of fonts
+ * (can be e.g. `void *`, `int`, `struct`)
+ */
 
 typedef void * lv_font_user_data_t;
 
@@ -681,13 +697,15 @@ typedef void * lv_font_user_data_t;
 #  define LV_SPRINTF_INCLUDE <stdio.h>
 #  define lv_snprintf     snprintf
 #  define lv_vsnprintf    vsnprintf
-#endif  /*LV_SPRINTF_CUSTOM*/
+#endif  /* LV_SPRINTF_CUSTOM */
 
 /****************************************************************************
  *  LV_OBJ SETTINGS
  ****************************************************************************/
 
-/* Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`) */
+/* Declare the type of the user data of object
+ * (can be e.g. `void *`, `int`, `struct`)
+ */
 
 typedef void * lv_obj_user_data_t;
 
@@ -713,7 +731,9 @@ typedef void * lv_obj_user_data_t;
  *  LV OBJ X USAGE
  ****************************************************************************/
 
-/* Documentation of the object types: https://docs.littlevgl.com/#Object-types */
+/* Documentation of the object types:
+ * https://docs.littlevgl.com/#Object-types
+ */
 
 /* Arc (dependencies: -) */
 
@@ -741,7 +761,9 @@ typedef void * lv_obj_user_data_t;
 
 #if LV_USE_BTN != 0
 
-/* Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION) */
+/* Enable button-state animations - draw a
+ * circle on click (dependencies: LV_USE_ANIMATION)
+ */
 
 #ifdef CONFIG_LV_BTN_INK_EFFECT
 #define LV_BTN_INK_EFFECT      CONFIG_LV_BTN_INK_EFFECT
@@ -824,7 +846,9 @@ typedef void * lv_obj_user_data_t;
 
 #define LV_USE_IMGBTN   1
 #if LV_USE_IMGBTN
-/* 1: The imgbtn requires left, mid and right parts and the width can be set freely */
+/* 1: The imgbtn requires left, mid and right
+ * parts and the width can be set freely
+ */
 
 #  define LV_IMGBTN_TILED 0
 #endif
@@ -837,7 +861,9 @@ typedef void * lv_obj_user_data_t;
 
 #define LV_USE_LABEL    1
 #if LV_USE_LABEL != 0
-/* Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode */
+/* Hor, or ver. scroll speed [px/sec] in
+ * 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode
+ */
 
 #  define LV_LABEL_DEF_SCROLL_SPEED       25
 
@@ -849,7 +875,9 @@ typedef void * lv_obj_user_data_t;
 
 #  define LV_LABEL_TEXT_SEL               0
 
-/* Store extra some info in labels (12 bytes) to speed up drawing of very long texts */
+/* Store extra some info in labels (12 bytes)
+ * to speed up drawing of very long texts
+ */
 
 #  define LV_LABEL_LONG_TXT_HINT          0
 #endif
@@ -862,11 +890,15 @@ typedef void * lv_obj_user_data_t;
 
 #define LV_USE_LINE     1
 
-/* List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons)) */
+/* List (dependencies: lv_page, lv_btn, lv_label,
+ * (lv_img optionally for icons))
+ */
 
 #define LV_USE_LIST     1
 #if LV_USE_LIST != 0
-/* Default animation time of focusing to a list element [ms] (0: no animation) */
+/* Default animation time of focusing to a
+ * list element [ms] (0: no animation)
+ */
 
 #  define LV_LIST_DEF_ANIM_TIME  100
 #endif
@@ -892,8 +924,8 @@ typedef void * lv_obj_user_data_t;
 
 #define LV_USE_PRELOAD      1
 #if LV_USE_PRELOAD != 0
-#  define LV_PRELOAD_DEF_ARC_LENGTH   60      /*[deg]*/
-#  define LV_PRELOAD_DEF_SPIN_TIME    1000    /*[ms]*/
+#  define LV_PRELOAD_DEF_ARC_LENGTH   60      /* [deg] */
+#  define LV_PRELOAD_DEF_SPIN_TIME    1000    /* [ms] */
 #  define LV_PRELOAD_DEF_ANIM         LV_PRELOAD_TYPE_SPINNING_ARC
 #endif
 
@@ -926,8 +958,8 @@ typedef void * lv_obj_user_data_t;
 
 #define LV_USE_TA       1
 #if LV_USE_TA != 0
-#  define LV_TA_DEF_CURSOR_BLINK_TIME 400     /*ms*/
-#  define LV_TA_DEF_PWD_SHOW_TIME     1500    /*ms*/
+#  define LV_TA_DEF_CURSOR_BLINK_TIME 400     /* ms */
+#  define LV_TA_DEF_PWD_SHOW_TIME     1500    /* ms */
 #endif
 
 /* Table (dependencies: lv_label) */
@@ -975,4 +1007,4 @@ typedef void * lv_obj_user_data_t;
 
 #include "lvgl/src/lv_conf_checker.h"
 
-#endif /*__APPS_GRAPHICS_LITTLEVGL_LV_CONF_H*/
+#endif /* __APPS_GRAPHICS_LITTLEVGL_LV_CONF_H */


[incubator-nuttx-apps] 10/15: graphics/littlevgl: Correct color depth description

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 1775ccde1bcc7b19d4e5ea1aa80b399169fcf310
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Wed Apr 15 06:57:10 2020 +0000

    graphics/littlevgl: Correct color depth description
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: Ice795f62179d5762cd46c5c9495997ccde0d021e
---
 graphics/littlevgl/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/graphics/littlevgl/Kconfig b/graphics/littlevgl/Kconfig
index d8387d6..3b95206 100644
--- a/graphics/littlevgl/Kconfig
+++ b/graphics/littlevgl/Kconfig
@@ -129,7 +129,7 @@ endmenu
 menu "Color settings"
 
 config LV_COLOR_DEPTH
-	int "Color depth (8/16/24)"
+	int "Color depth (8/16/32)"
 	default 16
 
 config LV_COLOR_16_SWAP
@@ -138,7 +138,7 @@ config LV_COLOR_16_SWAP
 	default 0
 
 config LV_COLOR_SCREEN_TRANSP
-	bool "Enable screen transparency."
+	bool "Enable screen transparency.(If disabled, 32-bit color depth fall to 24-bit)"
 	default 0
 
 config LV_COLOR_TRANSP


[incubator-nuttx-apps] 07/15: graphics/littlevgl:Fix nxstyle for lv_conf.h

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 5bee0377cb61107208d7e66876f248f42cddb923
Author: Qi Huang <hu...@xiaomi.com>
AuthorDate: Wed Apr 8 09:01:41 2020 +0000

    graphics/littlevgl:Fix nxstyle for lv_conf.h
    
    Signed-off-by: Qi Huang <hu...@xiaomi.com>
    Change-Id: Icdf39551357d32f2af57c6cffe10a07101e3aebe
---
 graphics/littlevgl/lv_conf.h | 465 +++++++++++++++++++++++++++++--------------
 1 file changed, 314 insertions(+), 151 deletions(-)

diff --git a/graphics/littlevgl/lv_conf.h b/graphics/littlevgl/lv_conf.h
index 752de81..cd4c4fd 100644
--- a/graphics/littlevgl/lv_conf.h
+++ b/graphics/littlevgl/lv_conf.h
@@ -33,27 +33,31 @@
  *
  ****************************************************************************/
 
-
-/*
- * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER
- */
-
 #ifndef __APPS_GRAPHICS_LITTLEVGL_LV_CONF_H
 #define __APPS_GRAPHICS_LITTLEVGL_LV_CONF_H
-/* clang-format off */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
 
 #include <nuttx/config.h>
 
 #include <stdint.h>
 
 /* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
+
 typedef int16_t lv_coord_t;
 
-/*====================
-   Graphical settings
- *====================*/
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Graphical settings
+ ****************************************************************************/
 
 /* Maximal horizontal and vertical resolution to support by the library.*/
+
 #define LV_HOR_RES_MAX          CONFIG_LV_HOR_RES
 #define LV_VER_RES_MAX          CONFIG_LV_VER_RES
 
@@ -63,10 +67,13 @@ typedef int16_t lv_coord_t;
  * - 16: RGB565
  * - 32: ARGB8888
  */
+
 #define LV_COLOR_DEPTH     CONFIG_LV_COLOR_DEPTH
 
 /* Swap the 2 bytes of RGB565 color.
- * Useful if the display has a 8 bit interface (e.g. SPI)*/
+ * Useful if the display has a 8 bit interface (e.g. SPI)
+ */
+
 #ifdef CONFIG_LV_COLOR_16_SWAP
 #define LV_COLOR_16_SWAP    CONFIG_LV_COLOR_16_SWAP
 #else
@@ -75,19 +82,26 @@ typedef int16_t lv_coord_t;
 
 /* 1: Enable screen transparency.
  * Useful for OSD or other overlapping GUIs.
- * Requires `LV_COLOR_DEPTH = 32` colors and the screen's style should be modified: `style.body.opa = ...`*/
+ * Requires `LV_COLOR_DEPTH = 32` colors and the screen's style
+ * should be modified: `style.body.opa = ...`
+ */
+
 #ifdef CONFIG_LV_COLOR_SCREEN_TRANSP
 #define LV_COLOR_SCREEN_TRANSP    CONFIG_LV_COLOR_SCREEN_TRANSP
 #else
 #define LV_COLOR_SCREEN_TRANSP    0
 #endif
-/*Images pixels with this color will not be drawn (with chroma keying)*/
+
+/* Images pixels with this color will not be drawn (with chroma keying) */
+
 #define LV_COLOR_TRANSP    ((lv_color_t){.full = (CONFIG_LV_COLOR_TRANSP)})      /*LV_COLOR_LIME: pure green*/
 
 /* Enable chroma keying for indexed images. */
+
 #define LV_INDEXED_CHROMA    1
 
 /* Enable anti-aliasing (lines, and radiuses will be smoothed) */
+
 #ifdef CONFIG_LV_ANTIALIAS
 #define LV_ANTIALIAS        CONFIG_LV_ANTIALIAS
 #else
@@ -95,35 +109,47 @@ typedef int16_t lv_coord_t;
 #endif
 
 /* Default display refresh period.
- * Can be changed in the display driver (`lv_disp_drv_t`).*/
+ * Can be changed in the display driver (`lv_disp_drv_t`).
+ */
+
 #define LV_DISP_DEF_REFR_PERIOD      CONFIG_LV_DISP_DEF_REFR_PERIOD   /*[ms]*/
 
 /* Dot Per Inch: used to initialize default sizes.
  * E.g. a button with width = LV_DPI / 2 -> half inch wide
- * (Not so important, you can adjust it to modify default sizes and spaces)*/
+ * (Not so important, you can adjust it to modify default sizes and spaces)
+ */
+
 #define LV_DPI              CONFIG_LV_DPI     /*[px]*/
 
-/*=========================
-   Memory manager settings
- *=========================*/
+/****************************************************************************
+ * Memory manager settings
+ ****************************************************************************/
 
 /* LittelvGL's internal memory manager's settings.
- * The graphical objects and other related data are stored here. */
+ * The graphical objects and other related data are stored here.
+ */
 
 /* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
+
 #define LV_MEM_CUSTOM      0
 #if LV_MEM_CUSTOM == 0
+
 /* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
+
 #  define LV_MEM_SIZE    (32U * 1024U)
 
 /* Complier prefix for a big array declaration */
+
 #  define LV_MEM_ATTR
 
 /* Set an address for the memory pool instead of allocating it as an array.
- * Can be in external SRAM too. */
+ * Can be in external SRAM too.
+ */
+
 #  define LV_MEM_ADR          0
 
 /* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
+
 #  define LV_MEM_AUTO_DEFRAG  1
 #else       /*LV_MEM_CUSTOM*/
 #  define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
@@ -132,7 +158,10 @@ typedef int16_t lv_coord_t;
 #endif     /*LV_MEM_CUSTOM*/
 
 /* Garbage Collector settings
- * Used if lvgl is binded to higher level language and the memory is managed by that language */
+ * Used if lvgl is binded to higher level language and the memory is
+ * managed by that language
+ */
+
 #define LV_ENABLE_GC 0
 #if LV_ENABLE_GC != 0
 #  define LV_GC_INCLUDE "gc.h"                           /*Include Garbage Collector related things*/
@@ -140,35 +169,44 @@ typedef int16_t lv_coord_t;
 #  define LV_MEM_CUSTOM_GET_SIZE  your_mem_get_size      /*Wrapper to lv_mem_get_size*/
 #endif /* LV_ENABLE_GC */
 
-/*=======================
-   Input device settings
- *=======================*/
+/****************************************************************************
+ * Input device settings
+ ****************************************************************************/
 
 /* Input device default settings.
- * Can be changed in the Input device driver (`lv_indev_drv_t`)*/
+ * Can be changed in the Input device driver (`lv_indev_drv_t`)
+ */
 
 /* Input device read period in milliseconds */
+
 #define LV_INDEV_DEF_READ_PERIOD          CONFIG_LV_INDEV_DEF_READ_PERIOD
 
 /* Drag threshold in pixels */
+
 #define LV_INDEV_DEF_DRAG_LIMIT           CONFIG_LV_INDEV_DEF_DRAG_LIMIT
 
 /* Drag throw slow-down in [%]. Greater value -> faster slow-down */
+
 #define LV_INDEV_DEF_DRAG_THROW           CONFIG_LV_INDEV_DEF_DRAG_THROW
 
 /* Long press time in milliseconds.
- * Time to send `LV_EVENT_LONG_PRESSSED`) */
+ * Time to send `LV_EVENT_LONG_PRESSSED`)
+ */
+
 #define LV_INDEV_DEF_LONG_PRESS_TIME      CONFIG_LV_INDEV_DEF_LONG_PRESS_TIME
 
 /* Repeated trigger period in long press [ms]
- * Time between `LV_EVENT_LONG_PRESSED_REPEAT */
+ * Time between `LV_EVENT_LONG_PRESSED_REPEAT
+ */
+
 #define LV_INDEV_DEF_LONG_PRESS_REP_TIME  CONFIG_LV_INDEV_DEF_LONG_PRESS_REP_TIME
 
-/*==================
+/****************************************************************************
  * Feature usage
- *==================*/
+ ****************************************************************************/
+
+/* 1: Enable the Animations */
 
-/*1: Enable the Animations */
 #ifdef CONFIG_USE_LV_ANIMATION
 #define LV_USE_ANIMATION        CONFIG_USE_LV_ANIMATION
 #else
@@ -177,12 +215,14 @@ typedef int16_t lv_coord_t;
 
 #if LV_USE_ANIMATION
 
-/*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
+/* Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`) */
+
 typedef void * lv_anim_user_data_t;
 
 #endif
 
-/* 1: Enable shadow drawing*/
+/* 1: Enable shadow drawing */
+
 #ifdef CONFIG_USE_LV_SHADOW
 #define LV_USE_SHADOW           CONFIG_USE_LV_SHADOW
 #else
@@ -190,6 +230,7 @@ typedef void * lv_anim_user_data_t;
 #endif
 
 /* 1: Enable object groups (for keyboard/encoder navigation) */
+
 #ifdef CONFIG_USE_LV_GROUP
 #define LV_USE_GROUP            CONFIG_USE_LV_GROUP
 #else
@@ -199,7 +240,8 @@ typedef void * lv_anim_user_data_t;
 typedef void * lv_group_user_data_t;
 #endif  /*LV_USE_GROUP*/
 
-/* 1: Enable GPU interface*/
+/* 1: Enable GPU interface */
+
 #ifdef CONFIG_USE_LV_GPU
 #define LV_USE_GPU              CONFIG_USE_LV_GPU
 #else
@@ -207,6 +249,7 @@ typedef void * lv_group_user_data_t;
 #endif
 
 /* 1: Enable file system (might be required for images */
+
 #ifdef CONFIG_USE_LV_FILESYSTEM
 #define LV_USE_FILESYSTEM       CONFIG_USE_LV_FILESYSTEM
 #else
@@ -214,18 +257,21 @@ typedef void * lv_group_user_data_t;
 #endif
 
 #if LV_USE_FILESYSTEM
-/*Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`)*/
+/* Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`) */
+
 typedef void * lv_fs_drv_user_data_t;
 #endif
 
-/*1: Add a `user_data` to drivers and objects*/
+/* 1: Add a `user_data` to drivers and objects */
+
 #define LV_USE_USER_DATA        0
 
-/*========================
+/****************************************************************************
  * Image decoder and cache
- *========================*/
+ ****************************************************************************/
 
 /* 1: Enable indexed (palette) images */
+
 #ifdef CONFIG_LV_IMG_CF_INDEXED
 #define LV_IMG_CF_INDEXED       CONFIG_LV_IMG_CF_INDEXED
 #else
@@ -233,6 +279,7 @@ typedef void * lv_fs_drv_user_data_t;
 #endif
 
 /* 1: Enable alpha indexed images */
+
 #ifdef  CONFIG_LV_IMG_CF_ALPHA
 #define LV_IMG_CF_ALPHA         CONFIG_LV_IMG_CF_ALPHA
 #else
@@ -240,32 +287,45 @@ typedef void * lv_fs_drv_user_data_t;
 #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.
+ * If only the built-in image formats are used there is
+ * no real advantage of caching.
  * (I.e. no new image decoder is added)
- * With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
+ * 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.
- * LV_IMG_CACHE_DEF_SIZE must be >= 1 */
+ * LV_IMG_CACHE_DEF_SIZE must be >= 1
+ */
+
 #define LV_IMG_CACHE_DEF_SIZE       1
 
-/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
+/* Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`) */
+
 typedef void * lv_img_decoder_user_data_t;
 
-/*=====================
+/****************************************************************************
  *  Compiler settings
- *====================*/
+ ****************************************************************************/
+
 /* Define a custom attribute to `lv_tick_inc` function */
+
 #define LV_ATTRIBUTE_TICK_INC
 
 /* Define a custom attribute to `lv_task_handler` function */
+
 #define LV_ATTRIBUTE_TASK_HANDLER
 
 /* With size optimization (-Os) the compiler might not align data to
- * 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
- * E.g. __attribute__((aligned(4))) */
+ * 4 or 8 byte boundary. This alignment will be explicitly applied
+ * where needed.
+ * E.g. __attribute__((aligned(4)))
+ */
+
 #define LV_ATTRIBUTE_MEM_ALIGN
 
 /* Attribute to mark large constant arrays for example
- * font's bitmaps */
+ * font's bitmaps
+ */
+
 #define LV_ATTRIBUTE_LARGE_CONST
 
 /* Export integer constant to binding.
@@ -274,28 +334,32 @@ typedef void * lv_img_decoder_user_data_t;
  *
  * The default value just prevents a GCC warning.
  */
+
 #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning
 
-/*===================
+/****************************************************************************
  *  HAL settings
- *==================*/
+ ****************************************************************************/
 
 /* 1: use a custom tick source.
- * It removes the need to manually update the tick with `lv_tick_inc`) */
+ * It removes the need to manually update the tick with `lv_tick_inc`)
+ */
+
 #define LV_TICK_CUSTOM     0
 #if LV_TICK_CUSTOM == 1
 #define LV_TICK_CUSTOM_INCLUDE  "something.h"       /*Header for the sys time function*/
 #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())     /*Expression evaluating to current systime in ms*/
 #endif   /*LV_TICK_CUSTOM*/
 
-typedef void * lv_disp_drv_user_data_t;             /*Type of user data in the display driver*/
-typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the input device driver*/
+typedef void * lv_disp_drv_user_data_t;             /* Type of user data in the display driver */
+typedef void * lv_indev_drv_user_data_t;            /* Type of user data in the input device driver*/
 
-/*================
+/****************************************************************************
  * Log settings
- *===============*/
+ ****************************************************************************/
+
+/* 1: Enable the log module */
 
-/*1: Enable the log module*/
 #ifdef CONFIG_USE_LV_LOG
 #define LV_USE_LOG      CONFIG_USE_LV_LOG
 #else
@@ -304,12 +368,13 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
 
 #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_NONE        Do not log anything
+ * 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 happened but didn't cause a crash
+ * LV_LOG_LEVEL_ERROR - Only critical issue, when the system may fail
+ * LV_LOG_LEVEL_NONE  - Do not log anything
  */
+
 #ifdef CONFIG_LV_LOG_LEVEL_TRACE
 #  define LV_LOG_LEVEL    LV_LOG_LEVEL_TRACE
 #endif
@@ -331,7 +396,9 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
 #endif
 
 /* 1: Print the log with 'printf';
- * 0: user need to register a callback with `lv_log_register_print_cb`*/
+ * 0: user need to register a callback with `lv_log_register_print_cb`
+ */
+
 #ifdef CONFIG_LV_LOG_PRINTF
 #  define LV_LOG_PRINTF   CONFIG_LV_LOG_PRINTF
 #else
@@ -339,9 +406,9 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
 #endif
 #endif  /*LV_USE_LOG*/
 
-/*=================
+/****************************************************************************
  * Debug settings
- *================*/
+ ****************************************************************************/
 
 /* If Debug is enabled LittelvGL validates the parameters of the functions.
  * If an invalid parameter is found an error log message is printed and
@@ -352,32 +419,45 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
  * The behavior of asserts can be overwritten by redefining them here.
  * E.g. #define LV_ASSERT_MEM(p)  <my_assert_code>
  */
+
 #define LV_USE_DEBUG        0
 #if LV_USE_DEBUG
 
-/*Check if the parameter is NULL. (Quite fast) */
+/* Check if the parameter is NULL. (Quite fast) */
+
 #define LV_USE_ASSERT_NULL      1
 
-/*Checks is the memory is successfully allocated or no. (Quite fast)*/
+/* Checks is the memory is successfully allocated or no. (Quite fast) */
+
 #define LV_USE_ASSERT_MEM       1
 
 /* Check the strings.
- * Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)
- * If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
+ * Search for NULL, very long strings, invalid characters,
+ * and unnatural repetitions. (Slow)
+ * If disabled `LV_USE_ASSERT_NULL` will be performed instead
+ * (if it's enabled)
+ */
+
 #define LV_USE_ASSERT_STR       0
 
-/* Check NULL, the object's type and existence (e.g. not deleted). (Quite slow)
- * If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
+/* Check NULL, the object's type and existence
+ * (e.g. not deleted). (Quite slow)
+ * If disabled `LV_USE_ASSERT_NULL` will be
+ * performed instead (if it's enabled)
+ */
+
 #define LV_USE_ASSERT_OBJ       0
 
-/*Check if the styles are properly initialized. (Fast)*/
+/* Check if the styles are properly initialized. (Fast) */
+
 #define LV_USE_ASSERT_STYLE     1
 
 #endif /*LV_USE_DEBUG*/
 
-/*================
+/****************************************************************************
  *  THEME USAGE
- *================*/
+ ****************************************************************************/
+
 #ifdef CONFIG_LV_THEME_LIVE_UPDATE
 #define LV_THEME_LIVE_UPDATE    CONFIG_LV_THEME_LIVE_UPDATE
 #else
@@ -432,18 +512,21 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
 #define LV_USE_THEME_NEMO       0   /*Water-like theme based on the movie "Finding Nemo"*/
 #endif
 
-/*==================
+/****************************************************************************
  *    FONT USAGE
- *===================*/
+ ****************************************************************************/
 
-/* The built-in fonts contains the ASCII range and some Symbols with  4 bit-per-pixel.
+/* The built-in fonts contains the ASCII range and
+ * some Symbols with  4 bit-per-pixel.
  * The symbols are available via `LV_SYMBOL_...` defines
  * More info about fonts: https://docs.littlevgl.com/#Fonts
  * To create a new font go to: https://littlevgl.com/ttf-font-to-c-array
  */
 
 /* Robot fonts with bpp = 4
- * https://fonts.google.com/specimen/Roboto  */
+ * https://fonts.google.com/specimen/Roboto
+ */
+
 #ifdef CONFIG_USE_LV_FONT_ROBOTO_12
 #define LV_FONT_ROBOTO_12     CONFIG_USE_LV_FONT_ROBOTO_12
 #else
@@ -469,11 +552,14 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
 #endif
 
 /* Demonstrate special features */
+
 #define LV_FONT_ROBOTO_12_SUBPX 1
 #define LV_FONT_ROBOTO_28_COMPRESSED 1  /*bpp = 3*/
 
-/*Pixel perfect monospace font
- * http://pelulamu.net/unscii/ */
+/* Pixel perfect monospace font
+ * http://pelulamu.net/unscii/
+ */
+
 #ifdef CONFIG_USE_LV_FONT_UNSCII_8
 #define LV_FONT_UNSCII_8      CONFIG_USE_LV_FONT_UNSCII_8
 #else
@@ -486,9 +572,11 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
  * #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \
  *                                LV_FONT_DECLARE(my_font_2)
  */
+
 #define LV_FONT_CUSTOM_DECLARE
 
-/*Always set a default font from the built-in fonts*/
+/* Always set a default font from the built-in fonts */
+
 #ifdef CONFIG_LV_FONT_DEFAULT_ROBOTO_12
 #define LV_FONT_DEFAULT        &lv_font_roboto_12
 #endif
@@ -511,61 +599,83 @@ typedef void * lv_indev_drv_user_data_t;            /*Type of user data in the i
 
 /* Enable it if you have fonts with a lot of characters.
  * The limit depends on the font size, font face and bpp
- * but with > 10,000 characters if you see issues probably you need to enable it.*/
+ * but with > 10,000 characters if you see issues probably you need
+ * to enable it.
+ */
+
 #define LV_FONT_FMT_TXT_LARGE   0
 
 /* Set the pixel order of the display.
  * Important only if "subpx fonts" are used.
  * With "normal" font it doesn't matter.
  */
+
 #define LV_FONT_SUBPX_BGR    0
 
-/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
+/* Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`) */
+
 typedef void * lv_font_user_data_t;
 
-/*=================
+/****************************************************************************
  *  Text settings
- *=================*/
+ ****************************************************************************/
 
 /* Select a character encoding for strings.
  * Your IDE or editor should have the same character encoding
  * - LV_TXT_ENC_UTF8
  * - LV_TXT_ENC_ASCII
- * */
+ */
+
 #define LV_TXT_ENC LV_TXT_ENC_UTF8
 
- /*Can break (wrap) texts on these chars*/
+/* Can break (wrap) texts on these chars */
+
 #define LV_TXT_BREAK_CHARS                  " ,.;:-_"
 
 /* If a word is at least this long, will break wherever "prettiest"
- * To disable, set to a value <= 0 */
+ * To disable, set to a value <= 0
+ */
+
 #define LV_TXT_LINE_BREAK_LONG_LEN          12
 
-/* Minimum number of characters in a long word to put on a line before a break.
- * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
+/* Minimum number of characters in a long word to put
+ * on a line before a break.
+ * Depends on LV_TXT_LINE_BREAK_LONG_LEN.
+ */
+
 #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN  3
 
-/* Minimum number of characters in a long word to put on a line after a break.
- * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
+/* Minimum number of characters in a long word to put on a
+ * line after a break.
+ * Depends on LV_TXT_LINE_BREAK_LONG_LEN.
+ */
+
 #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
 
 /* The control character to use for signalling text recoloring. */
+
 #define LV_TXT_COLOR_CMD "#"
 
 /* Support bidirectional texts.
  * Allows mixing Left-to-Right and Right-to-Left texts.
- * The direction will be processed according to the Unicode Bidirectioanl Algorithm:
- * https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
+ * The direction will be processed according to the
+ * Unicode Bidirectioanl Algorithm:
+ * https://www.w3.org/International/articles/inline-bidi-markup/uba-basics
+ */
+
 #define LV_USE_BIDI     0
 #if LV_USE_BIDI
 /* Set the default direction. Supported values:
  * `LV_BIDI_DIR_LTR` Left-to-Right
  * `LV_BIDI_DIR_RTL` Right-to-Left
- * `LV_BIDI_DIR_AUTO` detect texts base direction */
+ * `LV_BIDI_DIR_AUTO` detect texts base direction
+ */
+
 #define LV_BIDI_BASE_DIR_DEF  LV_BIDI_DIR_AUTO
 #endif
 
-/*Change the built in (v)snprintf functions*/
+/* Change the built in (v)snprintf functions */
+
 #define LV_SPRINTF_CUSTOM   0
 #if LV_SPRINTF_CUSTOM
 #  define LV_SPRINTF_INCLUDE <stdio.h>
@@ -573,14 +683,16 @@ typedef void * lv_font_user_data_t;
 #  define lv_vsnprintf    vsnprintf
 #endif  /*LV_SPRINTF_CUSTOM*/
 
-/*===================
+/****************************************************************************
  *  LV_OBJ SETTINGS
- *==================*/
+ ****************************************************************************/
+
+/* Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`) */
 
-/*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
 typedef void * lv_obj_user_data_t;
 
-/*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
+/* 1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters */
+
 #ifdef CONFIG_LV_OBJ_REALIGN
 #define LV_USE_OBJ_REALIGN          CONFIG_LV_OBJ_REALIGN
 #else
@@ -589,33 +701,38 @@ typedef void * lv_obj_user_data_t;
 
 /* Enable to make the object clickable on a larger area.
  * LV_EXT_CLICK_AREA_OFF or 0: Disable this feature
- * LV_EXT_CLICK_AREA_TINY: The extra area can be adjusted horizontally and vertically (0..255 px)
- * LV_EXT_CLICK_AREA_FULL: The extra area can be adjusted in all 4 directions (-32k..+32k px)
+ * LV_EXT_CLICK_AREA_TINY: The extra area can be adjusted
+ *  horizontally and vertically (0..255 px)
+ * LV_EXT_CLICK_AREA_FULL: The extra area can be adjusted
+ * in all 4 directions (-32k..+32k px)
  */
+
 #define LV_USE_EXT_CLICK_AREA  LV_EXT_CLICK_AREA_OFF
 
-/*==================
+/****************************************************************************
  *  LV OBJ X USAGE
- *================*/
-/*
- * Documentation of the object types: https://docs.littlevgl.com/#Object-types
- */
+ ****************************************************************************/
+
+/* Documentation of the object types: https://docs.littlevgl.com/#Object-types */
+
+/* Arc (dependencies: -) */
 
-/*Arc (dependencies: -)*/
 #ifdef CONFIG_USE_LV_ARC
 #define LV_USE_ARC      CONFIG_USE_LV_ARC
 #else
 #define LV_USE_ARC      0
 #endif
 
-/*Bar (dependencies: -)*/
+/* Bar (dependencies: -) */
+
 #ifdef CONFIG_USE_LV_BAR
 #define LV_USE_BAR      CONFIG_USE_LV_BAR
 #else
 #define LV_USE_BAR      0
 #endif
 
-/*Button (dependencies: lv_cont*/
+/* Button (dependencies: lv_cont) */
+
 #ifdef CONFIG_USE_LV_BTN
 #define LV_USE_BTN      CONFIG_USE_LV_BTN
 #else
@@ -623,7 +740,9 @@ typedef void * lv_obj_user_data_t;
 #endif
 
 #if LV_USE_BTN != 0
-/*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/
+
+/* Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION) */
+
 #ifdef CONFIG_LV_BTN_INK_EFFECT
 #define LV_BTN_INK_EFFECT      CONFIG_LV_BTN_INK_EFFECT
 #else
@@ -632,37 +751,40 @@ typedef void * lv_obj_user_data_t;
 
 #endif
 
-/*Button matrix (dependencies: -)*/
+/* Button matrix (dependencies: -) */
+
 #ifdef CONFIG_USE_LV_BTNM
 #define LV_USE_BTNM      CONFIG_USE_LV_BTNM
 #else
 #define LV_USE_BTNM      0
 #endif
 
-/*Calendar (dependencies: -)*/
+/* Calendar (dependencies: -) */
+
 #ifdef CONFIG_USE_LV_CALENDAR
 #define LV_USE_CALENDAR      CONFIG_USE_LV_CALENDAR
 #else
 #define LV_USE_CALENDAR      0
 #endif
 
-/*Canvas (dependencies: lv_img)*/
+/* Canvas (dependencies: lv_img) */
+
 #ifdef CONFIG_USE_LV_CANVAS
 #define LV_USE_CANVAS      CONFIG_USE_LV_CANVAS
 #else
 #define LV_USE_CANVAS      0
 #endif
 
+/* Check box (dependencies: lv_btn, lv_label) */
 
-
-/*Check box (dependencies: lv_btn, lv_label)*/
 #ifdef CONFIG_USE_LV_CB
 #define LV_USE_CB      CONFIG_USE_LV_CB
 #else
 #define LV_USE_CB      0
 #endif
 
-/*Chart (dependencies: -)*/
+/* Chart (dependencies: -) */
+
 #ifdef CONFIG_USE_LV_CHART
 #define LV_USE_CHART      CONFIG_USE_LV_CHART
 #else
@@ -673,78 +795,101 @@ typedef void * lv_obj_user_data_t;
 #  define LV_CHART_AXIS_TICK_LABEL_MAX_LEN    CONFIG_LV_CHART_AXIS_TICK_LABEL_MAX_LEN
 #endif
 
-/*Container (dependencies: -*/
+/* Container (dependencies: -) */
+
 #define LV_USE_CONT     1
 
-/*Color picker (dependencies: -*/
+/* Color picker (dependencies: -) */
+
 #define LV_USE_CPICKER   1
 
-/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
+/* Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h) */
+
 #define LV_USE_DDLIST    1
 #if LV_USE_DDLIST != 0
-/*Open and close default animation time [ms] (0: no animation)*/
+/* Open and close default animation time [ms] (0: no animation) */
+
 #  define LV_DDLIST_DEF_ANIM_TIME     200
 #endif
 
-/*Gauge (dependencies:lv_bar, lv_lmeter)*/
+/* Gauge (dependencies:lv_bar, lv_lmeter) */
+
 #define LV_USE_GAUGE    1
 
-/*Image (dependencies: lv_label*/
+/* Image (dependencies: lv_label) */
+
 #define LV_USE_IMG      1
 
-/*Image Button (dependencies: lv_btn*/
+/* Image Button (dependencies: lv_btn) */
+
 #define LV_USE_IMGBTN   1
 #if LV_USE_IMGBTN
-/*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
+/* 1: The imgbtn requires left, mid and right parts and the width can be set freely */
+
 #  define LV_IMGBTN_TILED 0
 #endif
 
-/*Keyboard (dependencies: lv_btnm)*/
+/* Keyboard (dependencies: lv_btnm) */
+
 #define LV_USE_KB       1
 
-/*Label (dependencies: -*/
+/* Label (dependencies: -) */
+
 #define LV_USE_LABEL    1
 #if LV_USE_LABEL != 0
-/*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode*/
+/* Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode */
+
 #  define LV_LABEL_DEF_SCROLL_SPEED       25
 
 /* Waiting period at beginning/end of animation cycle */
+
 #  define LV_LABEL_WAIT_CHAR_COUNT        3
 
-/*Enable selecting text of the label */
+/* Enable selecting text of the label */
+
 #  define LV_LABEL_TEXT_SEL               0
 
-/*Store extra some info in labels (12 bytes) to speed up drawing of very long texts*/
+/* Store extra some info in labels (12 bytes) to speed up drawing of very long texts */
+
 #  define LV_LABEL_LONG_TXT_HINT          0
 #endif
 
-/*LED (dependencies: -)*/
+/* LED (dependencies: -) */
+
 #define LV_USE_LED      1
 
-/*Line (dependencies: -*/
+/* Line (dependencies: -) */
+
 #define LV_USE_LINE     1
 
-/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
+/* List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons)) */
+
 #define LV_USE_LIST     1
 #if LV_USE_LIST != 0
-/*Default animation time of focusing to a list element [ms] (0: no animation)  */
+/* Default animation time of focusing to a list element [ms] (0: no animation) */
+
 #  define LV_LIST_DEF_ANIM_TIME  100
 #endif
 
-/*Line meter (dependencies: *;)*/
+/* Line meter (dependencies: *) */
+
 #define LV_USE_LMETER   1
 
-/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
+/* Message box (dependencies: lv_rect, lv_btnm, lv_label) */
+
 #define LV_USE_MBOX     1
 
-/*Page (dependencies: lv_cont)*/
+/* Page (dependencies: lv_cont) */
+
 #define LV_USE_PAGE     1
 #if LV_USE_PAGE != 0
-/*Focus default animation time [ms] (0: no animation)*/
+/* Focus default animation time [ms] (0: no animation) */
+
 #  define LV_PAGE_DEF_ANIM_TIME     400
 #endif
 
-/*Preload (dependencies: lv_arc, lv_anim)*/
+/* Preload (dependencies: lv_arc, lv_anim) */
+
 #define LV_USE_PRELOAD      1
 #if LV_USE_PRELOAD != 0
 #  define LV_PRELOAD_DEF_ARC_LENGTH   60      /*[deg]*/
@@ -752,64 +897,82 @@ typedef void * lv_obj_user_data_t;
 #  define LV_PRELOAD_DEF_ANIM         LV_PRELOAD_TYPE_SPINNING_ARC
 #endif
 
-/*Roller (dependencies: lv_ddlist)*/
+/* Roller (dependencies: lv_ddlist) */
+
 #define LV_USE_ROLLER    1
 #if LV_USE_ROLLER != 0
-/*Focus animation time [ms] (0: no animation)*/
+/* Focus animation time [ms] (0: no animation) */
+
 #  define LV_ROLLER_DEF_ANIM_TIME     200
 
-/*Number of extra "pages" when the roller is infinite*/
+/* Number of extra "pages" when the roller is infinite */
+
 #  define LV_ROLLER_INF_PAGES         7
 #endif
 
-/*Slider (dependencies: lv_bar)*/
+/* Slider (dependencies: lv_bar) */
+
 #define LV_USE_SLIDER    1
 
-/*Spinbox (dependencies: lv_ta)*/
+/* Spinbox (dependencies: lv_ta) */
+
 #define LV_USE_SPINBOX       1
 
-/*Switch (dependencies: lv_slider)*/
+/* Switch (dependencies: lv_slider) */
+
 #define LV_USE_SW       1
 
-/*Text area (dependencies: lv_label, lv_page)*/
+/* Text area (dependencies: lv_label, lv_page) */
+
 #define LV_USE_TA       1
 #if LV_USE_TA != 0
 #  define LV_TA_DEF_CURSOR_BLINK_TIME 400     /*ms*/
 #  define LV_TA_DEF_PWD_SHOW_TIME     1500    /*ms*/
 #endif
 
-/*Table (dependencies: lv_label)*/
+/* Table (dependencies: lv_label) */
+
 #define LV_USE_TABLE    1
 #if LV_USE_TABLE
 #  define LV_TABLE_COL_MAX    12
 #endif
 
-/*Tab (dependencies: lv_page, lv_btnm)*/
+/* Tab (dependencies: lv_page, lv_btnm) */
+
 #define LV_USE_TABVIEW      1
 #  if LV_USE_TABVIEW != 0
-/*Time of slide animation [ms] (0: no animation)*/
+/* Time of slide animation [ms] (0: no animation) */
+
 #  define LV_TABVIEW_DEF_ANIM_TIME    300
 #endif
 
-/*Tileview (dependencies: lv_page) */
+/* Tileview (dependencies: lv_page) */
+
 #define LV_USE_TILEVIEW     1
 #if LV_USE_TILEVIEW
-/*Time of slide animation [ms] (0: no animation)*/
+/* Time of slide animation [ms] (0: no animation) */
+
 #  define LV_TILEVIEW_DEF_ANIM_TIME   300
 #endif
 
-/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
+/* Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page) */
+
 #define LV_USE_WIN      1
 
-/*==================
+/****************************************************************************
  * Non-user section
- *==================*/
+ ****************************************************************************/
 
 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)    /* Disable warnings for Visual Studio*/
 #  define _CRT_SECURE_NO_WARNINGS
 #endif
 
-/*Be sure every define has a default value*/
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+/* Be sure every define has a default value */
+
 #include "lvgl/src/lv_conf_checker.h"
 
 #endif /*__APPS_GRAPHICS_LITTLEVGL_LV_CONF_H*/