Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for the TTGO T-WRISTBAND support #11

Merged
merged 1 commit into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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