Skip to content

Commit

Permalink
Merge pull request #11 from gameofyou/master
Browse files Browse the repository at this point in the history
Adding support for the TTGO T-WRISTBAND support
  • Loading branch information
jeremyjh committed Jun 30, 2020
2 parents 3a841fa + 8016437 commit 35be976
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/tft/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
33 changes: 33 additions & 0 deletions components/tft/tftspi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 35be976

Please sign in to comment.