Skip to content

Commit 0e10a40

Browse files
committed
feat(lvgl): update lvgl to v5.3, some driver:xpt2046 half duplex
1 parent a6811ce commit 0e10a40

File tree

126 files changed

+13203
-23927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+13203
-23927
lines changed

.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[submodule "spi_devices/lcd/Adafruit-GFX-Library"]
2-
path = spi_devices/lcd/Adafruit-GFX-Library
3-
url = https://github.com/adafruit/Adafruit-GFX-Library.git
41
[submodule "components/lvgl_gui/lvgl"]
52
path = components/lvgl_gui/lvgl
63
url = https://github.com/littlevgl/lvgl.git
4+
[submodule "components/spi_devices/lcd/Adafruit-GFX-Library"]
5+
path = components/spi_devices/lcd/Adafruit-GFX-Library
6+
url = https://github.com/adafruit/Adafruit-GFX-Library.git

components/gdrivers/CMakeLists.txt

+207
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
2+
if(CONFIG_UGFX_GUI_ENABLE)
3+
if(NOT CONFIG_UGFX_USE_CUSTOM_DRIVER)
4+
5+
set(COMPONENT_SRCS "")
6+
set(COMPONENT_ADD_INCLUDEDIRS "include")
7+
8+
#Display driver mode
9+
if(CONFIG_UGFX_LCD_DRIVER_FRAMEBUFFER_MODE)
10+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
11+
"gdisp/framebuffer/gdisp_lld_framebuffer.c"
12+
)
13+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
14+
"gdisp/framebuffer")
15+
endif()
16+
17+
#Display driver
18+
if(CONFIG_UGFX_DRIVER_ILI9341)
19+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
20+
"gdisp/ILI9341/gdisp_lld_ILI9341.c"
21+
"gdisp/ILI9341/ILI9341_adapter.cpp"
22+
)
23+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
24+
"gdisp/ILI9341")
25+
endif()
26+
27+
if(CONFIG_UGFX_DRIVER_ST7789)
28+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
29+
"gdisp/ST7789/gdisp_lld_ST7789.c"
30+
"gdisp/ST7789/ST7789_adapter.cpp"
31+
)
32+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
33+
"gdisp/ST7789")
34+
endif()
35+
36+
if(CONFIG_UGFX_DRIVER_SSD1306)
37+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
38+
"gdisp/SSD1306/gdisp_lld_SSD1306.c"
39+
"gdisp/SSD1306/SSD1306_adapter.cpp"
40+
)
41+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
42+
"gdisp/SSD1306")
43+
endif()
44+
45+
if(CONFIG_UGFX_DRIVER_NT35510)
46+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
47+
"gdisp/NT35510/gdisp_lld_NT35510.c"
48+
"gdisp/NT35510/NT35510_adapter.cpp"
49+
)
50+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
51+
"gdisp/NT35510")
52+
endif()
53+
54+
#Input driver
55+
#Touch driver
56+
if(CONFIG_UGFX_DRIVER_TOUCH_SCREEN_ENABLE)
57+
if(CONFIG_UGFX_DRIVER_TOUCH_XPT2046)
58+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
59+
"ginput/touch/XPT2046/gmouse_lld_XPT2046.c"
60+
"ginput/touch/XPT2046/XPT2046_adapter.cpp")
61+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
62+
"ginput/touch/XPT2046")
63+
endif()
64+
65+
if(CONFIG_UGFX_DRIVER_TOUCH_FT5X06)
66+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
67+
"ginput/touch/FT5X06/gmouse_lld_FT5x06.c"
68+
"ginput/touch/FT5X06/lvgl_indev_adapter.c")
69+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
70+
"ginput/touch/FT5X06")
71+
endif()
72+
endif()
73+
74+
#Toggle driver
75+
if(CONFIG_UGFX_DRIVER_TOGGLE_ENABLE)
76+
if(CONFIG_UGFX_DRIVER_TOGGLE_BUTTON)
77+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
78+
"ginput/toggle/button/ginput_lld_toggle_button.c")
79+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
80+
"ginput/toggle/button")
81+
endif()
82+
83+
if(CONFIG_UGFX_DRIVER_TOGGLE_TOUCHPAD)
84+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
85+
"ginput/toggle/touchpad/ginput_lld_toggle_touchpad.c")
86+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
87+
"ginput/toggle/touchpad")
88+
endif()
89+
endif()
90+
91+
#Audio driver
92+
if(CONFIG_UGFX_DRIVER_AUDIO_ENABLE)
93+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
94+
"gaudio/dac_audio/gaudio_play_dac_audio.c"
95+
)
96+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
97+
"gaudio/dac_audio")
98+
endif()
99+
100+
endif()
101+
else()
102+
if(CONFIG_LVGL_GUI_ENABLE)
103+
if(NOT CONFIG_LVGL_USE_CUSTOM_DRIVER)
104+
set(COMPONENT_SRCS "")
105+
106+
set(COMPONENT_ADD_INCLUDEDIRS "include")
107+
108+
#Display driver mode
109+
if(CONFIG_LVGL_LCD_DRIVER_FRAMEBUFFER_MODE)
110+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
111+
"gdisp/framebuffer/gdisp_lld_framebuffer.c")
112+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
113+
"gdisp/framebuffer")
114+
endif()
115+
116+
#Display driver
117+
if(CONFIG_LVGL_DRIVER_ILI9341)
118+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
119+
"gdisp/ILI9341/gdisp_lld_ILI9341.c"
120+
"gdisp/ILI9341/ILI9341_adapter.cpp")
121+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
122+
"gdisp/ILI9341")
123+
endif()
124+
125+
if(CONFIG_LVGL_DRIVER_ST7789)
126+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
127+
"gdisp/ST7789/gdisp_lld_ST7789.c"
128+
"gdisp/ST7789/ST7789_adapter.cpp")
129+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
130+
"gdisp/ST7789")
131+
endif()
132+
133+
if(CONFIG_LVGL_DRIVER_SSD1306)
134+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
135+
"gdisp/SSD1306/gdisp_lld_SSD1306.c"
136+
"gdisp/SSD1306/SSD1306_adapter.cpp")
137+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
138+
"gdisp/SSD1306")
139+
endif()
140+
141+
if(CONFIG_LVGL_DRIVER_NT35510)
142+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
143+
"gdisp/NT35510/gdisp_lld_NT35510.c"
144+
"gdisp/NT35510/NT35510_adapter.cpp")
145+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
146+
"gdisp/NT35510")
147+
endif()
148+
149+
#Input driver
150+
#Touch driver
151+
if(CONFIG_LVGL_DRIVER_TOUCH_SCREEN_ENABLE)
152+
if(CONFIG_LVGL_DRIVER_TOUCH_XPT2046)
153+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
154+
"ginput/touch/XPT2046/gmouse_lld_XPT2046.c"
155+
"ginput/touch/XPT2046/XPT2046_adapter.cpp")
156+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
157+
"ginput/touch/XPT2046")
158+
endif()
159+
160+
if(CONFIG_LVGL_DRIVER_TOUCH_FT5X06)
161+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
162+
"ginput/touch/FT5X06/gmouse_lld_FT5x06.c"
163+
"ginput/touch/FT5X06/lvgl_indev_adapter.c")
164+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
165+
"ginput/touch/FT5X06")
166+
endif()
167+
endif()
168+
169+
#Toggle driver
170+
if(CONFIG_LVGL_DRIVER_TOGGLE_ENABLE)
171+
if(CONFIG_LVGL_DRIVER_TOGGLE_BUTTON)
172+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
173+
"ginput/toggle/button/ginput_lld_toggle_button.c")
174+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
175+
"ginput/toggle/button")
176+
endif()
177+
178+
if(CONFIG_LVGL_DRIVER_TOGGLE_TOUCHPAD)
179+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
180+
"ginput/toggle/touchpad/ginput_lld_toggle_touchpad.c")
181+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
182+
"ginput/toggle/touchpad")
183+
endif()
184+
endif()
185+
186+
#Audio driver
187+
if(CONFIG_LVGL_DRIVER_AUDIO_ENABLE)
188+
set(COMPONENT_SRCS "${COMPONENT_SRCS}"
189+
"gaudio/dac_audio/gaudio_play_dac_audio.c")
190+
set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}"
191+
"gaudio/dac_audio")
192+
endif()
193+
194+
endif()
195+
else()
196+
set(COMPONENT_SRCS "")
197+
set(COMPONENT_ADD_INCLUDEDIRS "")
198+
endif()
199+
endif()
200+
201+
# The values of COMPONENT_REQUIRES and COMPONENT_PRIV_REQUIRES should not
202+
# depend on any configuration choices (CONFIG_xxx macros).
203+
# This is because requirements are expanded before configuration is loaded.
204+
# Other component variables (like include paths or source files) can depend on configuration choices.
205+
set(COMPONENT_REQUIRES lvgl_gui ugfx_gui nt35510 ssd1306 lcd xpt2046 ft5x06 touchpad)
206+
207+
register_component()

components/gdrivers/component.mk

+48-10
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,42 @@ ifdef CONFIG_UGFX_GUI_ENABLE
3737
COMPONENT_ADD_INCLUDEDIRS += ./gdisp/NT35510
3838
endif
3939

40-
#Input driver
40+
#Input driver
41+
#Touch driver
4142
ifdef CONFIG_UGFX_DRIVER_TOUCH_SCREEN_ENABLE
4243

4344
ifdef CONFIG_UGFX_DRIVER_TOUCH_XPT2046
44-
COMPONENT_SRCDIRS += ./ginput/XPT2046
45-
COMPONENT_ADD_INCLUDEDIRS += ./ginput/XPT2046
45+
COMPONENT_SRCDIRS += ./ginput/touch/XPT2046
46+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/touch/XPT2046
4647
endif
4748

4849
ifdef CONFIG_UGFX_DRIVER_TOUCH_FT5X06
49-
COMPONENT_SRCDIRS += ./ginput/FT5X06
50-
COMPONENT_ADD_INCLUDEDIRS += ./ginput/FT5X06
50+
COMPONENT_SRCDIRS += ./ginput/touch/FT5X06
51+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/touch/FT5X06
5152
endif
5253

5354
endif
55+
56+
#Toggle driver
57+
ifdef CONFIG_UGFX_DRIVER_TOGGLE_ENABLE
58+
59+
ifdef CONFIG_UGFX_DRIVER_TOGGLE_BUTTON
60+
COMPONENT_SRCDIRS += ./ginput/toggle/button
61+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/toggle/button
62+
endif
63+
64+
ifdef CONFIG_UGFX_DRIVER_TOGGLE_TOUCHPAD
65+
COMPONENT_SRCDIRS += ./ginput/toggle/touchpad
66+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/toggle/touchpad
67+
endif
68+
69+
endif
70+
71+
#Audio driver
72+
ifdef CONFIG_UGFX_DRIVER_AUDIO_ENABLE
73+
COMPONENT_SRCDIRS += ./gaudio/dac_audio
74+
COMPONENT_ADD_INCLUDEDIRS += ./gaudio/dac_audio
75+
endif
5476

5577
endif
5678

@@ -84,20 +106,36 @@ else
84106
COMPONENT_ADD_INCLUDEDIRS += ./gdisp/NT35510
85107
endif
86108

87-
#Input driver
109+
#Input driver
110+
#Touch driver
88111
ifdef CONFIG_LVGL_DRIVER_TOUCH_SCREEN_ENABLE
89112

90113
ifdef CONFIG_LVGL_DRIVER_TOUCH_XPT2046
91-
COMPONENT_SRCDIRS += ./ginput/XPT2046
92-
COMPONENT_ADD_INCLUDEDIRS += ./ginput/XPT2046
114+
COMPONENT_SRCDIRS += ./ginput/touch/XPT2046
115+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/touch/XPT2046
93116
endif
94117

95118
ifdef CONFIG_LVGL_DRIVER_TOUCH_FT5X06
96-
COMPONENT_SRCDIRS += ./ginput/FT5X06
97-
COMPONENT_ADD_INCLUDEDIRS += ./ginput/FT5X06
119+
COMPONENT_SRCDIRS += ./ginput/touch/FT5X06
120+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/touch/FT5X06
98121
endif
99122

100123
endif
124+
125+
#Toggle driver
126+
ifdef CONFIG_LVGL_DRIVER_TOGGLE_ENABLE
127+
128+
ifdef CONFIG_LVGL_DRIVER_TOGGLE_BUTTON
129+
COMPONENT_SRCDIRS += ./ginput/toggle/button
130+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/toggle/button
131+
endif
132+
133+
ifdef CONFIG_LVGL_DRIVER_TOGGLE_TOUCHPAD
134+
COMPONENT_SRCDIRS += ./ginput/toggle/touchpad
135+
COMPONENT_ADD_INCLUDEDIRS += ./ginput/toggle/touchpad
136+
endif
137+
138+
endif
101139

102140
endif
103141

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* This file is subject to the terms of the GFX License. If a copy of
3+
* the license was not distributed with this file, you can obtain one at:
4+
*
5+
* http://ugfx.org/license.html
6+
*/
7+
8+
#ifndef GAUDIO_PLAY_BOARD_H
9+
#define GAUDIO_PLAY_BOARD_H
10+
11+
static dac_audio_handle_t dac = NULL;
12+
13+
static bool gaudio_play_dac_audio_setup(uint32_t frequency, ArrayDataFormat format)
14+
{
15+
dac = iot_dac_audio_create(0, frequency, 16, I2S_DAC_CHANNEL_RIGHT_EN, 1024, true);
16+
/* Return FALSE if any parameter invalid */
17+
return true;
18+
}
19+
20+
static bool gaudio_play_dac_audio_play(const uint8_t *data, int length, TickType_t ticks_to_wait)
21+
{
22+
if (iot_dac_audio_play(dac, data, length, ticks_to_wait) == 0) {
23+
return true;
24+
} else {
25+
return false;
26+
}
27+
}
28+
29+
static void gaudio_play_dac_audio_start(void)
30+
{
31+
/* Start the DAC Audio */
32+
}
33+
34+
static void gaudio_play_dac_audio_stop(void)
35+
{
36+
/* Stop the DAC Audio */
37+
}
38+
39+
#endif /* GAUDIO_PLAY_BOARD_H */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* This file is subject to the terms of the GFX License. If a copy of
3+
* the license was not distributed with this file, you can obtain one at:
4+
*
5+
* http://ugfx.org/license.html
6+
*/
7+
8+
#ifndef GAUDIO_PLAY_CONFIG_H
9+
#define GAUDIO_PLAY_CONFIG_H
10+
11+
#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY
12+
13+
/*===========================================================================*/
14+
/* Driver hardware support. */
15+
/*===========================================================================*/
16+
17+
/* These may need to change for your hardware. */
18+
#define GAUDIO_PLAY_MAX_SAMPLE_FREQUENCY 22000
19+
#define GAUDIO_PLAY_NUM_FORMATS 2
20+
#define GAUDIO_PLAY_FORMAT1 ARRAY_DATA_8BITUNSIGNED
21+
#define GAUDIO_PLAY_FORMAT2 ARRAY_DATA_16BITUNSIGNED
22+
#define GAUDIO_PLAY_NUM_CHANNELS 1
23+
#define GAUDIO_PLAY_CHANNEL0_IS_STEREO GFXOFF
24+
#define GAUDIO_PLAY_MONO 0
25+
26+
#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */
27+
28+
#endif /* GAUDIO_PLAY_CONFIG_H */

0 commit comments

Comments
 (0)