I have updated the TFT_eSPI library to support this fast 320x420 4" ST7796 based RPi display. Typically this is available for $15 or less with or without XPT2046 based touch screen.
This display is fitted with a bespoke SPI serial to parallel converter that is much better than many RPi displays on the market. The SPI transmit data can be clocked into the display reliably at up to 125MHz which is the data sheet limit for parallel data with the ST7796. The chip converts the SPI data to 16 bit parallel and writes it into the display at up to 30Mbytes/sec. This neatly gets around the speed limits of typical SPI interfaces on these screens and permits 50fps whole screen update rate.
The TFT_eSPI library can be used with the ESP32 SPI with an 80MHz clock (maximum for ESP32). For a 320 x 480 display this gives good performance for a SPI interface:
ESP32 RPi ST7796 80MHZ SPI
Benchmark, Time (microseconds)
Screen fill, 180556 (clear screen = 36 ms = ~28 fps)
Text, 13699
Lines, 166066
Horiz/Vert Lines, 16290
Rectangles (outline), 9376
Rectangles (filled), 440312
Circles (filled), 102275
Circles (outline), 101998
Triangles (outline), 34580
Triangles (filled), 164103
Rounded rects (outline), 43216
Rounded rects (filled), 490934
Total = 1.7634s
Although the ESP8266 can clock the SPI at 80MHz, it does not have the signal drive strength to maintain the correct clock phase relationship with the data. This limits the ESP8266 to 40MHz SPI clock with this display:
ESP8266 RPi ST7796 40MHZ SPI
Benchmark, Time (microseconds)
Screen fill, 317434 (clear screen = 63 ms = ~18 fps)
Text, 20888
Lines, 270627
Horiz/Vert Lines, 27145
Rectangles (outline), 16004
Rectangles (filled), 768065
Circles (filled), 173822
Circles (outline), 163897
Triangles (outline), 55797
Triangles (filled), 293139
Rounded rects (outline), 70044
Rounded rects (filled), 863555
Total = 3.0404s
Wiring is as per image here.