gui: Add support for lvgl API version 6
Added support for lvgl API version 6 Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
This commit is contained in:
parent
9fae4b0310
commit
6bbd4cbaa3
19 changed files with 1068 additions and 907 deletions
|
@ -88,9 +88,6 @@ config LVGL_VDB_SIZE
|
|||
config LVGL_DPI
|
||||
default 128
|
||||
|
||||
config LVGL_BITS_PER_PIXEL
|
||||
default 0
|
||||
|
||||
choice LVGL_COLOR_DEPTH
|
||||
default LVGL_COLOR_DEPTH_16
|
||||
endchoice
|
||||
|
|
|
@ -63,9 +63,6 @@ config LVGL_VDB_SIZE
|
|||
config LVGL_DPI
|
||||
default 128
|
||||
|
||||
config LVGL_BITS_PER_PIXEL
|
||||
default 0
|
||||
|
||||
choice LVGL_COLOR_DEPTH
|
||||
default LVGL_COLOR_DEPTH_16
|
||||
endchoice
|
||||
|
|
|
@ -6,21 +6,11 @@ target_include_directories(lvgl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
|||
|
||||
zephyr_library()
|
||||
|
||||
zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_32
|
||||
lvgl_color_32.c
|
||||
)
|
||||
|
||||
zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_16
|
||||
lvgl_color_16.c
|
||||
)
|
||||
|
||||
zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_8
|
||||
lvgl_color_8.c
|
||||
)
|
||||
|
||||
zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_1
|
||||
lvgl_color_1.c
|
||||
)
|
||||
zephyr_library_sources(lvgl_display.c)
|
||||
zephyr_library_sources(lvgl_display_mono.c)
|
||||
zephyr_library_sources(lvgl_display_16bit.c)
|
||||
zephyr_library_sources(lvgl_display_24bit.c)
|
||||
zephyr_library_sources(lvgl_display_32bit.c)
|
||||
|
||||
zephyr_library_sources_ifdef( CONFIG_LVGL_FILESYSTEM
|
||||
lvgl_fs.c
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
@ -61,10 +61,11 @@ endchoice
|
|||
|
||||
config LVGL_BITS_PER_PIXEL
|
||||
int "Bits per pixel"
|
||||
default 0
|
||||
default 32
|
||||
range 1 32
|
||||
depends on LVGL_BUFFER_ALLOC_STATIC
|
||||
help
|
||||
Number of bits per pixel, in case the number of pixels should be derived
|
||||
from the color depth set the number of pixels to zero.
|
||||
Number of bits per pixel.
|
||||
|
||||
if LVGL_COLOR_DEPTH_16
|
||||
|
||||
|
@ -181,34 +182,42 @@ config LVGL_MEM_POOL_NUMBER_BLOCKS
|
|||
|
||||
endif
|
||||
|
||||
if !LVGL_TRUE_DOUBLE_BUFFERED
|
||||
config LVGL_VDB_SIZE
|
||||
int "Virtual Display Buffer Size"
|
||||
int "Rendering buffer size"
|
||||
default 10
|
||||
range 1 100
|
||||
help
|
||||
Virtual Display Buffer (double buffering) size as a percentage of
|
||||
total display size.
|
||||
endif
|
||||
|
||||
config LVGL_VDB_STATIC
|
||||
bool "Statically allocate virtual display buffer"
|
||||
default y
|
||||
help
|
||||
Statically allocate virtual display buffer. If disabled pointer should be
|
||||
passed via lv_vdb_set_adr().
|
||||
Size of the buffer used for rendering screen content as a percentage
|
||||
of total display size.
|
||||
|
||||
config LVGL_DOUBLE_VDB
|
||||
bool "Use 2 Virtual Display Buffers"
|
||||
bool "Use two rendering buffers"
|
||||
help
|
||||
Use 2 virtual display buffers to render and flush data in parallel
|
||||
Use two buffers to render and flush data in parallel
|
||||
|
||||
if LVGL_DOUBLE_VDB
|
||||
config LVGL_TRUE_DOUBLE_BUFFERED
|
||||
bool "True double buffered"
|
||||
choice
|
||||
prompt "Rendering Buffer Allocation"
|
||||
default LVGL_BUFFER_ALLOC_STATIC
|
||||
help
|
||||
Use true double buffering, VDB size will be set to 100%.
|
||||
endif
|
||||
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_SCREEN_REFRESH_PERIOD
|
||||
int "Screen refresh period"
|
||||
|
@ -222,12 +231,6 @@ config LVGL_INPUT_REFRESH_PERIOD
|
|||
help
|
||||
Refresh period for input devices in milliseconds
|
||||
|
||||
config LVGL_INPUT_MARK_PRESSED_POINTS
|
||||
bool "Mark pressed points"
|
||||
depends on LVGL_DIRECT_DRAW
|
||||
help
|
||||
Mark the pressed points on the screen.
|
||||
|
||||
config LVGL_INPUT_DRAG_THRESHOLD
|
||||
int "Drag Threshold"
|
||||
default 10
|
||||
|
@ -255,11 +258,17 @@ config LVGL_INPUT_LONG_RESS_REPEAT_TIME
|
|||
Period in milliseconds after which a new trigger is generated
|
||||
for a long press
|
||||
|
||||
config LVGL_UTF_8
|
||||
bool "Enable UTF-8 support"
|
||||
default y
|
||||
help
|
||||
Enable UTF-8 support
|
||||
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_TEXT_BREAK_CHARACTERS
|
||||
string "Text break characters"
|
||||
|
@ -267,26 +276,6 @@ config LVGL_TEXT_BREAK_CHARACTERS
|
|||
help
|
||||
Characters on which a text break can take place
|
||||
|
||||
config LVGL_TEXT_BREAK_LONG_WORD_SIZE
|
||||
int "Long word size for text break"
|
||||
default 12
|
||||
help
|
||||
Number of characters in a word before considering a word for a text break
|
||||
|
||||
config LVGL_TEXT_BREAK_LONG_WORD_PRE_MIN_LEN
|
||||
int "Minimum long word length before text break"
|
||||
default 3
|
||||
help
|
||||
Minimum number of characters of a long word that should be put before a
|
||||
break
|
||||
|
||||
config LVGL_TEXT_BREAK_LONG_WORD_POST_MIN_LEN
|
||||
int "Minimum long word length after text break"
|
||||
default 1
|
||||
help
|
||||
Minimum number of characters of a long word that should be placed after a
|
||||
break
|
||||
|
||||
config LVGL_ANTIALIAS
|
||||
bool "Enable anti-aliasing"
|
||||
default y
|
||||
|
@ -317,13 +306,17 @@ config LVGL_GPU
|
|||
help
|
||||
Enable GPU support
|
||||
|
||||
config LVGL_DIRECT_DRAW
|
||||
bool "Enable direct draw"
|
||||
config LVGL_IMG_CF_INDEXED
|
||||
bool "Enable indexed image support"
|
||||
default y
|
||||
help
|
||||
Enable direct draw support.
|
||||
Direct draw bypasses virtual display buffer and directly writes to
|
||||
frame buffer
|
||||
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_FILESYSTEM
|
||||
bool "Enable file system"
|
||||
|
@ -332,35 +325,18 @@ config LVGL_FILESYSTEM
|
|||
help
|
||||
Enable LittlevGL file system
|
||||
|
||||
config LVGL_MULTI_LANGUAGE
|
||||
bool "Multi language support"
|
||||
help
|
||||
Enable multi language support
|
||||
|
||||
if LVGL_MULTI_LANGUAGE
|
||||
config LVGL_NBR_OF_LANGUAGES
|
||||
int "Number of languages"
|
||||
config LVGL_IMG_CACHE_DEF_SIZE
|
||||
int "Default image cache size"
|
||||
default 1
|
||||
help
|
||||
Number of languages to support
|
||||
endif
|
||||
|
||||
config LVGL_VLA_SUPPORT
|
||||
bool "Enable variable length array support"
|
||||
default y
|
||||
help
|
||||
Enable variable length array support
|
||||
|
||||
config LVGL_COMPILER_NON_CONST_INIT_SUPPORTED
|
||||
bool "Enable non constant init"
|
||||
default y
|
||||
help
|
||||
Indicate if initialization with non constant values is supported
|
||||
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.
|
||||
|
||||
rsource "Kconfig.themes"
|
||||
|
||||
rsource "Kconfig.fonts"
|
||||
|
||||
rsource "Kconfig.objects"
|
||||
|
||||
config APP_LINK_WITH_LVGL
|
||||
|
|
|
@ -1,188 +1,66 @@
|
|||
#
|
||||
# Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
# Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
menu "Fonts"
|
||||
|
||||
config LVGL_BUILD_IN_FONTS
|
||||
bool "Enable build-in fonts"
|
||||
config LVGL_BUILD_IN_FONT_ROBOTO_12
|
||||
bool "Enable build-in 12px fonts"
|
||||
help
|
||||
Enable build-in font support, size 12 pixels
|
||||
|
||||
config LVGL_BUILD_IN_FONT_ROBOTO_16
|
||||
bool "Enable build-in 16px fonts"
|
||||
help
|
||||
Enable build-in font support, size 16 pixels
|
||||
|
||||
config LVGL_BUILD_IN_FONT_ROBOTO_22
|
||||
bool "Enable build-in 22px fonts"
|
||||
help
|
||||
Enable build-in font support, size 22 pixels
|
||||
|
||||
config LVGL_BUILD_IN_FONT_ROBOTO_28
|
||||
bool "Enable build-in 28px fonts"
|
||||
help
|
||||
Enable build-in font support, size 28 pixels
|
||||
|
||||
config LVGL_BUILD_IN_FONT_UNSCII_8
|
||||
bool "Enable build-in 8px monospace fonts"
|
||||
default y
|
||||
help
|
||||
Enable build-in font support
|
||||
|
||||
if LVGL_BUILD_IN_FONTS
|
||||
|
||||
config LVGL_BUILD_IN_FONT_10
|
||||
bool "Enable build-in 10px fonts"
|
||||
help
|
||||
Enable build-in font support, size 10 pixels
|
||||
|
||||
if LVGL_BUILD_IN_FONT_10
|
||||
|
||||
config LVGL_BUILD_IN_FONT_10_ASCII_BPP
|
||||
int "ASCII character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_10_LATIN_SUP_BPP
|
||||
int "Latin supplement character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_10_CYRILLIC_BPP
|
||||
int "Cyrillic character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_10_SYMBOL_BPP
|
||||
int "Symbol character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
endif
|
||||
|
||||
config LVGL_BUILD_IN_FONT_20
|
||||
bool "Enable build-in 20px fonts"
|
||||
default y
|
||||
help
|
||||
Enable build-in font support, size 20 pixels
|
||||
|
||||
if LVGL_BUILD_IN_FONT_20
|
||||
|
||||
config LVGL_BUILD_IN_FONT_20_ASCII_BPP
|
||||
int "ASCII character set BPP"
|
||||
default 4
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_20_LATIN_SUP_BPP
|
||||
int "Latin supplement character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_20_CYRILLIC_BPP
|
||||
int "Cyrillic character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_20_SYMBOL_BPP
|
||||
int "Symbol character set BPP"
|
||||
default 4
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
endif
|
||||
|
||||
config LVGL_BUILD_IN_FONT_30
|
||||
bool "Enable build-in 30px fonts"
|
||||
help
|
||||
Enable build-in font support, size 30 pixels
|
||||
|
||||
if LVGL_BUILD_IN_FONT_30
|
||||
|
||||
config LVGL_BUILD_IN_FONT_30_ASCII_BPP
|
||||
int "ASCII character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_30_LATIN_SUP_BPP
|
||||
int "Latin supplement character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_30_CYRILLIC_BPP
|
||||
int "Cyrillic character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_30_SYMBOL_BPP
|
||||
int "Symbol character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
endif
|
||||
|
||||
config LVGL_BUILD_IN_FONT_40
|
||||
bool "Enable build-in 40px fonts"
|
||||
help
|
||||
Enable build-in font support, size 40 pixels
|
||||
|
||||
if LVGL_BUILD_IN_FONT_40
|
||||
|
||||
config LVGL_BUILD_IN_FONT_40_ASCII_BPP
|
||||
int "ASCII character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_40_LATIN_SUP_BPP
|
||||
int "Latin supplement character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_40_CYRILLIC_BPP
|
||||
int "Cyrillic character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
config LVGL_BUILD_IN_FONT_40_SYMBOL_BPP
|
||||
int "Symbol character set BPP"
|
||||
default 0
|
||||
help
|
||||
Bits per pixel (1,2,4,8) for font, 0 will disable font
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
config LVGL_BUILD_IN_FONT_MONOSPACE
|
||||
bool "Enable build-in monospace font"
|
||||
help
|
||||
Enable build-in monospace font support
|
||||
Enable build-in monospace font support, size 8 pixels
|
||||
|
||||
choice
|
||||
prompt "Default LVGL font"
|
||||
default LVGL_DEFAULT_FONT_BUILD_IN_20_ASCII
|
||||
default LVGL_DEFAULT_FONT_BUILD_IN_UNSCII_8
|
||||
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_10_ASCII
|
||||
bool "Build-in ASCII font 10"
|
||||
depends on LVGL_BUILD_IN_FONT_10 && LVGL_BUILD_IN_FONT_10_ASCII_BPP != 0
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_12
|
||||
bool "Build-in font size 12"
|
||||
depends on LVGL_BUILD_IN_FONT_ROBOTO_12
|
||||
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_20_ASCII
|
||||
bool "Build-in ASCII font 20"
|
||||
depends on LVGL_BUILD_IN_FONT_20 && LVGL_BUILD_IN_FONT_20_ASCII_BPP != 0
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_16
|
||||
bool "Build-in font size 16"
|
||||
depends on LVGL_BUILD_IN_FONT_ROBOTO_16
|
||||
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_30_ASCII
|
||||
bool "Build-in ASCII font 30"
|
||||
depends on LVGL_BUILD_IN_FONT_30 && LVGL_BUILD_IN_FONT_30_ASCII_BPP != 0
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_22
|
||||
bool "Build-in font size 22"
|
||||
depends on LVGL_BUILD_IN_FONT_ROBOTO_22
|
||||
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_40_ASCII
|
||||
bool "Build-in ASCII font 40"
|
||||
depends on LVGL_BUILD_IN_FONT_40 && LVGL_BUILD_IN_FONT_40_ASCII_BPP != 0
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_28
|
||||
bool "Build-in font size 28"
|
||||
depends on LVGL_BUILD_IN_FONT_ROBOTO_28
|
||||
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_MONOSPACE
|
||||
config LVGL_DEFAULT_FONT_BUILD_IN_UNSCII_8
|
||||
bool "Build-in monospace font"
|
||||
depends on LVGL_BUILD_IN_FONT_MONOSPACE
|
||||
depends on LVGL_BUILD_IN_FONT_UNSCII_8
|
||||
|
||||
config LVGL_DEFAULT_FONT_CUSTOM
|
||||
bool "Custom font"
|
||||
help
|
||||
Use a none build-in font as default font. A pointer named lv_default_font_custom_ptr
|
||||
should exists as a global variable and pint yo a valid font structure
|
||||
should exists as a global variable and point to a valid font structure
|
||||
|
||||
endchoice
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
@ -12,6 +12,21 @@ config LVGL_OBJ_REALIGN
|
|||
help
|
||||
Enable object realign support
|
||||
|
||||
choice
|
||||
prompt "Extend objects clickable area"
|
||||
default LVGL_EXT_CLICK_AREA_OFF
|
||||
|
||||
config LVGL_EXT_CLICK_AREA_OFF
|
||||
bool "Disabled"
|
||||
|
||||
config LVGL_EXT_CLICK_AREA_TINY
|
||||
bool "Only horizontally and vertical"
|
||||
|
||||
config LVGL_EXT_CLICK_AREA_FULL
|
||||
bool "Full flexibility"
|
||||
|
||||
endchoice
|
||||
|
||||
config LVGL_OBJ_LABEL
|
||||
bool "Label Object"
|
||||
default y
|
||||
|
@ -26,7 +41,23 @@ config LVGL_OBJ_LABEL_SCROLL_SPEED
|
|||
help
|
||||
Scroll speed in pixels per second if scroll mode is enabled for a label
|
||||
|
||||
endif
|
||||
config LVGL_OBJ_LABEL_TEXT_SEL
|
||||
bool "Enable label text selection"
|
||||
help
|
||||
Enable label text selection
|
||||
|
||||
config LVGL_OBJ_LABEL_WAIT_CHAR_COUNT
|
||||
int "Waiting period for label animation"
|
||||
default 3
|
||||
help
|
||||
Waiting period at beginning/end of the label animation cycle
|
||||
|
||||
config LVGL_OBJ_LABEL_LONG_TXT_HINT
|
||||
bool "Enable long text hint for labels"
|
||||
help
|
||||
Enable support for long text hints
|
||||
|
||||
endif # LVGL_OBJ_LABEL
|
||||
|
||||
config LVGL_OBJ_IMAGE
|
||||
bool "Image Object"
|
||||
|
@ -35,22 +66,6 @@ config LVGL_OBJ_IMAGE
|
|||
help
|
||||
Enable image object support
|
||||
|
||||
if LVGL_OBJ_IMAGE
|
||||
|
||||
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
|
||||
|
||||
endif
|
||||
|
||||
config LVGL_OBJ_LINE
|
||||
bool "Line Object"
|
||||
default y
|
||||
|
@ -76,6 +91,14 @@ config LVGL_OBJ_PAGE
|
|||
help
|
||||
Enable page object support
|
||||
|
||||
if LVGL_OBJ_PAGE
|
||||
config LVGL_OBJ_PAGE_DEF_ANIM_TIME
|
||||
int "Default page focus animation time"
|
||||
default 400
|
||||
help
|
||||
Default page focus animation time in milliseconds
|
||||
endif
|
||||
|
||||
config LVGL_OBJ_WINDOW
|
||||
bool "Window object"
|
||||
default y
|
||||
|
@ -191,6 +214,14 @@ config LVGL_OBJ_CHART
|
|||
help
|
||||
Enable chart object support
|
||||
|
||||
if LVGL_OBJ_CHART
|
||||
config LVGL_OBJ_CHART_AXIS_TICK_LABEL_MAX_LEN
|
||||
int "Maximum length of axis label"
|
||||
default 20
|
||||
help
|
||||
Maximum length of axis label
|
||||
endif
|
||||
|
||||
config LVGL_OBJ_TABLE
|
||||
bool "Table object"
|
||||
default y
|
||||
|
@ -348,6 +379,12 @@ config LVGL_OBJ_ROLLER_ANIM_TIME
|
|||
help
|
||||
Roller animation time in milliseconds
|
||||
|
||||
config LVGL_OBJ_ROLLER_INF_PAGES
|
||||
int "Number of pages for infinite roller"
|
||||
default 7
|
||||
help
|
||||
Number of extra pages in case the roller is infinite
|
||||
|
||||
endif
|
||||
|
||||
config LVGL_OBJ_SLIDER
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
* Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -7,99 +7,10 @@
|
|||
#ifndef ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_
|
||||
#define ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_
|
||||
|
||||
/* Dynamic memory */
|
||||
/* Graphical settings */
|
||||
|
||||
#define LV_MEM_CUSTOM 1
|
||||
|
||||
#ifdef CONFIG_LVGL_MEM_POOL_HEAP_KERNEL
|
||||
|
||||
#define LV_MEM_CUSTOM_INCLUDE "kernel.h"
|
||||
#define LV_MEM_CUSTOM_ALLOC k_malloc
|
||||
#define LV_MEM_CUSTOM_FREE k_free
|
||||
|
||||
#define LV_ENABLE_GC 0
|
||||
|
||||
#elif defined(CONFIG_LVGL_MEM_POOL_HEAP_LIB_C)
|
||||
|
||||
#define LV_MEM_CUSTOM_INCLUDE "stdlib.h"
|
||||
#define LV_MEM_CUSTOM_ALLOC malloc
|
||||
#define LV_MEM_CUSTOM_FREE free
|
||||
|
||||
#ifdef CONFIG_NEWLIB_LIBC
|
||||
|
||||
#define LV_ENABLE_GC 1
|
||||
#define LV_MEM_CUSTOM_REALLOC realloc
|
||||
#define LV_MEM_CUSTOM_GET_SIZE malloc_size
|
||||
#define LV_GC_INCLUDE "stdlib.h"
|
||||
|
||||
#else
|
||||
|
||||
#define LV_ENABLE_GC 0
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define LV_MEM_CUSTOM_INCLUDE "lvgl_mem.h"
|
||||
#define LV_MEM_CUSTOM_ALLOC lvgl_malloc
|
||||
#define LV_MEM_CUSTOM_FREE lvgl_free
|
||||
|
||||
#define LV_ENABLE_GC 0
|
||||
|
||||
#endif
|
||||
|
||||
/* Graphics settings */
|
||||
|
||||
#define LV_HOR_RES CONFIG_LVGL_HOR_RES
|
||||
#define LV_VER_RES CONFIG_LVGL_VER_RES
|
||||
#define LV_DPI CONFIG_LVGL_DPI
|
||||
|
||||
#ifdef CONFIG_LVGL_ANTIALIAS
|
||||
#define LV_ANTIALIAS CONFIG_LVGL_ANTIALIAS
|
||||
#else
|
||||
#define LV_ANTIALIAS 0
|
||||
#endif
|
||||
|
||||
#define LV_REFR_PERIOD CONFIG_LVGL_SCREEN_REFRESH_PERIOD
|
||||
|
||||
/* VDB settings */
|
||||
|
||||
#ifdef CONFIG_LVGL_TRUE_DOUBLE_BUFFERED
|
||||
#define LV_VDB_SIZE (CONFIG_LVGL_VDB_SIZE * CONFIG_LVGL_HOR_RES)
|
||||
#else
|
||||
#define LV_VDB_SIZE (CONFIG_LVGL_VDB_SIZE * CONFIG_LVGL_HOR_RES \
|
||||
* CONFIG_LVGL_VER_RES / 100)
|
||||
#endif
|
||||
|
||||
#if CONFIG_LVGL_BITS_PER_PIXEL == 0
|
||||
#define LV_VDB_PX_BPP LV_COLOR_SIZE
|
||||
#else
|
||||
#define LV_VDB_PX_BPP CONFIG_LVGL_BITS_PER_PIXEL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_VDB_STATIC
|
||||
#define LV_VDB_ADR 0
|
||||
#else
|
||||
#define LV_VDB_ADR LV_VDB_ADR_INV
|
||||
#endif
|
||||
|
||||
#define LV_VDB_DOUBLE CONFIG_LVGL_DOUBLE_VDB
|
||||
#ifdef CONFIG_LVGL_VDB_STATIC
|
||||
#define LV_VDB2_ADR 0
|
||||
#else
|
||||
#define LV_VDB2_ADR LV_VDB_ADR_INV
|
||||
#endif
|
||||
|
||||
#define LV_VDB_TRUE_DOUBLE_BUFFERED CONFIG_LVGL_TRUE_DOUBLE_BUFFERED
|
||||
|
||||
/* Miscellaneous setting */
|
||||
|
||||
#define LV_INDEV_READ_PERIOD CONFIG_LVGL_INPUT_REFRESH_PERIOD
|
||||
#define LV_INDEV_POINT_MARKER CONFIG_LVGL_INPUT_MARK_PRESSED_POINTS
|
||||
#define LV_INDEV_DRAG_LIMIT CONFIG_LVGL_INPUT_DRAG_THRESHOLD
|
||||
#define LV_INDEV_DRAG_THROW CONFIG_LVGL_INPUT_DRAG_THROW_SLOW_DOWN
|
||||
#define LV_INDEV_LONG_PRESS_TIME CONFIG_LVGL_INPUT_LONG_PRESS_TIME
|
||||
#define LV_INDEV_LONG_PRESS_REP_TIME CONFIG_LVGL_INPUT_LONG_RESS_REPEAT_TIME
|
||||
#define LV_HOR_RES_MAX CONFIG_LVGL_HOR_RES
|
||||
#define LV_VER_RES_MAX CONFIG_LVGL_VER_RES
|
||||
|
||||
#ifdef CONFIG_LVGL_COLOR_DEPTH_32
|
||||
#define LV_COLOR_DEPTH 32
|
||||
|
@ -109,12 +20,19 @@
|
|||
#define LV_COLOR_DEPTH 8
|
||||
#elif defined(CONFIG_LVGL_COLOR_DEPTH_1)
|
||||
#define LV_COLOR_DEPTH 1
|
||||
#else
|
||||
#error No color depth defined
|
||||
#endif
|
||||
|
||||
#define LV_COLOR_16_SWAP CONFIG_LVGL_COLOR_16_SWAP
|
||||
#define LV_COLOR_SCREEN_TRANSP CONFIG_LVGL_COLOR_SCREEN_TRANSP
|
||||
#ifdef CONFIG_LVGL_COLOR_16_SWAP
|
||||
#define LV_COLOR_16_SWAP 1
|
||||
#else
|
||||
#define LV_COLOR_16_SWAP 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_COLOR_SCREEN_TRANSP
|
||||
#define LV_COLOR_SCREEN_TRANSP 1
|
||||
#else
|
||||
#define LV_COLOR_SCREEN_TRANSP 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_CHROMA_KEY_RED
|
||||
#define LV_COLOR_TRANSP LV_COLOR_RED
|
||||
|
@ -126,45 +44,148 @@
|
|||
#define LV_COLOR_TRANSP LV_COLOR_MAKE(CONFIG_LVGL_CUSTOM_CHROMA_KEY_RED, \
|
||||
CONFIG_LVGL_CUSTOM_CHROMA_KEY_GREEN, \
|
||||
CONFIG_LVGL_CUSTOM_CHROMA_KEY_BLUE)
|
||||
#else
|
||||
#error No chroma key defined
|
||||
#endif
|
||||
|
||||
#define LV_TXT_UTF8 CONFIG_LVGL_UTF_8
|
||||
#define LV_TXT_BREAK_CHARS CONFIG_LVGL_TEXT_BREAK_CHARACTERS
|
||||
#define LV_TXT_LINE_BREAK_LONG_LEN CONFIG_LVGL_TEXT_BREAK_LONG_WORD_SIZE
|
||||
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN \
|
||||
CONFIG_LVGL_TEXT_BREAK_LONG_WORD_PRE_MIN_LEN
|
||||
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN \
|
||||
CONFIG_LVGL_TEXT_BREAK_LONG_WORD_POST_MIN_LEN
|
||||
|
||||
#define USE_LV_ANIMATION CONFIG_LVGL_ANIMATION
|
||||
#define USE_LV_SHADOW CONFIG_LVGL_SHADOW
|
||||
#define USE_LV_GROUP CONFIG_LVGL_GROUP
|
||||
#define USE_LV_GPU CONFIG_LVGL_GPU
|
||||
#define USE_LV_REAL_DRAW CONFIG_LVGL_DIRECT_DRAW
|
||||
#define USE_LV_FILESYSTEM CONFIG_LVGL_FILESYSTEM
|
||||
|
||||
#ifdef LVGL_MULTI_LANGUAGE
|
||||
#define USE_LV_MULTI_LANG CONFIG_LVGL_NBR_OF_LANGUAGES
|
||||
#ifdef CONFIG_LVGL_ANTIALIAS
|
||||
#define LV_ANTIALIAS 1
|
||||
#else
|
||||
#define USE_LV_MULTI_LANG 0
|
||||
#define LV_ANTIALIAS 0
|
||||
#endif
|
||||
|
||||
#define LV_DISP_DEF_REFR_PERIOD CONFIG_LVGL_SCREEN_REFRESH_PERIOD
|
||||
|
||||
#define LV_DPI CONFIG_LVGL_DPI
|
||||
|
||||
typedef short lv_coord_t;
|
||||
|
||||
/* Memory manager settings */
|
||||
|
||||
#define LV_MEM_CUSTOM 1
|
||||
|
||||
#ifdef CONFIG_LVGL_MEM_POOL_HEAP_KERNEL
|
||||
|
||||
#define LV_MEM_CUSTOM_INCLUDE "kernel.h"
|
||||
#define LV_MEM_CUSTOM_ALLOC k_malloc
|
||||
#define LV_MEM_CUSTOM_FREE k_free
|
||||
|
||||
#elif defined(CONFIG_LVGL_MEM_POOL_HEAP_LIB_C)
|
||||
|
||||
#define LV_MEM_CUSTOM_INCLUDE "stdlib.h"
|
||||
#define LV_MEM_CUSTOM_ALLOC malloc
|
||||
#define LV_MEM_CUSTOM_FREE free
|
||||
|
||||
#else
|
||||
|
||||
#define LV_MEM_CUSTOM_INCLUDE "lvgl_mem.h"
|
||||
#define LV_MEM_CUSTOM_ALLOC lvgl_malloc
|
||||
#define LV_MEM_CUSTOM_FREE lvgl_free
|
||||
|
||||
#endif
|
||||
|
||||
#define LV_ENABLE_GC 0
|
||||
|
||||
/* Input device settings */
|
||||
|
||||
#define LV_INDEV_DEF_READ_PERIOD CONFIG_LVGL_INPUT_REFRESH_PERIOD
|
||||
|
||||
#define LV_INDEV_DEF_DRAG_LIMIT CONFIG_LVGL_INPUT_DRAG_THRESHOLD
|
||||
|
||||
#define LV_INDEV_DEF_DRAG_THROW CONFIG_LVGL_INPUT_DRAG_THROW_SLOW_DOWN
|
||||
|
||||
#define LV_INDEV_DEF_LONG_PRESS_TIME CONFIG_LVGL_INPUT_LONG_PRESS_TIME
|
||||
|
||||
#define LV_INDEV_DEF_LONG_PRESS_REP_TIME \
|
||||
CONFIG_LVGL_INPUT_LONG_RESS_REPEAT_TIME
|
||||
|
||||
/* Feature usage */
|
||||
|
||||
#ifdef CONFIG_LVGL_ANIMATION
|
||||
#define LV_USE_ANIMATION 1
|
||||
#else
|
||||
#define LV_USE_ANIMATION 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
typedef void *lv_anim_user_data_t;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_SHADOW
|
||||
#define LV_USE_SHADOW 1
|
||||
#else
|
||||
#define LV_USE_SHADOW 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_GROUP
|
||||
#define LV_USE_GROUP 1
|
||||
#else
|
||||
#define LV_USE_GROUP 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_GROUP
|
||||
typedef void *lv_group_user_data_t;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_GPU
|
||||
#define LV_USE_GPU 1
|
||||
#else
|
||||
#define LV_USE_GPU 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_FILESYSTEM
|
||||
#define LV_USE_FILESYSTEM 1
|
||||
#else
|
||||
#define LV_USE_FILESYSTEM 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_FILESYSTEM
|
||||
typedef void *lv_fs_drv_user_data_t;
|
||||
#endif
|
||||
|
||||
#define LV_USE_USER_DATA 1
|
||||
|
||||
/* Image decoder and cache */
|
||||
|
||||
#ifdef CONFIG_LVGL_IMG_CF_INDEXED
|
||||
#define LV_IMG_CF_INDEXED 1
|
||||
#else
|
||||
#define LV_IMG_CF_INDEXED 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_IMG_CF_ALPHA
|
||||
#define LV_IMG_CF_ALPHA 1
|
||||
#else
|
||||
#define LV_IMG_CF_ALPHA 0
|
||||
#endif
|
||||
|
||||
#define LV_IMG_CACHE_DEF_SIZE CONFIG_LVGL_IMG_CACHE_DEF_SIZE
|
||||
|
||||
typedef void *lv_img_decoder_user_data_t;
|
||||
|
||||
/* Compiler settings */
|
||||
|
||||
#define LV_ATTRIBUTE_TICK_INC
|
||||
|
||||
#define LV_ATTRIBUTE_TASK_HANDLER
|
||||
#define LV_COMPILER_VLA_SUPPORTED CONFIG_LVGL_VLA_SUPPORT
|
||||
#define LV_COMPILER_NON_CONST_INIT_SUPPORTED \
|
||||
CONFIG_LVGL_COMPILER_NON_CONST_INIT_SUPPORTED
|
||||
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
|
||||
#define LV_ATTRIBUTE_LARGE_CONST
|
||||
|
||||
/* HAL settings */
|
||||
|
||||
#define LV_TICK_CUSTOM 1
|
||||
#define LV_TICK_CUSTOM_INCLUDE "kernel.h"
|
||||
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (k_uptime_get_32())
|
||||
|
||||
typedef void *lv_disp_drv_user_data_t;
|
||||
typedef void *lv_indev_drv_user_data_t;
|
||||
|
||||
/* Log settings */
|
||||
|
||||
#if CONFIG_LVGL_LOG_LEVEL == 0
|
||||
#define USE_LV_LOG 0
|
||||
#define LV_USE_LOG 0
|
||||
#else
|
||||
#define USE_LV_LOG 1
|
||||
#define LV_USE_LOG 1
|
||||
|
||||
#if CONFIG_LVGL_LOG_LEVEL == 1
|
||||
#define LV_LOG_LEVEL LV_LOG_LEVEL_ERROR
|
||||
|
@ -174,259 +195,429 @@
|
|||
#define LV_LOG_LEVEL LV_LOG_LEVEL_INFO
|
||||
#elif CONFIG_LVGL_LOG_LEVEL == 4
|
||||
#define LV_LOG_LEVEL LV_LOG_LEVEL_TRACE
|
||||
#else
|
||||
#error Invalid log level defined
|
||||
#endif
|
||||
|
||||
#define LV_LOG_PRINTF 0
|
||||
#define LV_LOG_PRINTF 0
|
||||
#endif
|
||||
|
||||
/* Theme support */
|
||||
/* THEME USAGE */
|
||||
|
||||
#ifdef CONFIG_LVGL_THEMES
|
||||
|
||||
#define LV_THEME_LIVE_UPDATE CONFIG_LVGL_THEME_LIVE_UPDATE
|
||||
|
||||
#define USE_LV_THEME_TEMPL 0
|
||||
#define USE_LV_THEME_DEFAULT CONFIG_LVGL_THEME_DEFAULT
|
||||
#define USE_LV_THEME_ALIEN CONFIG_LVGL_THEME_ALIEN
|
||||
#define USE_LV_THEME_NIGHT CONFIG_LVGL_THEME_NIGHT
|
||||
#define USE_LV_THEME_MONO CONFIG_LVGL_THEME_MONO
|
||||
#define USE_LV_THEME_MATERIAL CONFIG_LVGL_THEME_MATERIAL
|
||||
#define USE_LV_THEME_ZEN CONFIG_LVGL_THEME_ZEN
|
||||
#define USE_LV_THEME_NEMO CONFIG_LVGL_THEME_NEMO
|
||||
#define LV_USE_THEME_TEMPL 0
|
||||
|
||||
#ifdef CONFIG_LVGL_THEME_DEFAULT
|
||||
#define LV_USE_THEME_DEFAULT 1
|
||||
#else
|
||||
#define LV_USE_THEME_DEFAULT 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_THEME_ALIEN
|
||||
#define LV_USE_THEME_ALIEN 1
|
||||
#else
|
||||
#define LV_USE_THEME_ALIEN 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_THEME_NIGHT
|
||||
#define LV_USE_THEME_NIGHT 1
|
||||
#else
|
||||
#define LV_USE_THEME_NIGHT 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_THEME_MONO
|
||||
#define LV_USE_THEME_MONO 1
|
||||
#else
|
||||
#define LV_USE_THEME_MONO 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_THEME_MATERIAL
|
||||
#define LV_USE_THEME_MATERIAL 1
|
||||
#else
|
||||
#define LV_USE_THEME_MATERIAL 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_THEME_ZEN
|
||||
#define LV_USE_THEME_ZEN 1
|
||||
#else
|
||||
#define LV_USE_THEME_ZEN 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_THEME_NEMO
|
||||
#define LV_USE_THEME_NEMO 1
|
||||
#else
|
||||
#define LV_USE_THEME_NEMO 0
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define LV_THEME_LIVE_UPDATE 0
|
||||
#define LV_THEME_LIVE_UPDATE 0
|
||||
|
||||
#define USE_LV_THEME_TEMPL 0
|
||||
#define USE_LV_THEME_DEFAULT 0
|
||||
#define USE_LV_THEME_ALIEN 0
|
||||
#define USE_LV_THEME_NIGHT 0
|
||||
#define USE_LV_THEME_MONO 0
|
||||
#define USE_LV_THEME_MATERIAL 0
|
||||
#define USE_LV_THEME_ZEN 0
|
||||
#define USE_LV_THEME_NEMO 0
|
||||
#define LV_USE_THEME_TEMPL 0
|
||||
#define LV_USE_THEME_DEFAULT 0
|
||||
#define LV_USE_THEME_ALIEN 0
|
||||
#define LV_USE_THEME_NIGHT 0
|
||||
#define LV_USE_THEME_MONO 0
|
||||
#define LV_USE_THEME_MATERIAL 0
|
||||
#define LV_USE_THEME_ZEN 0
|
||||
#define LV_USE_THEME_NEMO 0
|
||||
|
||||
#endif
|
||||
|
||||
/* Font support */
|
||||
/* FONT USAGE */
|
||||
|
||||
#ifdef CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_10_ASCII
|
||||
#define LV_FONT_DEFAULT (&lv_font_dejavu_10)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_20_ASCII)
|
||||
#define LV_FONT_DEFAULT (&lv_font_dejavu_20)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_30_ASCII)
|
||||
#define LV_FONT_DEFAULT (&lv_font_dejavu_30)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_40_ASCII)
|
||||
#define LV_FONT_DEFAULT (&lv_font_dejavu_40)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_MONOSPACE)
|
||||
#define LV_FONT_DEFAULT (&lv_font_monospace_8)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_CUSTOM)
|
||||
extern void *lv_default_font_custom_ptr;
|
||||
#define LV_FONT_DEFAULT ((lv_font_t *) lv_default_font_custom_ptr)
|
||||
#ifdef CONFIG_LVGL_BUILD_IN_FONT_ROBOTO_12
|
||||
#define LV_FONT_ROBOTO_12 1
|
||||
#else
|
||||
#error No defulat font defined
|
||||
#define LV_FONT_ROBOTO_12 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_BUILD_IN_FONT_10
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_10 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_10_ASCII_BPP
|
||||
#define USE_LV_FONT_DEJAVU_10_LATIN_SUP \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_10_LATIN_SUP_BPP
|
||||
#define USE_LV_FONT_DEJAVU_10_CYRILLIC \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_10_CYRILLIC_BPP
|
||||
#define USE_LV_FONT_SYMBOL_10 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_10_SYMBOL_BPP
|
||||
|
||||
#ifdef CONFIG_LVGL_BUILD_IN_FONT_ROBOTO_16
|
||||
#define LV_FONT_ROBOTO_16 1
|
||||
#else
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_10 0
|
||||
#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_10_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_10 0
|
||||
|
||||
#define LV_FONT_ROBOTO_16 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_LVGL_BUILD_IN_FONT_20
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_20 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_20_ASCII_BPP
|
||||
#define USE_LV_FONT_DEJAVU_20_LATIN_SUP \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_20_LATIN_SUP_BPP
|
||||
#define USE_LV_FONT_DEJAVU_20_CYRILLIC \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_20_CYRILLIC_BPP
|
||||
#define USE_LV_FONT_SYMBOL_20 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_20_SYMBOL_BPP
|
||||
|
||||
#ifdef CONFIG_LVGL_BUILD_IN_FONT_ROBOTO_22
|
||||
#define LV_FONT_ROBOTO_22 1
|
||||
#else
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_20 0
|
||||
#define USE_LV_FONT_DEJAVU_20_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_20_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_20 0
|
||||
|
||||
#define LV_FONT_ROBOTO_22 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_LVGL_BUILD_IN_FONT_30
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_30 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_30_ASCII_BPP
|
||||
#define USE_LV_FONT_DEJAVU_30_LATIN_SUP \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_30_LATIN_SUP_BPP
|
||||
#define USE_LV_FONT_DEJAVU_30_CYRILLIC \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_30_CYRILLIC_BPP
|
||||
#define USE_LV_FONT_SYMBOL_30 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_30_SYMBOL_BPP
|
||||
|
||||
#ifdef CONFIG_LVGL_BUILD_IN_FONT_ROBOTO_28
|
||||
#define LV_FONT_ROBOTO_28 1
|
||||
#else
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_30 0
|
||||
#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_30_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_30 0
|
||||
|
||||
#define LV_FONT_ROBOTO_28 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_LVGL_BUILD_IN_FONT_40
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_40 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_40_ASCII_BPP
|
||||
#define USE_LV_FONT_DEJAVU_40_LATIN_SUP \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_40_LATIN_SUP_BPP
|
||||
#define USE_LV_FONT_DEJAVU_40_CYRILLIC \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_40_CYRILLIC_BPP
|
||||
#define USE_LV_FONT_SYMBOL_40 \
|
||||
CONFIG_LVGL_BUILD_IN_FONT_40_SYMBOL_BPP
|
||||
|
||||
#ifdef CONFIG_LVGL_BUILD_IN_FONT_UNSCII_8
|
||||
#define LV_FONT_UNSCII_8 1
|
||||
#else
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_40 0
|
||||
#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_40_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_40 0
|
||||
|
||||
#define LV_FONT_UNSCII_8 0
|
||||
#endif
|
||||
|
||||
#define USE_LV_FONT_MONOSPACE_8 CONFIG_LVGL_BUILD_IN_FONT_MONOSPACE
|
||||
|
||||
#define LV_FONT_CUSTOM_DECLARE
|
||||
|
||||
/* Objects */
|
||||
#define LV_OBJ_FREE_NUM_TYPE uint32_t
|
||||
#define LV_OBJ_FREE_PTR 1
|
||||
#define LV_OBJ_REALIGN CONFIG_LVGL_OBJ_REALIGN
|
||||
|
||||
#define USE_LV_LABEL CONFIG_LVGL_OBJ_LABEL
|
||||
#if USE_LV_LABEL != 0
|
||||
#define LV_LABEL_SCROLL_SPEED CONFIG_LVGL_OBJ_LABEL_SCROLL_SPEED
|
||||
#ifdef CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_12
|
||||
#define LV_FONT_DEFAULT (&lv_font_roboto_12)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_16)
|
||||
#define LV_FONT_DEFAULT (&lv_font_roboto_16)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_22)
|
||||
#define LV_FONT_DEFAULT (&lv_font_roboto_22)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_ROBOTO_28)
|
||||
#define LV_FONT_DEFAULT (&lv_font_roboto_28)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_BUILD_IN_UNSCII_8)
|
||||
#define LV_FONT_DEFAULT (&lv_font_unscii_8)
|
||||
#elif defined(CONFIG_LVGL_DEFAULT_FONT_CUSTOM)
|
||||
extern void *lv_default_font_custom_ptr;
|
||||
#define LV_FONT_DEFAULT ((lv_font_t *) lv_default_font_custom_ptr)
|
||||
#endif
|
||||
|
||||
#define USE_LV_IMG CONFIG_LVGL_OBJ_IMAGE
|
||||
#if USE_LV_IMG != 0
|
||||
#define LV_IMG_CF_INDEXED CONFIG_LVGL_IMG_CF_INDEXED
|
||||
#define LV_IMG_CF_ALPHA CONFIG_LVGL_IMG_CF_ALPHA
|
||||
typedef void *lv_font_user_data_t;
|
||||
|
||||
/* Text settings */
|
||||
|
||||
#ifdef CONFIG_LVGL_TXT_ENC_ASCII
|
||||
#define LV_TXT_ENC LV_TXT_ENC_ASCII
|
||||
#elif defined(CONFIG_LVGL_TXT_ENC_UTF8)
|
||||
#define LV_TXT_ENC LV_TXT_ENC_UTF8
|
||||
#endif
|
||||
|
||||
#define USE_LV_LINE CONFIG_LVGL_OBJ_LINE
|
||||
#define LV_TXT_BREAK_CHARS CONFIG_LVGL_TEXT_BREAK_CHARACTERS
|
||||
|
||||
#define USE_LV_ARC CONFIG_LVGL_OBJ_ARC
|
||||
/* LV_OBJ SETTINGS */
|
||||
|
||||
#define USE_LV_CONT CONFIG_LVGL_OBJ_CONTAINER
|
||||
typedef void *lv_obj_user_data_t;
|
||||
|
||||
#define USE_LV_PAGE CONFIG_LVGL_OBJ_PAGE
|
||||
|
||||
#define USE_LV_WIN CONFIG_LVGL_OBJ_WINDOW
|
||||
|
||||
#define USE_LV_TABVIEW CONFIG_LVGL_OBJ_TAB_VIEW
|
||||
#if USE_LV_TABVIEW != 0
|
||||
#define LV_TABVIEW_ANIM_TIME CONFIG_LVGL_OBJ_TAB_VIEW_ANIMATION_TIME
|
||||
#ifdef CONFIG_LVGL_OBJ_REALIGN
|
||||
#define LV_USE_OBJ_REALIGN 1
|
||||
#else
|
||||
#define LV_USE_OBJ_REALIGN 0
|
||||
#endif
|
||||
|
||||
#define USE_LV_TILEVIEW CONFIG_LVGL_OBJ_TILE_VIEW
|
||||
#if USE_LV_TILEVIEW != 0
|
||||
#define LV_TILEVIEW_ANIM_TIME CONFIG_LVGL_OBJ_TILE_VIEW_ANIMATION_TIME
|
||||
#if defined(CONFIG_LVGL_EXT_CLICK_AREA_OFF)
|
||||
#define LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF
|
||||
#elif defined(CONFIG_LVGL_EXT_CLICK_AREA_TINY)
|
||||
#define LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_TINY
|
||||
#elif defined(CONFIG_LVGL_EXT_CLICK_AREA_FULL)
|
||||
#define LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_FULL
|
||||
#endif
|
||||
|
||||
#define USE_LV_CALENDAR CONFIG_LVGL_OBJ_CALENDAR
|
||||
/* LV OBJ X USAGE */
|
||||
|
||||
#define USE_LV_PRELOAD CONFIG_LVGL_OBJ_PRELOAD
|
||||
#if USE_LV_PRELOAD != 0
|
||||
#define LV_PRELOAD_DEF_ARC_LENGTH CONFIG_LVGL_OBJ_PRELOAD_DEF_ARC_LENGTH
|
||||
#define LV_PRELOAD_DEF_SPIN_TIME CONFIG_LVGL_OBJ_PRELOAD_DEF_SPIN_TIME
|
||||
#ifdef CONFIG_LVGL_OBJ_ARC
|
||||
#define LV_USE_ARC 1
|
||||
#else
|
||||
#define LV_USE_ARC 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_BAR
|
||||
#define LV_USE_BAR 1
|
||||
#else
|
||||
#define LV_USE_BAR 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_BUTTON
|
||||
#define LV_USE_BTN 1
|
||||
#else
|
||||
#define LV_USE_BTN 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_BTN != 0
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_BUTTON_INK_EFFECT
|
||||
#define LV_BTN_INK_EFFECT 1
|
||||
#else
|
||||
#define LV_BTN_INK_EFFECT 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_BUTTON_MATRIX
|
||||
#define LV_USE_BTNM 1
|
||||
#else
|
||||
#define LV_USE_BTNM 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_CALENDAR
|
||||
#define LV_USE_CALENDAR 1
|
||||
#else
|
||||
#define LV_USE_CALENDAR 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_CANVAS
|
||||
#define LV_USE_CANVAS 1
|
||||
#else
|
||||
#define LV_USE_CANVAS 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_CHECK_BOX
|
||||
#define LV_USE_CB 1
|
||||
#else
|
||||
#define LV_USE_CB 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_CHART
|
||||
#define LV_USE_CHART 1
|
||||
#else
|
||||
#define LV_USE_CHART 0
|
||||
#endif
|
||||
#if LV_USE_CHART
|
||||
#define LV_CHART_AXIS_TICK_LABEL_MAX_LEN \
|
||||
CONFIG_LVGL_OBJ_CHART_AXIS_TICK_LABEL_MAX_LEN
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_CONTAINER
|
||||
#define LV_USE_CONT 1
|
||||
#else
|
||||
#define LV_USE_CONT 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_DROP_DOWN_LIST
|
||||
#define LV_USE_DDLIST 1
|
||||
#else
|
||||
#define LV_USE_DDLIST 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_DDLIST != 0
|
||||
#define LV_DDLIST_DEF_ANIM_TIME CONFIG_LVGL_OBJ_DROP_DOWN_LIST_ANIM_TIME
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_GAUGE
|
||||
#define LV_USE_GAUGE 1
|
||||
#else
|
||||
#define LV_USE_GAUGE 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_IMAGE
|
||||
#define LV_USE_IMG 1
|
||||
#else
|
||||
#define LV_USE_IMG 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_IMG_BUTTON
|
||||
#define LV_USE_IMGBTN 1
|
||||
#else
|
||||
#define LV_USE_IMGBTN 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_IMGBTN
|
||||
#ifdef CONFIG_LVGL_OBJ_IMG_BUTTON_TILED
|
||||
#define LV_IMGBTN_TILED 1
|
||||
#else
|
||||
#define LV_IMGBTN_TILED 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_KEYBOARD
|
||||
#define LV_USE_KB 1
|
||||
#else
|
||||
#define LV_USE_KB 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_LABEL
|
||||
#define LV_USE_LABEL 1
|
||||
#else
|
||||
#define LV_USE_LABEL 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_LABEL != 0
|
||||
#define LV_LABEL_DEF_SCROLL_SPEED CONFIG_LVGL_OBJ_LABEL_SCROLL_SPEED
|
||||
#define LV_LABEL_WAIT_CHAR_COUNT \
|
||||
CONFIG_LVGL_OBJ_LABEL_WAIT_CHAR_COUNT
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_LABEL_TEXT_SEL
|
||||
#define LV_LABEL_TEXT_SEL 1
|
||||
#else
|
||||
#define LV_LABEL_TEXT_SEL 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_LABEL_LONG_TXT_HINT
|
||||
#define LV_LABEL_LONG_TXT_HINT 1
|
||||
#else
|
||||
#define LV_LABEL_LONG_TXT_HINT 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_LED
|
||||
#define LV_USE_LED 1
|
||||
#else
|
||||
#define LV_USE_LED 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_LINE
|
||||
#define LV_USE_LINE 1
|
||||
#else
|
||||
#define LV_USE_LINE 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_LIST
|
||||
#define LV_USE_LIST 1
|
||||
#else
|
||||
#define LV_USE_LIST 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_LIST != 0
|
||||
#define LV_LIST_DEF_ANIM_TIME CONFIG_LVGL_OBJ_LIST_FOCUS_TIME
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_LINE_METER
|
||||
#define LV_USE_LMETER 1
|
||||
#else
|
||||
#define LV_USE_LMETER 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_MSG_BOX
|
||||
#define LV_USE_MBOX 1
|
||||
#else
|
||||
#define LV_USE_MBOX 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_PAGE
|
||||
#define LV_USE_PAGE 1
|
||||
#else
|
||||
#define LV_USE_PAGE 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_PAGE != 0
|
||||
#define LV_PAGE_DEF_ANIM_TIME CONFIG_LVGL_OBJ_PAGE_DEF_ANIM_TIME
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_PRELOAD
|
||||
#define LV_USE_PRELOAD 1
|
||||
#else
|
||||
#define LV_USE_PRELOAD 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_PRELOAD != 0
|
||||
#define LV_PRELOAD_DEF_ARC_LENGTH CONFIG_LVGL_OBJ_PRELOAD_DEF_ARC_LENGTH
|
||||
#define LV_PRELOAD_DEF_SPIN_TIME CONFIG_LVGL_OBJ_PRELOAD_DEF_SPIN_TIME
|
||||
#ifdef LVGL_OBJ_PRELOAD_DEF_ANIMATION_SPIN_ARC
|
||||
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
|
||||
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
|
||||
#endif
|
||||
#ifdef LVGL_OBJ_PRELOAD_DEF_ANIMATION_FILL
|
||||
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_FILLSPIN_ARC
|
||||
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_FILLSPIN_ARC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define USE_LV_CANVAS CONFIG_LVGL_OBJ_CANVAS
|
||||
|
||||
#define USE_LV_BAR CONFIG_LVGL_OBJ_BAR
|
||||
|
||||
#define USE_LV_LMETER CONFIG_LVGL_OBJ_LINE_METER
|
||||
|
||||
#define USE_LV_GAUGE CONFIG_LVGL_OBJ_GAUGE
|
||||
|
||||
#define USE_LV_CHART CONFIG_LVGL_OBJ_CHART
|
||||
|
||||
#define USE_LV_TABLE CONFIG_LVGL_OBJ_TABLE
|
||||
#if USE_LV_TABLE != 0
|
||||
#define LV_TABLE_COL_MAX CONFIG_LVGL_OBJ_TABLE_COLUMN_MAX
|
||||
#ifdef CONFIG_LVGL_OBJ_ROLLER
|
||||
#define LV_USE_ROLLER 1
|
||||
#else
|
||||
#define LV_USE_ROLLER 0
|
||||
#endif
|
||||
|
||||
#define USE_LV_LED CONFIG_LVGL_OBJ_LED
|
||||
#if LV_USE_ROLLER != 0
|
||||
#define LV_ROLLER_DEF_ANIM_TIME CONFIG_LVGL_OBJ_ROLLER_ANIM_TIME
|
||||
#define LV_ROLLER_INF_PAGES CONFIG_LVGL_OBJ_ROLLER_INF_PAGES
|
||||
#endif
|
||||
|
||||
#define USE_LV_MBOX CONFIG_LVGL_OBJ_MSG_BOX
|
||||
#ifdef CONFIG_LVGL_OBJ_SLIDER
|
||||
#define LV_USE_SLIDER 1
|
||||
#else
|
||||
#define LV_USE_SLIDER 0
|
||||
#endif
|
||||
|
||||
#define USE_LV_TA CONFIG_LVGL_OBJ_TEXT_AREA
|
||||
#if USE_LV_TA != 0
|
||||
#define LV_TA_CURSOR_BLINK_TIME \
|
||||
#ifdef CONFIG_LVGL_OBJ_SPINBOX
|
||||
#define LV_USE_SPINBOX 1
|
||||
#else
|
||||
#define LV_USE_SPINBOX 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_SWITCH
|
||||
#define LV_USE_SW 1
|
||||
#else
|
||||
#define LV_USE_SW 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_OBJ_TEXT_AREA
|
||||
#define LV_USE_TA 1
|
||||
#else
|
||||
#define LV_USE_TA 0
|
||||
#endif
|
||||
|
||||
#if LV_USE_TA != 0
|
||||
#define LV_TA_DEF_CURSOR_BLINK_TIME \
|
||||
CONFIG_LVGL_OBJ_TEXT_AREA_CURSOR_BLINK_TIME
|
||||
#define LV_TA_PWD_SHOW_TIME \
|
||||
#define LV_TA_DEF_PWD_SHOW_TIME \
|
||||
CONFIG_LVGL_OBJ_TEXT_AREA_PWD_SHOW_TIME
|
||||
#endif
|
||||
|
||||
#define USE_LV_SPINBOX CONFIG_LVGL_OBJ_SPINBOX
|
||||
|
||||
#define USE_LV_BTN CONFIG_LVGL_OBJ_BUTTON
|
||||
|
||||
#if USE_LV_BTN != 0
|
||||
#define LV_BTN_INK_EFFECT CONFIG_LVGL_OBJ_BUTTON_INK_EFFECT
|
||||
#ifdef CONFIG_LVGL_OBJ_TABLE
|
||||
#define LV_USE_TABLE 1
|
||||
#else
|
||||
#define LV_USE_TABLE 0
|
||||
#endif
|
||||
|
||||
#define USE_LV_IMGBTN CONFIG_LVGL_OBJ_IMG_BUTTON
|
||||
#if USE_LV_IMGBTN
|
||||
#define LV_IMGBTN_TILED CONFIG_LVGL_OBJ_IMG_BUTTON_TILED
|
||||
#if LV_USE_TABLE
|
||||
#define LV_TABLE_COL_MAX CONFIG_LVGL_OBJ_TABLE_COLUMN_MAX
|
||||
#endif
|
||||
|
||||
#define USE_LV_BTNM CONFIG_LVGL_OBJ_BUTTON_MATRIX
|
||||
|
||||
#define USE_LV_KB CONFIG_LVGL_OBJ_KEYBOARD
|
||||
|
||||
#define USE_LV_CB CONFIG_LVGL_OBJ_CHECK_BOX
|
||||
|
||||
#define USE_LV_LIST CONFIG_LVGL_OBJ_LIST
|
||||
#if USE_LV_LIST != 0
|
||||
#define LV_LIST_FOCUS_TIME CONFIG_LVGL_OBJ_LIST_FOCUS_TIME
|
||||
#ifdef CONFIG_LVGL_OBJ_TAB_VIEW
|
||||
#define LV_USE_TABVIEW 1
|
||||
#else
|
||||
#define LV_USE_TABVIEW 0
|
||||
#endif
|
||||
|
||||
#define USE_LV_DDLIST CONFIG_LVGL_OBJ_DROP_DOWN_LIST
|
||||
#if USE_LV_DDLIST != 0
|
||||
#define LV_DDLIST_ANIM_TIME CONFIG_LVGL_OBJ_DROP_DOWN_LIST_ANIM_TIME
|
||||
#if LV_USE_TABVIEW != 0
|
||||
#define LV_TABVIEW_DEF_ANIM_TIME CONFIG_LVGL_OBJ_TAB_VIEW_ANIMATION_TIME
|
||||
#endif
|
||||
|
||||
#define USE_LV_ROLLER CONFIG_LVGL_OBJ_ROLLER
|
||||
#if USE_LV_ROLLER != 0
|
||||
#define LV_ROLLER_ANIM_TIME CONFIG_LVGL_OBJ_ROLLER_ANIM_TIME
|
||||
#ifdef CONFIG_LVGL_OBJ_TILE_VIEW
|
||||
#define LV_USE_TILEVIEW 1
|
||||
#else
|
||||
#define LV_USE_TILEVIEW 0
|
||||
#endif
|
||||
|
||||
#define USE_LV_SLIDER CONFIG_LVGL_OBJ_SLIDER
|
||||
#if LV_USE_TILEVIEW
|
||||
#define LV_TILEVIEW_DEF_ANIM_TIME CONFIG_LVGL_OBJ_TILE_VIEW_ANIMATION_TIME
|
||||
#endif
|
||||
|
||||
#define USE_LV_SW CONFIG_LVGL_OBJ_SWITCH
|
||||
#ifdef CONFIGLVGL_OBJ_WINDOW
|
||||
#define LV_USE_WIN 1
|
||||
#else
|
||||
#define LV_USE_WIN 0
|
||||
#endif
|
||||
|
||||
#endif /* ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_ */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
* Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -7,21 +7,37 @@
|
|||
#include <init.h>
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include <lv_core/lv_refr.h>
|
||||
#include "lvgl_color.h"
|
||||
#include "lvgl_display.h"
|
||||
#ifdef CONFIG_LVGL_FILESYSTEM
|
||||
#include "lvgl_fs.h"
|
||||
#endif
|
||||
#include LV_MEM_CUSTOM_INCLUDE
|
||||
|
||||
#define LOG_LEVEL CONFIG_LVGL_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(lvgl);
|
||||
|
||||
struct device *lvgl_display_dev;
|
||||
#ifdef CONFIG_LVGL_BUFFER_ALLOC_STATIC
|
||||
|
||||
static lv_disp_buf_t disp_buf;
|
||||
|
||||
#define BUFFER_SIZE (CONFIG_LVGL_BITS_PER_PIXEL * ((CONFIG_LVGL_VDB_SIZE * \
|
||||
CONFIG_LVGL_HOR_RES * CONFIG_LVGL_VER_RES) / 100) / 8)
|
||||
|
||||
#define NBR_PIXELS_IN_BUFFER (BUFFER_SIZE * 8 / CONFIG_LVGL_BITS_PER_PIXEL)
|
||||
|
||||
static u8_t buf0[BUFFER_SIZE];
|
||||
#ifdef CONFIG_LVGL_DOUBLE_VDB
|
||||
static u8_t buf1[BUFFER_SIZE];
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_LVGL_BUFFER_ALLOC_STATIC */
|
||||
|
||||
#if CONFIG_LVGL_LOG_LEVEL != 0
|
||||
static void lvgl_log(lv_log_level_t level, const char *file, uint32_t line,
|
||||
const char *dsc)
|
||||
{
|
||||
/* Convert LVGL log level to Zephyr log lvel
|
||||
/* Convert LVGL log level to Zephyr log level
|
||||
*
|
||||
* LVGL log level mapping:
|
||||
* * LV_LOG_LEVEL_TRACE 0
|
||||
|
@ -46,22 +62,105 @@ static void lvgl_log(lv_log_level_t level, const char *file, uint32_t line,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LVGL_BUFFER_ALLOC_STATIC
|
||||
|
||||
static int lvgl_allocate_rendering_buffers(lv_disp_drv_t *disp_drv)
|
||||
{
|
||||
disp_drv->buffer = &disp_buf;
|
||||
#ifdef CONFIG_LVGL_DOUBLE_VDB
|
||||
lv_disp_buf_init(disp_drv->buffer, &buf0, &buf1, NBR_PIXELS_IN_BUFFER);
|
||||
#else
|
||||
lv_disp_buf_init(disp_drv->buffer, &buf0, NULL, NBR_PIXELS_IN_BUFFER);
|
||||
#endif /* CONFIG_LVGL_DOUBLE_VDB */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int lvgl_allocate_rendering_buffers(lv_disp_drv_t *disp_drv)
|
||||
{
|
||||
void *buf0 = NULL;
|
||||
void *buf1 = NULL;
|
||||
u16_t buf_nbr_pixels;
|
||||
u32_t buf_size;
|
||||
struct display_capabilities cap;
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
|
||||
display_get_capabilities(display_dev, &cap);
|
||||
|
||||
disp_drv->hor_res = cap.x_resolution;
|
||||
disp_drv->ver_res = cap.y_resolution;
|
||||
|
||||
buf_nbr_pixels = (CONFIG_LVGL_VDB_SIZE * disp_drv->hor_res *
|
||||
disp_drv->ver_res) / 100;
|
||||
/* one horizontal line is the minimum buffer requirement for lvgl */
|
||||
if (buf_nbr_pixels < disp_drv->hor_res) {
|
||||
buf_nbr_pixels = disp_drv->hor_res;
|
||||
}
|
||||
|
||||
switch (cap.current_pixel_format) {
|
||||
case PIXEL_FORMAT_ARGB_8888:
|
||||
buf_size = 4 * buf_nbr_pixels;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGB_888:
|
||||
buf_size = 3 * buf_nbr_pixels;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGB_565:
|
||||
buf_size = 2 * buf_nbr_pixels;
|
||||
break;
|
||||
case PIXEL_FORMAT_MONO01:
|
||||
case PIXEL_FORMAT_MONO10:
|
||||
buf_size = buf_nbr_pixels / 8;
|
||||
buf_size += (buf_nbr_pixels % 8) == 0 ? 0 : 1;
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
buf0 = LV_MEM_CUSTOM_ALLOC(buf_size);
|
||||
if (buf0 == NULL) {
|
||||
LOG_ERR("Failed to allocate memory for rendering buffer");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LVGL_DOUBLE_VDB
|
||||
buf1 = LV_MEM_CUSTOM_ALLOC(buf_size);
|
||||
if (buf1 == NULL) {
|
||||
LV_MEM_CUSTOM_FREE(buf0);
|
||||
LOG_ERR("Failed to allocate memory for rendering buffer");
|
||||
return -ENOMEM;
|
||||
}
|
||||
#endif
|
||||
|
||||
disp_drv->buffer = LV_MEM_CUSTOM_ALLOC(sizeof(lv_disp_buf_t));
|
||||
if (disp_drv->buffer == NULL) {
|
||||
LV_MEM_CUSTOM_FREE(buf0);
|
||||
LV_MEM_CUSTOM_FREE(buf1);
|
||||
LOG_ERR("Failed to allocate memory to store rendering buffers");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
lv_disp_buf_init(disp_drv->buffer, buf0, buf1, buf_nbr_pixels);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_LVGL_BUFFER_ALLOC_STATIC */
|
||||
|
||||
static int lvgl_init(struct device *dev)
|
||||
{
|
||||
lv_disp_drv_t disp_drv;
|
||||
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
lvgl_display_dev = device_get_binding(CONFIG_LVGL_DISPLAY_DEV_NAME);
|
||||
struct device *display_dev =
|
||||
device_get_binding(CONFIG_LVGL_DISPLAY_DEV_NAME);
|
||||
lv_disp_drv_t disp_drv;
|
||||
|
||||
if (lvgl_display_dev == NULL) {
|
||||
if (display_dev == NULL) {
|
||||
LOG_ERR("Display device not found.");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#if CONFIG_LVGL_LOG_LEVEL != 0
|
||||
lv_log_register_print(lvgl_log);
|
||||
lv_log_register_print_cb(lvgl_log);
|
||||
#endif
|
||||
|
||||
lv_init();
|
||||
|
@ -70,14 +169,16 @@ static int lvgl_init(struct device *dev)
|
|||
lvgl_fs_init();
|
||||
#endif
|
||||
|
||||
lv_refr_set_round_cb(get_round_func());
|
||||
|
||||
lv_disp_drv_init(&disp_drv);
|
||||
disp_drv.disp_flush = get_disp_flush();
|
||||
disp_drv.user_data = (void *) display_dev;
|
||||
|
||||
lvgl_allocate_rendering_buffers(&disp_drv);
|
||||
|
||||
if (set_lvgl_rendering_cb(&disp_drv) != 0) {
|
||||
LOG_ERR("Display not supported.");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#if CONFIG_LVGL_VDB_SIZE != 0
|
||||
disp_drv.vdb_wr = get_vdb_write();
|
||||
#endif
|
||||
if (lv_disp_drv_register(&disp_drv) == NULL) {
|
||||
LOG_ERR("Failed to register display device.");
|
||||
return -EPERM;
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_LIB_GUI_LVGL_LVGL_COLOR_H_
|
||||
#define ZEPHYR_LIB_GUI_LVGL_LVGL_COLOR_H_
|
||||
|
||||
#include <drivers/display.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern struct device *lvgl_display_dev;
|
||||
|
||||
void *get_disp_flush(void);
|
||||
void *get_vdb_write(void);
|
||||
void *get_round_func(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZEPHYR_LIB_GUI_LVGL_LVGL_COLOR_H */
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_color.h"
|
||||
|
||||
#if CONFIG_LVGL_BITS_PER_PIXEL == 0
|
||||
|
||||
static void zephyr_disp_flush(s32_t x1, s32_t y1, s32_t x2, s32_t y2,
|
||||
const lv_color_t *color_p)
|
||||
{
|
||||
u16_t w = x2 - x1 + 1;
|
||||
u16_t h = y2 - y1 + 1;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
desc.buf_size = w * 2U * h;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(lvgl_display_dev, x1, y1, &desc, (void *) color_p);
|
||||
|
||||
lv_flush_ready();
|
||||
}
|
||||
|
||||
#define zephyr_vdb_write NULL
|
||||
|
||||
#else
|
||||
|
||||
#error "Unsupported pixel format conversion"
|
||||
|
||||
#endif /* CONFIG_LVGL_BITS_PER_PIXEL */
|
||||
|
||||
void *get_disp_flush(void)
|
||||
{
|
||||
return zephyr_disp_flush;
|
||||
}
|
||||
|
||||
void *get_vdb_write(void)
|
||||
{
|
||||
return zephyr_vdb_write;
|
||||
}
|
||||
|
||||
void *get_round_func(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_color.h"
|
||||
|
||||
#if CONFIG_LVGL_BITS_PER_PIXEL == 0
|
||||
|
||||
static void zephyr_disp_flush(s32_t x1, s32_t y1, s32_t x2, s32_t y2,
|
||||
const lv_color_t *color_p)
|
||||
{
|
||||
u16_t w = x2 - x1 + 1;
|
||||
u16_t h = y2 - y1 + 1;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
desc.buf_size = w * 4U * h;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(lvgl_display_dev, x1, y1, &desc, (void *) color_p);
|
||||
|
||||
lv_flush_ready();
|
||||
}
|
||||
|
||||
#define zephyr_vdb_write NULL
|
||||
|
||||
#elif CONFIG_LVGL_BITS_PER_PIXEL == 24
|
||||
|
||||
static void zephyr_disp_flush(s32_t x1, s32_t y1, s32_t x2, s32_t y2,
|
||||
const lv_color_t *color_p)
|
||||
{
|
||||
u16_t w = x2 - x1 + 1;
|
||||
u16_t h = y2 - y1 + 1;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
desc.buf_size = w * 3U * h;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(lvgl_display_dev, x1, y1, &desc, (void *) color_p);
|
||||
|
||||
lv_flush_ready();
|
||||
}
|
||||
|
||||
static void zephyr_vdb_write(u8_t *buf, lv_coord_t buf_w, lv_coord_t x,
|
||||
lv_coord_t y, lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
u8_t *buf_xy = buf + x * 3U + y * 3U * buf_w;
|
||||
|
||||
if (opa != LV_OPA_COVER) {
|
||||
lv_color_t mix_color;
|
||||
|
||||
mix_color.red = *buf_xy;
|
||||
mix_color.green = *(buf_xy+1);
|
||||
mix_color.blue = *(buf_xy+2);
|
||||
color = lv_color_mix(color, mix_color, opa);
|
||||
}
|
||||
|
||||
*buf_xy = color.red;
|
||||
*(buf_xy + 1) = color.green;
|
||||
*(buf_xy + 2) = color.blue;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error "Unsupported pixel format conversion"
|
||||
|
||||
#endif /* CONFIG_LVGL_BITS_PER_PIXEL */
|
||||
|
||||
void *get_disp_flush(void)
|
||||
{
|
||||
return zephyr_disp_flush;
|
||||
}
|
||||
|
||||
void *get_vdb_write(void)
|
||||
{
|
||||
return zephyr_vdb_write;
|
||||
}
|
||||
|
||||
void *get_round_func(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_color.h"
|
||||
|
||||
#if CONFIG_LVGL_BITS_PER_PIXEL == 0
|
||||
|
||||
static void zephyr_disp_flush(s32_t x1, s32_t y1, s32_t x2, s32_t y2,
|
||||
const lv_color_t *color_p)
|
||||
{
|
||||
u16_t w = x2 - x1 + 1;
|
||||
u16_t h = y2 - y1 + 1;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
desc.buf_size = w * h;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(lvgl_display_dev, x1, y1, &desc, (void *) color_p);
|
||||
|
||||
lv_flush_ready();
|
||||
}
|
||||
|
||||
#define zephyr_vdb_write NULL
|
||||
|
||||
#else
|
||||
|
||||
#error "Unsupported pixel format conversion"
|
||||
|
||||
#endif /* CONFIG_LVGL_BITS_PER_PIXEL */
|
||||
|
||||
void *get_disp_flush(void)
|
||||
{
|
||||
return zephyr_disp_flush;
|
||||
}
|
||||
|
||||
void *get_vdb_write(void)
|
||||
{
|
||||
return zephyr_vdb_write;
|
||||
}
|
||||
|
||||
void *get_round_func(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
57
lib/gui/lvgl/lvgl_display.c
Normal file
57
lib/gui/lvgl/lvgl_display.c
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "lvgl_display.h"
|
||||
|
||||
int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv)
|
||||
{
|
||||
int err = 0;
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
struct display_capabilities cap;
|
||||
|
||||
display_get_capabilities(display_dev, &cap);
|
||||
|
||||
switch (cap.current_pixel_format) {
|
||||
case PIXEL_FORMAT_ARGB_8888:
|
||||
disp_drv->flush_cb = lvgl_flush_cb_32bit;
|
||||
disp_drv->rounder_cb = NULL;
|
||||
#ifdef CONFIG_LVGL_COLOR_DEPTH_32
|
||||
disp_drv->set_px_cb = NULL;
|
||||
#else
|
||||
disp_drv->set_px_cb = lvgl_set_px_cb_32bit;
|
||||
#endif
|
||||
break;
|
||||
case PIXEL_FORMAT_RGB_888:
|
||||
disp_drv->flush_cb = lvgl_flush_cb_24bit;
|
||||
disp_drv->rounder_cb = NULL;
|
||||
disp_drv->set_px_cb = lvgl_set_px_cb_24bit;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGB_565:
|
||||
disp_drv->flush_cb = lvgl_flush_cb_16bit;
|
||||
disp_drv->rounder_cb = NULL;
|
||||
#ifdef CONFIG_LVGL_COLOR_DEPTH_16
|
||||
disp_drv->set_px_cb = NULL;
|
||||
#else
|
||||
disp_drv->set_px_cb = lvgl_set_px_cb_16bit;
|
||||
#endif
|
||||
break;
|
||||
case PIXEL_FORMAT_MONO01:
|
||||
case PIXEL_FORMAT_MONO10:
|
||||
disp_drv->flush_cb = lvgl_flush_cb_mono;
|
||||
disp_drv->rounder_cb = lvgl_rounder_cb_mono;
|
||||
disp_drv->set_px_cb = lvgl_set_px_cb_mono;
|
||||
break;
|
||||
default:
|
||||
disp_drv->flush_cb = NULL;
|
||||
disp_drv->rounder_cb = NULL;
|
||||
disp_drv->set_px_cb = NULL;
|
||||
err = -ENOTSUP;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
47
lib/gui/lvgl/lvgl_display.h
Normal file
47
lib/gui/lvgl/lvgl_display.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_LIB_GUI_LVGL_LVGL_DISPLAY_H_
|
||||
#define ZEPHYR_LIB_GUI_LVGL_LVGL_DISPLAY_H_
|
||||
|
||||
#include <drivers/display.h>
|
||||
#include <lvgl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void lvgl_flush_cb_mono(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p);
|
||||
void lvgl_flush_cb_16bit(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p);
|
||||
void lvgl_flush_cb_24bit(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p);
|
||||
void lvgl_flush_cb_32bit(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p);
|
||||
|
||||
void lvgl_set_px_cb_mono(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
void lvgl_set_px_cb_16bit(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
void lvgl_set_px_cb_24bit(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
void lvgl_set_px_cb_32bit(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
void lvgl_rounder_cb_mono(struct _disp_drv_t *disp_drv, lv_area_t *area);
|
||||
|
||||
int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZEPHYR_LIB_GUI_LVGL_LVGL_DISPLAY_H */
|
36
lib/gui/lvgl/lvgl_display_16bit.c
Normal file
36
lib/gui/lvgl/lvgl_display_16bit.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_display.h"
|
||||
|
||||
void lvgl_flush_cb_16bit(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p)
|
||||
{
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
u16_t w = area->x2 - area->x1 + 1;
|
||||
u16_t h = area->y2 - area->y1 + 1;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
desc.buf_size = w * 2U * h;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(display_dev, area->x1, area->y1, &desc, (void *) color_p);
|
||||
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_LVGL_COLOR_DEPTH_16
|
||||
void lvgl_set_px_cb_16bit(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
u16_t *buf_xy = (u16_t *)(buf + x * 2U + y * 2U * buf_w);
|
||||
*buf_xy = lv_color_to16(color);
|
||||
}
|
||||
#endif
|
51
lib/gui/lvgl/lvgl_display_24bit.c
Normal file
51
lib/gui/lvgl/lvgl_display_24bit.c
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_display.h"
|
||||
|
||||
void lvgl_flush_cb_24bit(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p)
|
||||
{
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
u16_t w = area->x2 - area->x1 + 1;
|
||||
u16_t h = area->y2 - area->y1 + 1;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
desc.buf_size = w * 3U * h;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(display_dev, area->x1, area->y1, &desc, (void *) color_p);
|
||||
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
}
|
||||
|
||||
void lvgl_set_px_cb_24bit(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
u8_t *buf_xy = buf + x * 3U + y * 3U * buf_w;
|
||||
lv_color32_t converted_color;
|
||||
|
||||
#ifdef CONFIG_LVGL_COLOR_DEPTH_32
|
||||
if (opa != LV_OPA_COVER) {
|
||||
lv_color_t mix_color;
|
||||
|
||||
mix_color.ch.red = *buf_xy;
|
||||
mix_color.ch.green = *(buf_xy+1);
|
||||
mix_color.ch.blue = *(buf_xy+2);
|
||||
color = lv_color_mix(color, mix_color, opa);
|
||||
}
|
||||
#endif
|
||||
|
||||
converted_color.full = lv_color_to32(color);
|
||||
*buf_xy = converted_color.ch.red;
|
||||
*(buf_xy + 1) = converted_color.ch.green;
|
||||
*(buf_xy + 2) = converted_color.ch.blue;
|
||||
}
|
||||
|
36
lib/gui/lvgl/lvgl_display_32bit.c
Normal file
36
lib/gui/lvgl/lvgl_display_32bit.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_display.h"
|
||||
|
||||
void lvgl_flush_cb_32bit(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p)
|
||||
{
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
u16_t w = area->x2 - area->x1 + 1;
|
||||
u16_t h = area->y2 - area->y1 + 1;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
desc.buf_size = w * 4U * h;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(display_dev, area->x1, area->y1, &desc, (void *) color_p);
|
||||
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_LVGL_COLOR_DEPTH_32
|
||||
void lvgl_set_px_cb_32bit(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
u32_t *buf_xy = (u32_t *)(buf + x * 4U + y * 4U * buf_w);
|
||||
*buf_xy = lv_color_to32(color);
|
||||
}
|
||||
#endif
|
|
@ -1,46 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_color.h"
|
||||
#include "lvgl_display.h"
|
||||
|
||||
#if CONFIG_LVGL_BITS_PER_PIXEL == 1
|
||||
|
||||
static void zephyr_disp_flush(s32_t x1, s32_t y1, s32_t x2, s32_t y2,
|
||||
const lv_color_t *color_p)
|
||||
void lvgl_flush_cb_mono(struct _disp_drv_t *disp_drv,
|
||||
const lv_area_t *area, lv_color_t *color_p)
|
||||
{
|
||||
u16_t w = x2 - x1 + 1;
|
||||
u16_t h = y2 - y1 + 1;
|
||||
u16_t w = area->x2 - area->x1 + 1;
|
||||
u16_t h = area->y2 - area->y1 + 1;
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
struct display_capabilities cap;
|
||||
struct display_buffer_descriptor desc;
|
||||
|
||||
display_get_capabilities(lvgl_display_dev, &cap);
|
||||
display_get_capabilities(display_dev, &cap);
|
||||
|
||||
desc.buf_size = (w * h)/8U;
|
||||
desc.width = w;
|
||||
desc.pitch = w;
|
||||
desc.height = h;
|
||||
display_write(lvgl_display_dev, x1, y1, &desc, (void *) color_p);
|
||||
display_write(display_dev, area->x1, area->y1, &desc, (void *) color_p);
|
||||
if (cap.screen_info & SCREEN_INFO_DOUBLE_BUFFER) {
|
||||
display_write(lvgl_display_dev, x1, y1, &desc,
|
||||
display_write(display_dev, area->x1, area->y1, &desc,
|
||||
(void *) color_p);
|
||||
}
|
||||
|
||||
lv_flush_ready();
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
}
|
||||
|
||||
void zephyr_vdb_write(u8_t *buf, lv_coord_t buf_w, lv_coord_t x,
|
||||
lv_coord_t y, lv_color_t color, lv_opa_t opa)
|
||||
|
||||
void lvgl_set_px_cb_mono(struct _disp_drv_t *disp_drv,
|
||||
u8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
u8_t *buf_xy;
|
||||
u8_t bit;
|
||||
struct display_capabilities cap;
|
||||
|
||||
display_get_capabilities(lvgl_display_dev, &cap);
|
||||
display_get_capabilities(display_dev, &cap);
|
||||
|
||||
if (cap.screen_info & SCREEN_INFO_MONO_VTILED) {
|
||||
buf_xy = buf + x + y/8 * buf_w;
|
||||
|
@ -75,38 +77,19 @@ void zephyr_vdb_write(u8_t *buf, lv_coord_t buf_w, lv_coord_t x,
|
|||
}
|
||||
}
|
||||
|
||||
void zephyr_round_area(lv_area_t *a)
|
||||
void lvgl_rounder_cb_mono(struct _disp_drv_t *disp_drv,
|
||||
lv_area_t *area)
|
||||
{
|
||||
struct device *display_dev = (struct device *)disp_drv->user_data;
|
||||
struct display_capabilities cap;
|
||||
|
||||
display_get_capabilities(lvgl_display_dev, &cap);
|
||||
display_get_capabilities(display_dev, &cap);
|
||||
|
||||
if (cap.screen_info & SCREEN_INFO_MONO_VTILED) {
|
||||
a->y1 &= ~0x7;
|
||||
a->y2 |= 0x7;
|
||||
area->y1 &= ~0x7;
|
||||
area->y2 |= 0x7;
|
||||
} else {
|
||||
a->x1 &= ~0x7;
|
||||
a->x2 |= 0x7;
|
||||
area->x1 &= ~0x7;
|
||||
area->x2 |= 0x7;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error "Unsupported pixel format conversion"
|
||||
|
||||
#endif /* CONFIG_LVGL_BITS_PER_PIXEL */
|
||||
|
||||
void *get_disp_flush(void)
|
||||
{
|
||||
return zephyr_disp_flush;
|
||||
}
|
||||
|
||||
void *get_vdb_write(void)
|
||||
{
|
||||
return zephyr_vdb_write;
|
||||
}
|
||||
|
||||
void *get_round_func(void)
|
||||
{
|
||||
return zephyr_round_area;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
* Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -7,15 +7,9 @@
|
|||
#include <lvgl.h>
|
||||
#include <zephyr.h>
|
||||
#include <fs/fs.h>
|
||||
#include "lvgl_fs.h"
|
||||
|
||||
/* Stub for LVGL ufs (ram based FS) init function
|
||||
* as we use Zephyr FS API instead
|
||||
*/
|
||||
void lv_ufs_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool lvgl_fs_ready(void)
|
||||
static bool lvgl_fs_ready(struct _lv_fs_drv_t *drv)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -54,8 +48,8 @@ static lv_fs_res_t errno_to_lv_fs_res(int err)
|
|||
}
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_open(void *file, const char *path,
|
||||
lv_fs_mode_t mode)
|
||||
static lv_fs_res_t lvgl_fs_open(struct _lv_fs_drv_t *drv, void *file,
|
||||
const char *path, lv_fs_mode_t mode)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -63,15 +57,15 @@ static lv_fs_res_t lvgl_fs_open(void *file, const char *path,
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_close(void *file)
|
||||
static lv_fs_res_t lvgl_fs_close(struct _lv_fs_drv_t *drv, void *file)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = fs_close((struct fs_file_t *)file);
|
||||
return LV_FS_RES_NOT_IMP;
|
||||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_remove(const char *path)
|
||||
static lv_fs_res_t lvgl_fs_remove(struct _lv_fs_drv_t *drv, const char *path)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -79,8 +73,8 @@ static lv_fs_res_t lvgl_fs_remove(const char *path)
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_read(void *file, void *buf, u32_t btr,
|
||||
u32_t *br)
|
||||
static lv_fs_res_t lvgl_fs_read(struct _lv_fs_drv_t *drv, void *file,
|
||||
void *buf, u32_t btr, u32_t *br)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -96,8 +90,8 @@ static lv_fs_res_t lvgl_fs_read(void *file, void *buf, u32_t btr,
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_write(void *file, const void *buf, u32_t btw,
|
||||
u32_t *bw)
|
||||
static lv_fs_res_t lvgl_fs_write(struct _lv_fs_drv_t *drv, void *file,
|
||||
const void *buf, u32_t btw, u32_t *bw)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -120,7 +114,7 @@ static lv_fs_res_t lvgl_fs_write(void *file, const void *buf, u32_t btw,
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_seek(void *file, u32_t pos)
|
||||
static lv_fs_res_t lvgl_fs_seek(struct _lv_fs_drv_t *drv, void *file, u32_t pos)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -128,13 +122,14 @@ static lv_fs_res_t lvgl_fs_seek(void *file, u32_t pos)
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_tell(void *file, u32_t *pos_p)
|
||||
static lv_fs_res_t lvgl_fs_tell(struct _lv_fs_drv_t *drv, void *file,
|
||||
u32_t *pos_p)
|
||||
{
|
||||
*pos_p = fs_tell((struct fs_file_t *)file);
|
||||
return LV_FS_RES_OK;
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_trunc(void *file)
|
||||
static lv_fs_res_t lvgl_fs_trunc(struct _lv_fs_drv_t *drv, void *file)
|
||||
{
|
||||
int err;
|
||||
off_t length;
|
||||
|
@ -145,7 +140,8 @@ static lv_fs_res_t lvgl_fs_trunc(void *file)
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_size(void *file, u32_t *fsize)
|
||||
static lv_fs_res_t lvgl_fs_size(struct _lv_fs_drv_t *drv, void *file,
|
||||
u32_t *fsize)
|
||||
{
|
||||
int err;
|
||||
off_t org_pos;
|
||||
|
@ -170,7 +166,8 @@ static lv_fs_res_t lvgl_fs_size(void *file, u32_t *fsize)
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_rename(const char *from, const char *to)
|
||||
static lv_fs_res_t lvgl_fs_rename(struct _lv_fs_drv_t *drv, const char *from,
|
||||
const char *to)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -178,7 +175,8 @@ static lv_fs_res_t lvgl_fs_rename(const char *from, const char *to)
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_free(u32_t *total_p, u32_t *free_p)
|
||||
static lv_fs_res_t lvgl_fs_free(struct _lv_fs_drv_t *drv, u32_t *total_p,
|
||||
u32_t *free_p)
|
||||
{
|
||||
/* We have no easy way of telling the total file system size.
|
||||
* Zephyr can only return this information per mount point.
|
||||
|
@ -186,7 +184,8 @@ static lv_fs_res_t lvgl_fs_free(u32_t *total_p, u32_t *free_p)
|
|||
return LV_FS_RES_NOT_IMP;
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_dir_open(void *dir, const char *path)
|
||||
static lv_fs_res_t lvgl_fs_dir_open(struct _lv_fs_drv_t *drv, void *dir,
|
||||
const char *path)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -194,7 +193,8 @@ static lv_fs_res_t lvgl_fs_dir_open(void *dir, const char *path)
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_dir_read(void *dir, char *fn)
|
||||
static lv_fs_res_t lvgl_fs_dir_read(struct _lv_fs_drv_t *drv, void *dir,
|
||||
char *fn)
|
||||
{
|
||||
/* LVGL expects a string as return parameter but the format of the
|
||||
* string is not documented.
|
||||
|
@ -202,7 +202,7 @@ static lv_fs_res_t lvgl_fs_dir_read(void *dir, char *fn)
|
|||
return LV_FS_RES_NOT_IMP;
|
||||
}
|
||||
|
||||
static lv_fs_res_t lvgl_fs_dir_close(void *dir)
|
||||
static lv_fs_res_t lvgl_fs_dir_close(struct _lv_fs_drv_t *drv, void *dir)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -210,34 +210,31 @@ static lv_fs_res_t lvgl_fs_dir_close(void *dir)
|
|||
return errno_to_lv_fs_res(err);
|
||||
}
|
||||
|
||||
|
||||
void lvgl_fs_init(void)
|
||||
{
|
||||
lv_fs_drv_t fs_drv;
|
||||
|
||||
memset(&fs_drv, 0, sizeof(lv_fs_drv_t));
|
||||
lv_fs_drv_init(&fs_drv);
|
||||
|
||||
fs_drv.file_size = sizeof(struct fs_file_t);
|
||||
fs_drv.rddir_size = sizeof(struct fs_dir_t);
|
||||
fs_drv.letter = '/';
|
||||
fs_drv.ready = lvgl_fs_ready;
|
||||
fs_drv.ready_cb = lvgl_fs_ready;
|
||||
|
||||
fs_drv.open = lvgl_fs_open;
|
||||
fs_drv.close = lvgl_fs_close;
|
||||
fs_drv.remove = lvgl_fs_remove;
|
||||
fs_drv.read = lvgl_fs_read;
|
||||
fs_drv.write = lvgl_fs_write;
|
||||
fs_drv.seek = lvgl_fs_seek;
|
||||
fs_drv.tell = lvgl_fs_tell;
|
||||
fs_drv.trunc = lvgl_fs_trunc;
|
||||
fs_drv.size = lvgl_fs_size;
|
||||
fs_drv.rename = lvgl_fs_rename;
|
||||
fs_drv.free = lvgl_fs_free;
|
||||
fs_drv.open_cb = lvgl_fs_open;
|
||||
fs_drv.close_cb = lvgl_fs_close;
|
||||
fs_drv.remove_cb = lvgl_fs_remove;
|
||||
fs_drv.read_cb = lvgl_fs_read;
|
||||
fs_drv.write_cb = lvgl_fs_write;
|
||||
fs_drv.seek_cb = lvgl_fs_seek;
|
||||
fs_drv.tell_cb = lvgl_fs_tell;
|
||||
fs_drv.trunc_cb = lvgl_fs_trunc;
|
||||
fs_drv.size_cb = lvgl_fs_size;
|
||||
fs_drv.rename_cb = lvgl_fs_rename;
|
||||
fs_drv.free_space_cb = lvgl_fs_free;
|
||||
|
||||
fs_drv.dir_open = lvgl_fs_dir_open;
|
||||
fs_drv.dir_read = lvgl_fs_dir_read;
|
||||
fs_drv.dir_close = lvgl_fs_dir_close;
|
||||
fs_drv.dir_open_cb = lvgl_fs_dir_open;
|
||||
fs_drv.dir_read_cb = lvgl_fs_dir_read;
|
||||
fs_drv.dir_close_cb = lvgl_fs_dir_close;
|
||||
|
||||
lv_fs_add_drv(&fs_drv);
|
||||
lv_fs_drv_register(&fs_drv);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue