Commit 948a6922 authored by Gerard Marull-Paretas's avatar Gerard Marull-Paretas Committed by Maureen Helm
Browse files

lib: gui: lvgl: split Kconfig settings



LVGL Kconfig settings have been splitted into more granular units in
order to improve readability and maintenance.

Signed-off-by: default avatarGerard Marull-Paretas <gerard@teslabs.com>
parent 4f86a9a2
Loading
Loading
Loading
Loading
+12 −534
Original line number Diff line number Diff line
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
# Copyright (c) 2020 Teslabs Engineering S.L.
# SPDX-License-Identifier: Apache-2.0

menuconfig LVGL
@@ -12,540 +13,6 @@ module = LVGL
module-str = lvgl
source "subsys/logging/Kconfig.template.log_config"

config LVGL_DISPLAY_DEV_NAME
	string "Display device name"
	default "DISPLAY"
	help
	  Name of the display device to use for rendering.

config LVGL_POINTER_KSCAN
	bool "Keyboard scan pointer input"
	depends on KSCAN
	help
	  Enable keyboard scan pointer input

if LVGL_POINTER_KSCAN

config LVGL_POINTER_KSCAN_DEV_NAME
	string "Keyboard scan device name for pointer input"
	default "KSCAN"
	help
	  Name of the keyboard scan device to use for pointer input.

config LVGL_POINTER_KSCAN_MSGQ_COUNT
	int "Keyboard scan message queue count maximum"
	default 10
	help
	  Maximum number of items in the keyboard scan message queue.

endif # LVGL_POINTER_KSCAN

config LVGL_HOR_RES_MAX
	int "Horizontal Screen Resolution"
	default 480
	help
	  Horizontal screen resolution in pixels

config LVGL_VER_RES_MAX
	int "Vertical Screen Resolution"
	default 320
	help
	  Vertical screen resolution in pixels

config LVGL_DPI
	int "DPI"
	default 130
	help
	  Dots per inch (DPI)

config LVGL_DISP_SMALL_LIMIT
	int "Small display limit"
	default 30
	help
	  According to the width of the display (hor. res. / dpi) the displays fall
	  in 4 categories. This limit is the threshold for small displays.

config LVGL_DISP_MEDIUM_LIMIT
	int "Medium display limit"
	default 50
	help
	  According to the width of the display (hor. res. / dpi) the displays fall
	  in 4 categories. This limit is the threshold for medium displays.

config LVGL_DISP_LARGE_LIMIT
	int "Large display limit"
	default 70
	help
	  According to the width of the display (hor. res. / dpi) the displays fall
	  in 4 categories. This limit is the threshold for large displays.

choice LVGL_COLOR_DEPTH
	prompt "Color Depth"
	default LVGL_COLOR_DEPTH_32
	help
	  Color depth to be used by library

	config LVGL_COLOR_DEPTH_32
		bool "32-bit"

	config LVGL_COLOR_DEPTH_16
		bool "16-bit"

	config LVGL_COLOR_DEPTH_8
		bool "8-bit"

	config LVGL_COLOR_DEPTH_1
		bool "1-bit"

endchoice

config LVGL_BITS_PER_PIXEL
	int "Bits per pixel"
	default 32
	range 1 32
	depends on LVGL_BUFFER_ALLOC_STATIC
	help
	  Number of bits per pixel.

config LVGL_COLOR_16_SWAP
	bool "RGB565 byte swap"
	depends on LVGL_COLOR_DEPTH_16
	help
	  Swap the 2 bytes of a RGB565 pixel.

config LVGL_COLOR_SCREEN_TRANSP
	bool "Transparency support"
	depends on LVGL_COLOR_DEPTH_32
	help
	  Enable screen transparency. Useful for OSD or other overlapping GUISs.

choice
	prompt "Chroma key color"
	default LVGL_COLOR_TRANSP_GREEN
	help
	  Color to to use as chroma key

	config LVGL_COLOR_TRANSP_RED
		bool "Red"

	config LVGL_COLOR_TRANSP_GREEN
		bool "Green"

	config LVGL_COLOR_TRANSP_BLUE
		bool "Blue"

	config LVGL_COLOR_TRANSP_CUSTOM
		bool "Custom"

endchoice

if LVGL_COLOR_TRANSP_CUSTOM
config LVGL_CUSTOM_COLOR_TRANSP_RED
	hex "Chroma Key Red"
	range 0x00 0xFF
	default 0x00
	help
	  Value of the color red to be used in the chroma key

config LVGL_CUSTOM_COLOR_TRANSP_GREEN
	hex "Chroma Key Green"
	range 0x00 0xFF
	default 0xFF
	help
	  Value of the color green to be used in the chroma key

config LVGL_CUSTOM_COLOR_TRANSP_BLUE
	hex "Chroma Key Blue"
	range 0x00 0xFF
	default 0x00
	help
	  Value of the color blue to be used in the chroma key

endif

choice
	prompt "Memory pool"
	default LVGL_MEM_POOL_HEAP_KERNEL
	help
	  Memory pool to use for lvgl allocated objects

	config LVGL_MEM_POOL_HEAP_KERNEL
		bool "Kernel Heap"
		depends on HEAP_MEM_POOL_SIZE != 0
		help
		  Use k_malloc and k_free to allocate objects on the kernel heap

	config LVGL_MEM_POOL_HEAP_LIB_C
	  bool "C library Heap"
	  depends on !MINIMAL_LIBC || (MINIMAL_LIBC_MALLOC_ARENA_SIZE != 0)
	  help
		Use C library malloc and free to allocate objects on the C library heap

	config LVGL_MEM_POOL_KERNEL
		bool "Kernel space lvgl pool"
		help
		  Use a dedicated memory pool in kernel space to allocate lvgl objects
		  on

	config LVGL_MEM_POOL_USER
		bool "User space lvgl pool"
		help
		  Use a dedicated memory pool in user space to allocate lvgl objects on

endchoice

if LVGL_MEM_POOL_KERNEL || LVGL_MEM_POOL_USER

config LVGL_MEM_POOL_MIN_SIZE
	int "Minimum memory pool block size"
	default 16
	help
	  Size of the smallest block in the memory pool in bytes

config LVGL_MEM_POOL_MAX_SIZE
	int "Maximum memory pool block size"
	default 2048
	help
	  Size of the largest block in the memory pool in bytes

config LVGL_MEM_POOL_NUMBER_BLOCKS
	int "Number of max size blocks in memory pool"
	default 1
	help
	  Number of maximum sized blocks in the memory pool.

endif

config LVGL_VDB_SIZE
	int "Rendering buffer size"
	default 10
	range 1 100
	help
	  Size of the buffer used for rendering screen content as a percentage
	  of total display size.

config LVGL_DOUBLE_VDB
	bool "Use two rendering buffers"
	help
	  Use two buffers to render and flush data in parallel

choice
	prompt "Rendering Buffer Allocation"
	default LVGL_BUFFER_ALLOC_STATIC
	help
	  Type of allocation that should be used for allocating rendering buffers

config LVGL_BUFFER_ALLOC_STATIC
	bool "Static"
	help
	  Rendering buffers are statically allocated based on the following
	  configuration parameters:
	  * Horizontal screen resolution
	  * Vertical screen resolution
	  * Rendering buffer size
	  * Bytes per pixel

config LVGL_BUFFER_ALLOC_DYNAMIC
	bool "Dynamic"
	help
	  Rendering buffers are dynamically allocated based on the actual
	  display parameters

endchoice

config LVGL_DISP_DEF_REFR_PERIOD
	int "Screen refresh period"
	default 30
	help
	  Screen refresh period in milliseconds

config LVGL_INDEV_DEF_READ_PERIOD
	int "Input device refresh period"
	default 30
	help
	  Refresh period for input devices in milliseconds

config LVGL_INDEV_DEF_DRAG_LIMIT
	int "Drag Threshold"
	default 10
	help
	  Threshold in pixels before entering drag mode

config LVGL_INDEV_DEF_DRAG_THROW
	int "Drag throw slow-down"
	default 10
	range 0 100
	help
	  Percentage of slow down of a throw following a drag.
	  Greater percentage means faster slow-down.

config LVGL_INDEV_DEF_LONG_PRESS_TIME
	int "Long press time"
	default 400
	help
	  Period in milliseconds before a press is seen as a long press

config LVGL_INDEV_DEF_LONG_PRESS_REP_TIME
	int "Long press repeat time"
	default 100
	help
	  Period in milliseconds after which a new trigger is generated
	  for a long press

config LVGL_INDEV_DEF_GESTURE_LIMIT
	int "Gesture threshold"
	default 50
	help
	  Gesture threshold in pixels

config LVGL_INDEV_DEF_GESTURE_MIN_VELOCITY
	int "Gesture minimum velocity"
	default 3
	help
	  Gesture min velocity at release before swipe (pixels)

choice
	prompt "String character encoding"
	default LVGL_TXT_ENC_ASCII

config LVGL_TXT_ENC_ASCII
	bool "ASCII string encoding"

config LVGL_TXT_ENC_UTF8
	bool "UTF-8 string encoding"

endchoice

config LVGL_TXT_BREAK_CHARS
	string "Text break characters"
	default " ,.;:-_"
	help
	  Characters on which a text break can take place

config LVGL_TXT_LINE_BREAK_LONG_LEN
	int "Minimal word length for line break"
	default 0
	help
	  If a word is at least this long, a line break is allowed in the word.

	  If the length is 0, no line break is allowed in the middle of a word.

config LVGL_TXT_LINE_BREAK_LONG_PRE_MIN_LEN
	int "Minimal number of characters on line before line break"
	default 3
	help
	  Minimal number of characters to place on a line before a line break
	  in the middle of a word can occur.

config LVGL_TXT_LINE_BREAK_LONG_POST_MIN_LEN
	int "Minimal number of characters on line after line break"
	default 3
	help
	  Minimal number of characters to place on a line after a line break
	  occurred in the middle of a word.

config LVGL_TXT_COLOR_CMD
	string "Text recoloring control character"
	default "#"
	help
	  Control character to use for signalling text recoloring

config LVGL_USE_BIDI
	bool "Enable bidirectional text support"
	help
	  Enable bidirectional text support

	  The direction of the text will be processed according to the
	  Unicode Bidirectional Algorithm:
	  https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/

choice LVGL_BIDI_MODE
	prompt "Bidirectional text processing direction"
	default LVGL_BIDI_DIR_AUTO
	depends on LVGL_USE_BIDI
	help
	  Direction of bidirectional text processing

	config LVGL_BIDI_DIR_AUTO
		bool "Automatically detect direction"

	config LVGL_BIDI_DIR_LTR
		bool "Left-to-right"

	config LVGL_BIDI_DIR_RTL
		bool "Right-to-left"

endchoice

config LVGL_USE_ARABIC_PERSIAN_CHARS
	bool "Enable Arabic/Persian processing"
	help
	  Enable Arabic/Persian processing

	  In these languages characters should be replaced with an other form based
	  on their position in the text

config LVGL_ANTIALIAS
	bool "Enable anti-aliasing"
	help
	  Enable anti-aliasing

config LVGL_USE_ANIMATION
	bool "Enable animations"
	help
	  Enable animations

config LVGL_USE_SHADOW
	bool "Enable shadows"
	help
	  Enable shadows

config LVGL_SHADOW_CACHE_SIZE
	int "Shadow cache size"
	depends on LVGL_USE_SHADOW
	default 0
	help
	  Allow buffering some shadow calculation. This parameter is the maximum
	  shadow size to buffer.

config LVGL_USE_BLEND_MODES
	bool "Enable other blend modes"
	help
	  Use other blend modes than normal

config LVGL_USE_OPA_SCALE
	bool "Enable opa_scale style property"
	help
	  Use the opa_scale style property to set the opacity of an object and
	  its children at once

config LVGL_USE_IMG_TRANSFORM
	bool "Enable image transformations"
	help
	  Use image zoom and rotation

config LVGL_USE_GROUP
	bool "Enable group support"
	help
	  Enable group support.
	  Used by keyboard and button input

config LVGL_USE_GPU
	bool "Enable GPU support"
	help
	  Enable GPU support

config LVGL_IMG_CF_INDEXED
	bool "Enable indexed image support"
	default y
	help
	  Enable support for indexed images

config LVGL_IMG_CF_ALPHA
	bool "Enable alpha indexed image support"
	default y
	help
	  Enable support for alpha indexed images

config LVGL_USE_FILESYSTEM
	bool "Enable file system"
	depends on FILE_SYSTEM
	default y if FILE_SYSTEM
	help
	  Enable LittlevGL file system

config LVGL_USE_PERF_MONITOR
	bool "Enable performance monitor"
	help
	  Show CPU usage and FPS count in the right bottom corner

config LVGL_USE_API_EXTENSION_V6
	bool "Enable V6 API extensions"
	help
	  Use the functions and types from the older API if possible

config LVGL_IMG_CACHE_DEF_SIZE
	int "Default image cache size"
	default 1
	help
	  Default image cache size, image caching keeps the images open.
	  If only the built-in image formats are used there is no real
	  advantage of caching. With complex image decoders (e.g. PNG or JPG)
	  caching can save the continuous decoding of images. However the
	  opened images might consume additional RAM.

config LVGL_USE_DEBUG
	bool "Enable debug support"
	default y if TEST
	help
	  Enable debug support.

	  If debug support is enabled LVGL will validate the parameters of
	  any function call made and if an invalid parameter is found __ASSERT
	  is called.

if LVGL_USE_DEBUG

config LVGL_USE_ASSERT_NULL
	bool "Enable null pointer assertion"
	default y if TEST
	help
	  Enable null pointer assertion

	  Check if a null pointer is passed as a parameter (Quite fast)

config LVGL_USE_ASSERT_MEM
	bool "Enable memory allocation assertion"
	default y if TEST
	help
	  Enable memory allocation assertion

	  Check if memory allocation is successful (Quite fast)

config LVGL_USE_ASSERT_MEM_INTEGRITY
	bool "Enable memory integrity check"
	default y if TEST
	help
	  Check the integrity of lv_mem after critical operations. (Slow)

config LVGL_USE_ASSERT_STR
	bool "Enable string assertion"
	default y if TEST
	help
	  Enable string assertion

	  Check if the string is not a NULL pointer, unusually long string,
	  contains invalid characters or contains unusual repetitions. (Slow)

	  If this option is disabled and NULL pointer checking is enabled, the
	  NULL pointer check is executed instead.

config LVGL_USE_ASSERT_OBJ
	bool "Enable object assertion"
	default y if TEST
	help
	  Enable object assertion

	  Check if an object is not a NULL pointer, has the correct type and
	  does exists. (Quite Slow)

	  If this option is disabled and NULL pointer checking is enabled, the
	  NULL pointer check is executed instead.

config LVGL_USE_ASSERT_STYLE
	bool "Enable style assertion"
	default y if TEST
	help
	  Enable style assertion

	  Check if a used style is correctly initialized. (Fast)

endif

rsource "Kconfig.themes"
rsource "Kconfig.fonts"
rsource "Kconfig.objects"

config APP_LINK_WITH_LVGL
	bool "Link 'app' with LVGL"
	default y
@@ -554,4 +21,15 @@ config APP_LINK_WITH_LVGL
	  disabled if the include paths for LVGL are causing aliasing
	  issues for 'app'.

rsource "Kconfig.graphical"
rsource "Kconfig.memory"
rsource "Kconfig.input"
rsource "Kconfig.feature"
rsource "Kconfig.image"
rsource "Kconfig.debug"
rsource "Kconfig.themes"
rsource "Kconfig.fonts"
rsource "Kconfig.text"
rsource "Kconfig.objects"

endif # LVGL
+75 −0
Original line number Diff line number Diff line
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
# Copyright (c) 2020 Teslabs Engineering S.L.
# SPDX-License-Identifier: Apache-2.0

menu "Debug settings"

config LVGL_USE_DEBUG
	bool "Enable debug support"
	default y if TEST
	help
	  Enable debug support.

	  If debug support is enabled LVGL will validate the parameters of
	  any function call made and if an invalid parameter is found __ASSERT
	  is called.

if LVGL_USE_DEBUG

config LVGL_USE_ASSERT_NULL
	bool "Enable null pointer assertion"
	default y if TEST
	help
	  Enable null pointer assertion

	  Check if a null pointer is passed as a parameter (Quite fast)

config LVGL_USE_ASSERT_MEM
	bool "Enable memory allocation assertion"
	default y if TEST
	help
	  Enable memory allocation assertion

	  Check if memory allocation is successful (Quite fast)

config LVGL_USE_ASSERT_MEM_INTEGRITY
	bool "Enable memory integrity check"
	default y if TEST
	help
	  Check the integrity of lv_mem after critical operations. (Slow)

config LVGL_USE_ASSERT_STR
	bool "Enable string assertion"
	default y if TEST
	help
	  Enable string assertion

	  Check if the string is not a NULL pointer, unusually long string,
	  contains invalid characters or contains unusual repetitions. (Slow)

	  If this option is disabled and NULL pointer checking is enabled, the
	  NULL pointer check is executed instead.

config LVGL_USE_ASSERT_OBJ
	bool "Enable object assertion"
	default y if TEST
	help
	  Enable object assertion

	  Check if an object is not a NULL pointer, has the correct type and
	  does exists. (Quite Slow)

	  If this option is disabled and NULL pointer checking is enabled, the
	  NULL pointer check is executed instead.

config LVGL_USE_ASSERT_STYLE
	bool "Enable style assertion"
	default y if TEST
	help
	  Enable style assertion

	  Check if a used style is correctly initialized. (Fast)

endif

endmenu
+69 −0
Original line number Diff line number Diff line
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
# Copyright (c) 2020 Teslabs Engineering S.L.
# SPDX-License-Identifier: Apache-2.0

menu "Feature usage"

config LVGL_USE_ANIMATION
	bool "Enable animations"
	help
	  Enable animations

config LVGL_USE_SHADOW
	bool "Enable shadows"
	help
	  Enable shadows

config LVGL_SHADOW_CACHE_SIZE
	int "Shadow cache size"
	depends on LVGL_USE_SHADOW
	default 0
	help
	  Allow buffering some shadow calculation. This parameter is the maximum
	  shadow size to buffer.

config LVGL_USE_BLEND_MODES
	bool "Enable other blend modes"
	help
	  Use other blend modes than normal

config LVGL_USE_OPA_SCALE
	bool "Enable opa_scale style property"
	help
	  Use the opa_scale style property to set the opacity of an object and
	  its children at once

config LVGL_USE_IMG_TRANSFORM
	bool "Enable image transformations"
	help
	  Use image zoom and rotation

config LVGL_USE_GROUP
	bool "Enable group support"
	help
	  Enable group support.
	  Used by keyboard and button input

config LVGL_USE_GPU
	bool "Enable GPU support"
	help
	  Enable GPU support

config LVGL_USE_FILESYSTEM
	bool "Enable file system"
	depends on FILE_SYSTEM
	default y if FILE_SYSTEM
	help
	  Enable LittlevGL file system

config LVGL_USE_PERF_MONITOR
	bool "Enable performance monitor"
	help
	  Show CPU usage and FPS count in the right bottom corner

config LVGL_USE_API_EXTENSION_V6
	bool "Enable V6 API extensions"
	help
	  Use the functions and types from the older API if possible

endmenu
+140 −0
Original line number Diff line number Diff line
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
# Copyright (c) 2020 Teslabs Engineering S.L.
# SPDX-License-Identifier: Apache-2.0

menu "Graphical settings"

config LVGL_DISPLAY_DEV_NAME
	string "Display device name"
	default "DISPLAY"
	help
	  Name of the display device to use for rendering.

config LVGL_HOR_RES_MAX
	int "Horizontal Screen Resolution"
	default 480
	help
	  Horizontal screen resolution in pixels

config LVGL_VER_RES_MAX
	int "Vertical Screen Resolution"
	default 320
	help
	  Vertical screen resolution in pixels

choice LVGL_COLOR_DEPTH
	prompt "Color Depth"
	default LVGL_COLOR_DEPTH_32
	help
	  Color depth to be used by library

	config LVGL_COLOR_DEPTH_32
		bool "32-bit"

	config LVGL_COLOR_DEPTH_16
		bool "16-bit"

	config LVGL_COLOR_DEPTH_8
		bool "8-bit"

	config LVGL_COLOR_DEPTH_1
		bool "1-bit"

endchoice

config LVGL_COLOR_16_SWAP
	bool "RGB565 byte swap"
	depends on LVGL_COLOR_DEPTH_16
	help
	  Swap the 2 bytes of a RGB565 pixel.

config LVGL_COLOR_SCREEN_TRANSP
	bool "Transparency support"
	depends on LVGL_COLOR_DEPTH_32
	help
	  Enable screen transparency. Useful for OSD or other overlapping GUISs.

choice
	prompt "Chroma key color"
	default LVGL_COLOR_TRANSP_GREEN
	help
	  Color to to use as chroma key

	config LVGL_COLOR_TRANSP_RED
		bool "Red"

	config LVGL_COLOR_TRANSP_GREEN
		bool "Green"

	config LVGL_COLOR_TRANSP_BLUE
		bool "Blue"

	config LVGL_COLOR_TRANSP_CUSTOM
		bool "Custom"

endchoice

if LVGL_COLOR_TRANSP_CUSTOM

config LVGL_CUSTOM_COLOR_TRANSP_RED
	hex "Chroma Key Red"
	range 0x00 0xFF
	default 0x00
	help
	  Value of the color red to be used in the chroma key

config LVGL_CUSTOM_COLOR_TRANSP_GREEN
	hex "Chroma Key Green"
	range 0x00 0xFF
	default 0xFF
	help
	  Value of the color green to be used in the chroma key

config LVGL_CUSTOM_COLOR_TRANSP_BLUE
	hex "Chroma Key Blue"
	range 0x00 0xFF
	default 0x00
	help
	  Value of the color blue to be used in the chroma key

endif # LVGL_COLOR_TRANSP_CUSTOM

config LVGL_ANTIALIAS
	bool "Enable anti-aliasing"
	help
	  Enable anti-aliasing

config LVGL_DISP_DEF_REFR_PERIOD
	int "Screen refresh period"
	default 30
	help
	  Screen refresh period in milliseconds

config LVGL_DPI
	int "DPI"
	default 130
	help
	  Dots per inch (DPI)

config LVGL_DISP_SMALL_LIMIT
	int "Small display limit"
	default 30
	help
	  According to the width of the display (hor. res. / dpi) the displays fall
	  in 4 categories. This limit is the threshold for small displays.

config LVGL_DISP_MEDIUM_LIMIT
	int "Medium display limit"
	default 50
	help
	  According to the width of the display (hor. res. / dpi) the displays fall
	  in 4 categories. This limit is the threshold for medium displays.

config LVGL_DISP_LARGE_LIMIT
	int "Large display limit"
	default 70
	help
	  According to the width of the display (hor. res. / dpi) the displays fall
	  in 4 categories. This limit is the threshold for large displays.

endmenu
+29 −0
Original line number Diff line number Diff line
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
# Copyright (c) 2020 Teslabs Engineering S.L.
# SPDX-License-Identifier: Apache-2.0

menu "Image decoder and cache"

config LVGL_IMG_CF_INDEXED
	bool "Enable indexed image support"
	default y
	help
	  Enable support for indexed images

config LVGL_IMG_CF_ALPHA
	bool "Enable alpha indexed image support"
	default y
	help
	  Enable support for alpha indexed images

config LVGL_IMG_CACHE_DEF_SIZE
	int "Default image cache size"
	default 1
	help
	  Default image cache size, image caching keeps the images open.
	  If only the built-in image formats are used there is no real
	  advantage of caching. With complex image decoders (e.g. PNG or JPG)
	  caching can save the continuous decoding of images. However the
	  opened images might consume additional RAM.

endmenu
Loading