From 4ba7c7602833cb9c8337aa45702ece9de2c0ec8a Mon Sep 17 00:00:00 2001 From: Rop Gonggrijp Date: Wed, 28 Apr 2021 11:43:40 +0200 Subject: [PATCH] Added support for M5Core2 screen (CONFIG_LV_PREDEFINED_DISPLAY_M5CORE2) Update README.md --- README.md | 1 + lvgl_tft/Kconfig | 12 ++++++++++++ lvgl_tft/ili9341.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 6aeec91..7ee9a6c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ and sets the gpio numbers for the interface. |---------------------------|-----------------------|-----------|-----------|-----------| | ESP Wrover Kit v4.1 | ILI9341 | SPI | 240 | 320 | | M5Stack | ILI9341 | SPI | 240 | 320 | +| M5Core2 | ILI9341 | SPI | 240 | 320 | | M5Stick | SH1107 | SPI | - | - | | M5StickC | ST7735S | SPI | 80 | 160 | | Adafruit 3.5 Featherwing | HX8357 | SPI | 480 | 320 | diff --git a/lvgl_tft/Kconfig b/lvgl_tft/Kconfig index 01bb4ba..47be8d1 100644 --- a/lvgl_tft/Kconfig +++ b/lvgl_tft/Kconfig @@ -21,6 +21,10 @@ menu "LVGL TFT Display controller" bool "M5Stack" select LV_TFT_DISPLAY_CONTROLLER_ILI9341 select LV_TFT_DISPLAY_PROTOCOL_SPI + config LV_PREDEFINED_DISPLAY_M5CORE2 + bool "M5Core2" + select LV_TFT_DISPLAY_CONTROLLER_ILI9341 + select LV_TFT_DISPLAY_PROTOCOL_SPI config LV_PREDEFINED_DISPLAY_M5STICK bool "M5Stick" select LV_TFT_DISPLAY_CONTROLLER_SH1107 @@ -763,6 +767,7 @@ menu "LVGL TFT Display controller" default 23 if LV_PREDEFINED_DISPLAY_WROVER4 default 23 if LV_PREDEFINED_DISPLAY_ATAG default 23 if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICK + default 23 if LV_PREDEFINED_DISPLAY_M5CORE2 default 15 if LV_PREDEFINED_DISPLAY_M5STICKC default 18 if LV_PREDEFINED_DISPLAY_ADA_FEATHERWING default 23 if LV_PREDEFINED_PINS_TKOALA @@ -777,6 +782,7 @@ menu "LVGL TFT Display controller" config LV_DISPLAY_USE_SPI_MISO bool "GPIO for MISO (Master In Slave Out)" if LV_TFT_DISPLAY_PROTOCOL_SPI default y if LV_PREDEFINED_PINS_TKOALA + default y if LV_PREDEFINED_DISPLAY_M5CORE2 help Enable the MISO signal to control the display. You can disable it when the display does not need MISO signal to be controlled. @@ -788,6 +794,7 @@ menu "LVGL TFT Display controller" range 0 43 if IDF_TARGET_ESP32S2 default 19 if LV_PREDEFINED_PINS_TKOALA + default 38 if LV_PREDEFINED_DISPLAY_M5CORE2 default 0 help @@ -830,6 +837,7 @@ menu "LVGL TFT Display controller" range 0 43 if IDF_TARGET_ESP32S2 default 18 if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICK + default 18 if LV_PREDEFINED_DISPLAY_M5CORE2 default 13 if LV_PREDEFINED_DISPLAY_M5STICKC default 18 if LV_PREDEFINED_DISPLAY_ATAG default 19 if LV_PREDEFINED_DISPLAY_WROVER4 @@ -858,6 +866,7 @@ menu "LVGL TFT Display controller" default 5 if LV_PREDEFINED_PINS_38V1 default 14 if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICK + default 5 if LV_PREDEFINED_DISPLAY_M5CORE2 default 5 if LV_PREDEFINED_DISPLAY_M5STICKC default 22 if LV_PREDEFINED_DISPLAY_WROVER4 default 15 if LV_PREDEFINED_DISPLAY_ADA_FEATHERWING @@ -887,6 +896,7 @@ menu "LVGL TFT Display controller" default 19 if LV_PREDEFINED_PINS_38V1 default 17 if LV_PREDEFINED_PINS_38V4 default 27 if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICK + default 15 if LV_PREDEFINED_DISPLAY_M5CORE2 default 23 if LV_PREDEFINED_DISPLAY_M5STICKC default 21 if LV_PREDEFINED_DISPLAY_WROVER4 default 21 if LV_PREDEFINED_DISPLAY_WT32_SC01 @@ -902,6 +912,7 @@ menu "LVGL TFT Display controller" config LV_DISP_USE_RST bool "Use a GPIO for resetting the display" if LV_TFT_DISPLAY_PROTOCOL_SPI + default n if LV_PREDEFINED_DISPLAY_M5CORE2 default y help Enable display reset control. Set this if the reset pin of the @@ -950,6 +961,7 @@ menu "LVGL TFT Display controller" ( LV_PREDEFINED_DISPLAY_NONE && ! ( LV_TFT_DISPLAY_CONTROLLER_SH1107 || LV_TFT_DISPLAY_CONTROLLER_SSD1306 ) ) \ || LV_PREDEFINED_DISPLAY_RPI_MPI3501 default y if LV_PREDEFINED_DISPLAY_M5STACK + default n if LV_PREDEFINED_DISPLAY_M5CORE2 default y if LV_PREDEFINED_DISPLAY_WROVER4 default y if LV_PREDEFINED_DISPLAY_ERTFT0356 default y if LV_PREDEFINED_DISPLAY_TTGO diff --git a/lvgl_tft/ili9341.c b/lvgl_tft/ili9341.c index 41bd199..23aba09 100644 --- a/lvgl_tft/ili9341.c +++ b/lvgl_tft/ili9341.c @@ -233,6 +233,8 @@ static void ili9341_set_orientation(uint8_t orientation) #if defined CONFIG_LV_PREDEFINED_DISPLAY_M5STACK uint8_t data[] = {0x68, 0x68, 0x08, 0x08}; +#elif defined (CONFIG_LV_PREDEFINED_DISPLAY_M5CORE2) + uint8_t data[] = {0x08, 0x88, 0x28, 0xE8}; #elif defined (CONFIG_LV_PREDEFINED_DISPLAY_WROVER4) uint8_t data[] = {0x6C, 0xEC, 0xCC, 0x4C}; #elif defined (CONFIG_LV_PREDEFINED_DISPLAY_NONE)