Merge pull request #807 from shubham-vunet/driver-Approach2

Add Lilygo T-Panel v1.2 Pinmap and Drivers (WIP, Touchscreen not implemented)
This commit is contained in:
fvanroie 2024-10-02 19:47:32 +02:00 committed by GitHub
commit 3047420676
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 93 additions and 2 deletions

View File

@ -25,7 +25,23 @@ void ArduinoGfx::init(int w, int h)
{
LOG_TRACE(TAG_TFT, F(D_SERVICE_STARTING));
#if(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(LILYGO_T_RGB)
#if(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(LILYGO_T_PANEL)
Arduino_DataBus* bus = new Arduino_XL9535SWSPI(17 /* SDA */, 18 /* SCL */, -1 /* XL PWD */, 17 /* XL CS */,
15 /* XL SCK */, 16 /* XL MOSI */);
Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel(
-1 /* DE */, TFT_VSYNC /* VSYNC */, TFT_HSYNC /* HSYNC */, TFT_PCLK /* PCLK */,
TFT_B0 /* B0 */, TFT_B1 /* B1 */, TFT_B2 /* B2 */, TFT_B3 /* B3 */, TFT_B4 /* B4 */,
TFT_G0 /* G0 */, TFT_G1 /* G1 */, TFT_G2 /* G2 */, TFT_G3 /* G3 */, TFT_G4 /* G4 */, TFT_G5 /* G5 */,
TFT_R0 /* R0 */, TFT_R1 /* R1 */, TFT_R2 /* R2 */, TFT_R3 /* R3 */, TFT_R4 /* R4 */,
1 /* hsync_polarity */, 20 /* hsync_front_porch */, 2 /* hsync_pulse_width */, 0 /* hsync_back_porch */,
1 /* vsync_polarity */, 30 /* vsync_front_porch */, 8 /* vsync_pulse_width */, 1 /* vsync_back_porch */,
10 /* pclk_active_neg */, 6000000L /* prefer_speed */, false /* useBigEndian */,
0 /* de_idle_high*/, 0 /* pclk_idle_high */);
tft = new Arduino_RGB_Display(TFT_WIDTH /* width */, TFT_HEIGHT /* height */, rgbpanel, 0 /* rotation */, true /* auto_flush */,
bus, -1 /* RST */, st7701_sensecap_indicator_init_operations, sizeof(st7701_sensecap_indicator_init_operations));
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(LILYGO_T_RGB)
Wire.begin(8 /* SDA */, 48 /* SCL */, 800000L /* speed */);
Arduino_DataBus* bus = new Arduino_XL9535SWSPI(8 /* SDA */, 48 /* SCL */, 2 /* XL PWD */, 3 /* XL CS */,
5 /* XL SCK */, 4 /* XL MOSI */);

View File

@ -1311,7 +1311,7 @@ void webHandleGuiConfig(AsyncWebServerRequest* request)
httpMessage += getOption(-1, F("None"), bcklpin == -1);
#if defined(ARDUINO_ARCH_ESP32)
add_gpio_select_option(httpMessage, 5, bcklpin); // D8 on ESP32 for D1 mini 32
add_gpio_select_option(httpMessage, 12, bcklpin); // TFT_LED on the Liligo Pi
add_gpio_select_option(httpMessage, 12, bcklpin); // TFT_LED on the Lilygo Pi
add_gpio_select_option(httpMessage, 13, bcklpin); // TFT_LED on the D1 R32 + Waveshare
add_gpio_select_option(httpMessage, 15, bcklpin); // TFT_LED on the AZ Touch
add_gpio_select_option(httpMessage, 16, bcklpin); // D4 on ESP32 for D1 mini 32

View File

@ -0,0 +1,75 @@
;***************************************************;
; Lilygo T-Panel S3, 4-Inch Touch Screen ;
; - Custom esp32-s3 board ;
; - st7701s TFT ;
; - CST3240 touch controller (WIP) ;
; - IO Expansion: XL9535 ;
;***************************************************;
[lilygo-t-panel]
extends = arduino_esp32s3_v2
board = esp32-s3-devkitc-1
board_build.arduino.memory_type = qio_opi
build_flags =
-D HASP_MODEL="Lilygo T-Panel v1.2"
${arduino_esp32s3_v2.build_flags}
${esp32s3.ps_ram}
-DLILYGO_T_PANEL
-D LILYGO_T_PANEL=1
;-DARDUINO_USB_CDC_ON_BOOT
;-DUSE_USB_CDC_CONSOLE
;region -- ArduinoGFX build options ------------------------
-D HASP_USE_ARDUINOGFX=1
-D HASP_LV_USE_SW_ROTATE=1
-D ST7701_DRIVER=1
-D TFT_WIDTH=480
-D TFT_HEIGHT=480
; Bus Settings
-D TFT_HSYNC=39
-D TFT_VSYNC=40
-D TFT_PCLK=41
-D TFT_B0=1
-D TFT_B1=2
-D TFT_B2=3
-D TFT_B3=4
-D TFT_B4=5
-D TFT_G0=6
-D TFT_G1=7
-D TFT_G2=8
-D TFT_G3=9
-D TFT_G4=10
-D TFT_G5=11
-D TFT_R0=12
-D TFT_R1=13
-D TFT_R2=42
-D TFT_R3=46
-D TFT_R4=45
-D TFT_BCKL=14
; Touch Settings
-D TOUCH_WIDTH=480
-D TOUCH_HEIGHT=480
-D TOUCH_SDA=17
-D TOUCH_SCL=18
-D TOUCH_INT=21
-D TOUCH_RST=4
-D TOUCH_CS=-1
-D TOUCH_DRIVER=0x3240
; -D TOUCH_IRQ=
; -D I2C_TOUCH_FREQUENCY=
; -D I2C_TOUCH_ADDRESS=
; -D I2C_TOUCH_PORT=
;endregion
lib_deps =
${arduino_esp32s3_v2.lib_deps}
; moononournation/GFX Library for Arduino@1.4.0 ; Update needs modification of custom PCA class ; ${ft6336.lib_deps}
; ; git+https://github.com/admarschoonen/TouchLib.git
; moononournation/GFX Library for Arduino@1.4.0 ;
[env:lilygo-t-panel_16MB]
extends = lilygo-t-panel, flash_16mb
monitor_port = COM8
upload_port = COM8