From 801643712291e3d380ca14c1d2cae60bc43949c2 Mon Sep 17 00:00:00 2001 From: James Hawtin Date: Tue, 30 Jun 2020 17:26:47 +0100 Subject: [PATCH] Adding support for the TTGO T-WRISTBAND support --- components/tft/Kconfig | 5 +++++ components/tft/tftspi.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/components/tft/Kconfig b/components/tft/Kconfig index cdea9bd..78ba419 100644 --- a/components/tft/Kconfig +++ b/components/tft/Kconfig @@ -8,6 +8,8 @@ config TFT_PREDEFINED_DISPLAY_TYPE default 3 if TFT_PREDEFINED_DISPLAY_TYPE3 default 4 if TFT_PREDEFINED_DISPLAY_TYPE4 default 5 if TFT_PREDEFINED_DISPLAY_TYPE5 + default 6 if TFT_PREDEFINED_DISPLAY_TYPE6 + choice prompt "Select predefined display configuration" @@ -27,6 +29,9 @@ config TFT_PREDEFINED_DISPLAY_TYPE bool "M5Stack TFT Display" config TFT_PREDEFINED_DISPLAY_TYPE5 bool "TTGO T-DISPLAY (ST7789V)" + config TFT_PREDEFINED_DISPLAY_TYPE6 + bool "TTGO T-WRISTBAND (ST7735)" + endchoice if TFT_PREDEFINED_DISPLAY_TYPE0 diff --git a/components/tft/tftspi.h b/components/tft/tftspi.h index fb689b0..282e3f9 100644 --- a/components/tft/tftspi.h +++ b/components/tft/tftspi.h @@ -188,6 +188,39 @@ #define PIN_BCKL_OFF 0 // GPIO value for backlight OFF //END TTGO T_DISPLAY +#elif CONFIG_TFT_PREDEFINED_DISPLAY_TYPE == 6 +//CONFIG FOR TTGO T-WRISTBAND +#define DEFAULT_DISP_TYPE DISP_TYPE_ST7735R +#define DEFAULT_TFT_DISPLAY_WIDTH 80 +#define DEFAULT_TFT_DISPLAY_HEIGHT 160 + +//Need to be defined together so they can be swapped for x;y when rotating +#define TFT_STATIC_WIDTH_OFFSET 26 +#define TFT_STATIC_HEIGHT_OFFSET 1 + +#define DISP_COLOR_BITS_24 0x66 +#define DEFAULT_GAMMA_CURVE 0 +#define DEFAULT_SPI_CLOCK 27000000 +#define TFT_INVERT_ROTATION 0 +#define TFT_INVERT_ROTATION1 1 +#define TFT_RGB_BGR 0x00 +//To be used by user application for initialization +#define TFT_START_COLORS_INVERTED + +#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 23 // Display command/data pin +#define PIN_NUM_TCS 0 // Touch screen CS pin + +#define PIN_NUM_RST 26 // GPIO used for RESET control +#define PIN_NUM_BCKL 27 // 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 // Configuration for other boards, set the correct values for the display used