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

Add support for Lilygo T-Deck. #3246

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions User_Setup_Select.h
Expand Up @@ -137,6 +137,7 @@
//#include <User_Setups/Setup211_LilyGo_T_QT_Pro_S3.h> // For the LilyGo T-QT Pro S3 based ESP32S3 with GC9A01 128 x 128 TFT
// #include <User_Setups/Setup212_LilyGo_T_PicoPro.h> // For the LilyGo T-PICO-Pro with ST7796 222 x 480 TFT
// #include <User_Setups/Setup213_LilyGo_T_Beam_Shield.h> // For the LilyGo T-BEAM V1.x with ST7796 222 x 480 TFT
// #include <User_Setups/Setup214_LilyGo_T_Deck.h> // For the LilyGo T-Deck ESP32S3 based device with ST7789 240 x 320 TFT

//#include <User_Setups/Setup250_ESP32_S3_Box_Lite.h> // For the ESP32 S3 Box Lite
//#include <User_Setups/Setup251_ESP32_S3_Box.h> // For the ESP32 S3 Box
Expand Down
45 changes: 45 additions & 0 deletions User_Setups/Setup214_LilyGo_T_Deck.h
@@ -0,0 +1,45 @@
// ST7789 240 x 320 display
//
// The board peripheral power control pin needs to be set to HIGH when using any of the tdeck peripherals, the
// backlight also needs turning on manually before you can run the TFT_eSPI examples. The following will need
// to be added inside the setup function.
//
// pinMode(TDECK_PERI_GPIO, OUTPUT);
// digitalWrite(TDECK_PERI_GPIO, HIGH);
// pinMode(TFT_BL, OUTPUT);
// digitalWrite(TFT_BL, HIGH);

#define USER_SETUP_ID 214

#define ST7789_DRIVER
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
#define CGRAM_OFFSET
#define TFT_RGB_ORDER TFT_BGR
#define TFT_INVERSION_ON

// Lilygo T-Deck setup
#define TFT_MISO 38
#define TFT_MOSI 41
#define TFT_SCLK 40
#define TFT_CS 12
#define TFT_DC 11
#define TFT_RST -1
#define TFT_BL 42
#define TDECK_PERI_GPIO 10


#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT


#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 20000000
#define SPI_TOUCH_FREQUENCY 2500000