Skip to content

Commit 5029813

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

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
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: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
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"
@@ -20,6 +22,7 @@
2022
zephyr,rtc = &bm8563_rtc;
2123
zephyr,bt-hci = &esp32_bt_hci;
2224
zephyr,touch = &ft6336_touch;
25+
zephyr,display = &ili9342c;
2326
};
2427

2528
aliases {
@@ -33,12 +36,36 @@
3336
sdhc0 = &sd0;
3437
led0 = &axp2101_led;
3538
fuel-gauge0 = &fuel_gauge;
39+
display = &ili9342c;
3640
};
3741

3842
lvgl_pointer {
3943
compatible = "zephyr,lvgl-pointer-input";
4044
input = <&ft6336_touch>;
4145
};
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 {
@@ -212,10 +239,10 @@
212239
status = "okay";
213240
#address-cells = <1>;
214241
#size-cells = <0>;
215-
status = "okay";
216242
pinctrl-0 = <&spim2_default>;
217243
pinctrl-names = "default";
218-
clock-frequency = <20000000>;
244+
clock-frequency = <40000000>;
245+
dma-enabled;
219246
cs-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>, /* LCD */
220247
<&gpio0 4 GPIO_ACTIVE_LOW>; /* TF-CARD */
221248

0 commit comments

Comments
 (0)