From fd47bd935ec1b027520af45a3892a36bad28b7f8 Mon Sep 17 00:00:00 2001 From: frhun <28605587+frhun@users.noreply.github.com> Date: Sat, 21 Mar 2020 17:57:10 +0100 Subject: [PATCH] Add TTGO T-Display Adds the TTGO T-Display to the Kconfig system. Changes taken from: https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/8 --- components/tft/Kconfig | 3 +++ components/tft/tftspi.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/components/tft/Kconfig b/components/tft/Kconfig index a76d2e3..cdea9bd 100644 --- a/components/tft/Kconfig +++ b/components/tft/Kconfig @@ -7,6 +7,7 @@ config TFT_PREDEFINED_DISPLAY_TYPE default 2 if TFT_PREDEFINED_DISPLAY_TYPE2 default 3 if TFT_PREDEFINED_DISPLAY_TYPE3 default 4 if TFT_PREDEFINED_DISPLAY_TYPE4 + default 5 if TFT_PREDEFINED_DISPLAY_TYPE5 choice prompt "Select predefined display configuration" @@ -24,6 +25,8 @@ config TFT_PREDEFINED_DISPLAY_TYPE bool "Adafruit TFT Feather Display" config TFT_PREDEFINED_DISPLAY_TYPE3 bool "M5Stack TFT Display" + config TFT_PREDEFINED_DISPLAY_TYPE5 + bool "TTGO T-DISPLAY (ST7789V)" endchoice if TFT_PREDEFINED_DISPLAY_TYPE0 diff --git a/components/tft/tftspi.h b/components/tft/tftspi.h index e205b67..bbdbd81 100644 --- a/components/tft/tftspi.h +++ b/components/tft/tftspi.h @@ -35,6 +35,8 @@ #define DISP_TYPE_ST7735R 4 #define DISP_TYPE_ST7735B 5 + + #if CONFIG_TFT_PREDEFINED_DISPLAY_TYPE == 1 // ** Set the correct configuration for ESP-WROVER-KIT v3 @@ -152,6 +154,32 @@ #define PIN_BCKL_ON 0 // GPIO value for backlight ON #define PIN_BCKL_OFF 1 // GPIO value for backlight OFF // -------------------------------------------------------- +#elif CONFIG_TFT_PREDEFINED_DISPLAY_TYPE == 5 +//CONFIG FOR TTGO T-DISPLAY +#define DEFAULT_DISP_TYPE DISP_TYPE_ST7789V +#define DEFAULT_TFT_DISPLAY_WIDTH 240 +#define DEFAULT_TFT_DISPLAY_HEIGHT 320 +#define DISP_COLOR_BITS_24 0x66 +#define DEFAULT_GAMMA_CURVE 0 +#define DEFAULT_SPI_CLOCK 20000000 +#define TFT_INVERT_ROTATION 0 +#define TFT_INVERT_ROTATION1 1 +#define TFT_RGB_BGR 0x00 + +#define USE_TOUCH TOUCH_TYPE_NONE + +#define PIN_NUM_MISO 0 // SPI MISO +#define PIN_NUM_MOSI 19 // SPI MOSI +#define PIN_NUM_CLK 18 // SPI CLOCK pin +#define PIN_NUM_CS 5 // Display CS pin +#define PIN_NUM_DC 16 // Display command/data pin +#define PIN_NUM_TCS 0 // Touch screen CS pin + +#define PIN_NUM_RST 23 // GPIO used for RESET control +#define PIN_NUM_BCKL 4 // GPIO used for backlight control +#define PIN_BCKL_ON 1 // GPIO value for backlight ON +#define PIN_BCKL_OFF 0 // GPIO value for backlight OFF +//END TTGO T_DISPLAY #else