diff --git a/lib/TFT_eSPI/User_Setup_Select.h b/lib/TFT_eSPI/User_Setup_Select.h index f61df74d..6dbd6884 100644 --- a/lib/TFT_eSPI/User_Setup_Select.h +++ b/lib/TFT_eSPI/User_Setup_Select.h @@ -172,6 +172,9 @@ #ifdef M5STICK_C_PLUS2 #include // Setup file for ESP32 configured for ST7735 128 x 128 animated eyes #endif +#ifdef ADAFRUIT_FEATHER_ESP32S3_TFT +#include // For the Adafruit Feather ESP32-S3 TFT with ST7789 240 x 135 TFT +#endif //#include // Setup file for Bw16-based boards with ST7735 160 x 80 TFT //#include // Setup file for Waveshare ESP32-S3-Touch-LCD-1.28 board with GC9A01 240*240 TFT diff --git a/lib/TFT_eSPI/User_Setups/Setup213_Adafruit_Feather_ESP32S3_TFT.h b/lib/TFT_eSPI/User_Setups/Setup213_Adafruit_Feather_ESP32S3_TFT.h new file mode 100644 index 00000000..2465cd6d --- /dev/null +++ b/lib/TFT_eSPI/User_Setups/Setup213_Adafruit_Feather_ESP32S3_TFT.h @@ -0,0 +1,51 @@ +// Setup for the ADAFRUIT FEATHER ESP32S3 TFT +#define USER_SETUP_ID 213 + +// See SetupX_Template.h for all options available + +#define ST7789_DRIVER +// #define TFT_SDA_READ // Display has a bidirectional SDA pin + +#define TFT_WIDTH 135 +#define TFT_HEIGHT 240 + +#define CGRAM_OFFSET // Library will add offsets required + +/* TFT Display +On the front of the board is a color 1.14" IPS TFT with 240x135 pixels. +It's a bright and colorful display with ST7789 chipset that can be viewed at any angle. + +There is a power pin that must be pulled high for the display to work. +This is done automatically by CircuitPython and Arduino. +The pin is available in CircuitPython and in Arduino as TFT_I2C_POWER or 21. + +If you run into I2C or TFT power issues on Arduino, ensure you are using the latest Espressif board support package. +If you are still having issues, you may need to manually pull the pin HIGH in your code. +*/ +// #define TFT_MISO 37 +#define TFT_MISO -1 +#define TFT_MOSI 35 +#define TFT_SCLK 36 +#define TFT_CS 7 +#define TFT_DC 39 +#define TFT_RST 40 + +#define TFT_BL 45 // Display backlight control pin + +#define TFT_BACKLIGHT_ON HIGH // HIGH or LOW are options + +#define LOAD_GLCD +#define LOAD_FONT2 +#define LOAD_FONT4 +#define LOAD_FONT6 +#define LOAD_FONT7 +#define LOAD_FONT8 +#define LOAD_GFXFF + +#define SMOOTH_FONT + +//#define SPI_FREQUENCY 27000000 + #define SPI_FREQUENCY 40000000 + + +#define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V diff --git a/platformio.ini b/platformio.ini index 8f8b9f24..0264eb71 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1166,5 +1166,28 @@ lib_ignore = SPI HANSOLOminerv2 - - +[env:Adafruit_Feather_ESP32S3_TFT] +platform = espressif32@6.6.0 +board = adafruit_feather_esp32s3_tft +framework = arduino +monitor_speed = 115200 +upload_speed = 921600 +board_build.partitions = huge_app.csv +build_flags = + -D ARDUINO_USB_MODE=1 + -D ARDUINO_USB_CDC_ON_BOOT=1 + -D ADAFRUIT_FEATHER_ESP32S3_TFT + ; -D ESP32RGB=1 + ; -D RGB_LED_PIN=33 + ;-D DEBUG_MINING=1 +lib_deps = + https://github.com/takkaO/OpenFontRender#v1.2 + bblanchon/ArduinoJson@^6.21.5 + https://github.com/tzapu/WiFiManager.git#v2.0.17 + mathertel/OneButton@^2.5.0 + arduino-libraries/NTPClient@^3.2.1 +lib_ignore = + SD + SD_MMC + rm67162 + HANSOLOminerv2 diff --git a/src/drivers/devices/adafruit_feather_esp32s3_tft.h b/src/drivers/devices/adafruit_feather_esp32s3_tft.h new file mode 100644 index 00000000..d0d0ed25 --- /dev/null +++ b/src/drivers/devices/adafruit_feather_esp32s3_tft.h @@ -0,0 +1,32 @@ +#ifndef _ADAFRUIT_FEATHER_ESP32S3_TFT_H +#define _ADAFRUIT_FEATHER_ESP32S3_TFT_H + +#define PIN_BUTTON_1 0 + +/* Red LED +This little red LED, labeled #13 on the board, +is on or blinks during certain operations (such as pulsing when in the bootloader), +and is controllable in code. It is available in CircuitPython as board.LED, +and in Arduino as LED_BUILTIN or 13. +*/ +// #define LED_PIN 13 + +#define V1_DISPLAY + +#define PIN_ENABLE5V 21 + +/* NeoPixel LED +This addressable RGB NeoPixel LED, labeled Neo on the board, +works both as a status LED (in CircuitPython and the bootloader), +and can be controlled with code. It is available in CircuitPython as board.NEOPIXEL, +and in Arduino as PIN_NEOPIXEL or 33 +*/ +// #define RGB_LED_PIN 33 +/* +There is a NeoPixel power pin that needs to be pulled high for the NeoPixel to work. +This is done automatically by CircuitPython and Arduino. +It is available in CircuitPython and Arduino as NEOPIXEL_POWER or 34 +*/ +// #define RGB_PWR_PIN 34 + +#endif \ No newline at end of file diff --git a/src/drivers/devices/device.h b/src/drivers/devices/device.h index 49ec045f..f96b4869 100644 --- a/src/drivers/devices/device.h +++ b/src/drivers/devices/device.h @@ -53,6 +53,8 @@ #include "lilygoT_HMI.h" #elif defined(SPOTPEAR) #include "spotpearKeychain.h" +#elif defined(ADAFRUIT_FEATHER_ESP32S3_TFT) +#include "adafruit_feather_esp32s3_tft.h" #else #error "No device defined"