Skip to content

Commit a57b085

Browse files
committed
boards: m5stack_cores3: add LCD display support
1 parent 786c9fb commit a57b085

File tree

3 files changed

+95
-37
lines changed

3 files changed

+95
-37
lines changed

boards/m5stack/m5stack_cores3/Kconfig.defconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55

66
if BOARD_M5STACK_CORES3_ESP32S3_PROCPU || BOARD_M5STACK_CORES3_ESP32S3_PROCPU_SE
77

8+
config DISPLAY
9+
default y
10+
811
config INPUT
912
default y
1013

14+
if MIPI_DBI
15+
16+
config MIPI_DBI_INIT_PRIORITY
17+
default 82
18+
19+
endif # MIPI_DBI
20+
1121
endif # BOARD_M5STACK_CORES3_ESP32S3_PROCPU || BOARD_M5STACK_CORES3_ESP32S3_PROCPU_SE

boards/m5stack/m5stack_cores3/doc/index.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,27 @@ application.
192192
:board: m5stack_cores3/esp32s3/procpu/se
193193
:goals: flash
194194

195+
Display
196+
=======
197+
198+
The on-board ILI9342C LCD can be exercised with the LVGL sample application.
199+
200+
.. tabs::
201+
202+
.. group-tab:: M5Stack CoreS3
203+
204+
.. zephyr-app-commands::
205+
:zephyr-app: samples/subsys/display/lvgl
206+
:board: m5stack_cores3/esp32s3/procpu
207+
:goals: build
208+
209+
.. group-tab:: M5Stack CoreS3 SE
210+
211+
.. zephyr-app-commands::
212+
:zephyr-app: samples/subsys/display/lvgl
213+
:board: m5stack_cores3/esp32s3/procpu/se
214+
:goals: build
215+
195216
The baud rate of 921600bps is set by default. If experiencing issues when flashing,
196217
try using different values by using ``--esp-baud-rate <BAUD>`` option during
197218
``west flash`` (e.g. ``west flash --esp-baud-rate 115200``).

boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi

Lines changed: 64 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,66 @@
66

77
#include <espressif/esp32s3/esp32s3_wroom_n16r8.dtsi>
88
#include <espressif/partitions_0x0_amp.dtsi>
9+
#include <dt-bindings/spi/spi.h>
10+
#include <zephyr/dt-bindings/display/ili9xxx.h>
911
#include "m5stack_cores3-pinctrl.dtsi"
1012
#include "m5stack_mbus_connectors.dtsi"
1113
#include "grove_connectors.dtsi"
1214

1315
/ {
14-
chosen {
15-
zephyr,sram = &sram1;
16-
zephyr,console = &usb_serial;
17-
zephyr,shell-uart = &usb_serial;
18-
zephyr,flash = &flash0;
19-
zephyr,code-partition = &slot0_partition;
20-
zephyr,rtc = &bm8563_rtc;
21-
zephyr,bt-hci = &esp32_bt_hci;
22-
zephyr,touch = &ft6336_touch;
23-
};
24-
25-
aliases {
26-
uart-0 = &uart0;
27-
uart-1 = &uart1;
28-
uart-2 = &uart2;
29-
i2c-0 = &i2c0;
30-
i2c-1 = &i2c1;
31-
watchdog0 = &wdt0;
32-
rtc = &bm8563_rtc;
33-
sdhc0 = &sd0;
34-
led0 = &axp2101_led;
35-
fuel-gauge0 = &fuel_gauge;
36-
};
37-
38-
lvgl_pointer {
39-
compatible = "zephyr,lvgl-pointer-input";
40-
input = <&ft6336_touch>;
41-
};
16+
chosen {
17+
zephyr,sram = &sram1;
18+
zephyr,console = &usb_serial;
19+
zephyr,shell-uart = &usb_serial;
20+
zephyr,flash = &flash0;
21+
zephyr,code-partition = &slot0_partition;
22+
zephyr,rtc = &bm8563_rtc;
23+
zephyr,bt-hci = &esp32_bt_hci;
24+
zephyr,touch = &ft6336_touch;
25+
zephyr,display = &ili9342c;
26+
};
27+
28+
aliases {
29+
uart-0 = &uart0;
30+
uart-1 = &uart1;
31+
uart-2 = &uart2;
32+
i2c-0 = &i2c0;
33+
i2c-1 = &i2c1;
34+
watchdog0 = &wdt0;
35+
rtc = &bm8563_rtc;
36+
sdhc0 = &sd0;
37+
led0 = &axp2101_led;
38+
fuel-gauge0 = &fuel_gauge;
39+
display = &ili9342c;
40+
};
41+
42+
lvgl_pointer {
43+
compatible = "zephyr,lvgl-pointer-input";
44+
input = <&ft6336_touch>;
45+
};
46+
47+
mipi_dbi {
48+
compatible = "zephyr,mipi-dbi-spi";
49+
spi-dev = <&spi2>;
50+
duplex = <SPI_HALF_DUPLEX>;
51+
mipi-mode = "MIPI_DBI_MODE_SPI_3WIRE";
52+
write-only;
53+
reset-gpios = <&aw9523b_gpio 13 GPIO_ACTIVE_LOW>;
54+
#address-cells = <1>;
55+
#size-cells = <0>;
56+
57+
ili9342c: ili9342c@0 {
58+
compatible = "ilitek,ili9342c";
59+
reg = <0>;
60+
mipi-max-frequency = <40000000>;
61+
vin-supply = <&vcc_bl>;
62+
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
63+
display-inversion;
64+
width = <320>;
65+
height = <240>;
66+
rotation = <0>;
67+
};
68+
};
4269
};
4370

4471
&usb_serial {
@@ -209,15 +236,15 @@
209236
};
210237

211238
&spi2 {
212-
status = "okay";
213-
#address-cells = <1>;
214-
#size-cells = <0>;
215-
status = "okay";
216-
pinctrl-0 = <&spim2_default>;
217-
pinctrl-names = "default";
218-
clock-frequency = <20000000>;
219-
cs-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>, /* LCD */
220-
<&gpio0 4 GPIO_ACTIVE_LOW>; /* TF-CARD */
239+
status = "okay";
240+
#address-cells = <1>;
241+
#size-cells = <0>;
242+
pinctrl-0 = <&spim2_default>;
243+
pinctrl-names = "default";
244+
dma-enabled;
245+
clock-frequency = <40000000>;
246+
cs-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>, /* LCD */
247+
<&gpio0 4 GPIO_ACTIVE_LOW>; /* TF-CARD */
221248

222249
sd0: sd@1 {
223250
compatible = "zephyr,sdhc-spi-slot";

0 commit comments

Comments
 (0)