ESP32 with ST7796S 4.0inch TFT SPI

lost73:
Thanks a lot, everything is working now, using GitHub - Bodmer/TFT_eSPI: Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips

just a small issue with touch function, 2048 AND 4095 Z value appearing randomly (certainly hardware issue), i just add "if (z1 == 4095) return false" same for 2048 in touch.ccp / validTouch function.

For info lcdwiki_touch is not working with esp32, but is useless regarding the great Bodmer's work !

May I know how you made the ST7796s work with ESP32, I also having white screen.

below is the link of my 4" TFT with driver ST7796s detail
http://www.lcdwiki.com/4.0inch_SPI_Module_ST7796

the same display did work on my Arduino nano & mega but just can't work on ESP32 board.

my read user_setup as below

TFT_eSPI ver = 2.2.8
Processor    = ESP32
Frequency    = 240MHz
Transactions = Yes
Interface    = SPI
Display driver = 7796
Display width  = 320
Display height = 480
MOSI    = GPIO 23
MISO    = GPIO 19
SCK     = GPIO 13
TFT_CS   = GPIO 2
TFT_DC   = GPIO 12
TFT_RST  = GPIO 4
Font GLCD   loaded
Font 2      loaded
Font 4      loaded
Font 6      loaded
Font 7      loaded
Font 8      loaded
Smooth font enabled

Display SPI frequency = 80.00