diff --git a/boards/m5stack/m5stack_cores3/Kconfig.defconfig b/boards/m5stack/m5stack_cores3/Kconfig.defconfig index fe718f3cf4afd..2b684e8ddd25a 100644 --- a/boards/m5stack/m5stack_cores3/Kconfig.defconfig +++ b/boards/m5stack/m5stack_cores3/Kconfig.defconfig @@ -5,7 +5,20 @@ if BOARD_M5STACK_CORES3_ESP32S3_PROCPU || BOARD_M5STACK_CORES3_ESP32S3_PROCPU_SE +config DISPLAY + default y + config INPUT default y +if MIPI_DBI + +config MIPI_DBI_INIT_PRIORITY + default 82 + +config MIPI_DBI_SPI_3WIRE + default y + +endif # MIPI_DBI + endif # BOARD_M5STACK_CORES3_ESP32S3_PROCPU || BOARD_M5STACK_CORES3_ESP32S3_PROCPU_SE diff --git a/boards/m5stack/m5stack_cores3/doc/index.rst b/boards/m5stack/m5stack_cores3/doc/index.rst index 2fdd042c38e67..74e8cfa92ce61 100644 --- a/boards/m5stack/m5stack_cores3/doc/index.rst +++ b/boards/m5stack/m5stack_cores3/doc/index.rst @@ -192,6 +192,27 @@ application. :board: m5stack_cores3/esp32s3/procpu/se :goals: flash +Display +======= + +The on-board ILI9342C LCD can be exercised with the LVGL sample application. + +.. tabs:: + + .. group-tab:: M5Stack CoreS3 + + .. zephyr-app-commands:: + :zephyr-app: samples/subsys/display/lvgl + :board: m5stack_cores3/esp32s3/procpu + :goals: build + + .. group-tab:: M5Stack CoreS3 SE + + .. zephyr-app-commands:: + :zephyr-app: samples/subsys/display/lvgl + :board: m5stack_cores3/esp32s3/procpu/se + :goals: build + The baud rate of 921600bps is set by default. If experiencing issues when flashing, try using different values by using ``--esp-baud-rate `` option during ``west flash`` (e.g. ``west flash --esp-baud-rate 115200``). diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi index 078f7afe7f255..16505578def11 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi @@ -6,39 +6,66 @@ #include #include +#include +#include #include "m5stack_cores3-pinctrl.dtsi" #include "m5stack_mbus_connectors.dtsi" #include "grove_connectors.dtsi" / { - chosen { - zephyr,sram = &sram1; - zephyr,console = &usb_serial; - zephyr,shell-uart = &usb_serial; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_partition; - zephyr,rtc = &bm8563_rtc; - zephyr,bt-hci = &esp32_bt_hci; - zephyr,touch = &ft6336_touch; - }; - - aliases { - uart-0 = &uart0; - uart-1 = &uart1; - uart-2 = &uart2; - i2c-0 = &i2c0; - i2c-1 = &i2c1; - watchdog0 = &wdt0; - rtc = &bm8563_rtc; - sdhc0 = &sd0; - led0 = &axp2101_led; - fuel-gauge0 = &fuel_gauge; - }; - - lvgl_pointer { - compatible = "zephyr,lvgl-pointer-input"; - input = <&ft6336_touch>; - }; + chosen { + zephyr,sram = &sram1; + zephyr,console = &usb_serial; + zephyr,shell-uart = &usb_serial; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,rtc = &bm8563_rtc; + zephyr,bt-hci = &esp32_bt_hci; + zephyr,touch = &ft6336_touch; + zephyr,display = &ili9342c; + }; + + aliases { + uart-0 = &uart0; + uart-1 = &uart1; + uart-2 = &uart2; + i2c-0 = &i2c0; + i2c-1 = &i2c1; + watchdog0 = &wdt0; + rtc = &bm8563_rtc; + sdhc0 = &sd0; + led0 = &axp2101_led; + fuel-gauge0 = &fuel_gauge; + display = &ili9342c; + }; + + lvgl_pointer { + compatible = "zephyr,lvgl-pointer-input"; + input = <&ft6336_touch>; + }; + + mipi_dbi { + compatible = "zephyr,mipi-dbi-spi"; + spi-dev = <&spi2>; + write-only; + reset-gpios = <&aw9523b_gpio 13 GPIO_ACTIVE_LOW>; + #address-cells = <1>; + #size-cells = <0>; + + ili9342c: ili9342c@0 { + compatible = "ilitek,ili9342c"; + reg = <0>; + mipi-max-frequency = <40000000>; + duplex = ; + mipi-mode = "MIPI_DBI_MODE_SPI_3WIRE"; + vin-supply = <&vcc_bl>; + pixel-format = ; + display-inversion; + width = <320>; + height = <240>; + rotation = <0>; + }; + }; }; &usb_serial { @@ -209,15 +236,15 @@ }; &spi2 { - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - pinctrl-0 = <&spim2_default>; - pinctrl-names = "default"; - clock-frequency = <20000000>; - cs-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>, /* LCD */ - <&gpio0 4 GPIO_ACTIVE_LOW>; /* TF-CARD */ + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; + dma-enabled; + clock-frequency = <40000000>; + cs-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>, /* LCD */ + <&gpio0 4 GPIO_ACTIVE_LOW>; /* TF-CARD */ sd0: sd@1 { compatible = "zephyr,sdhc-spi-slot";