Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips
Go to file
Bodmer 898718c872 Update ReadMe
Add 8 bit colour depth.
2017-11-22 00:59:32 +00:00
examples Version update, minor tweaks and typos 2017-11-22 00:53:09 +00:00
Fonts First draft release 2017-02-22 03:07:17 +00:00
TFT_Drivers fix for ST7735_REDTAB 2017-09-11 03:32:34 -04:00
Tools Update RPi screen connection image 2017-10-20 22:13:47 +01:00
User_Setups Update touch handler to work with ESP32 2017-11-04 19:11:50 +00:00
.gitattributes Revert "Clear out attributes" 2017-05-23 02:02:35 +01:00
.gitignore Revert "Clear out attributes" 2017-05-23 02:02:35 +01:00
Keywords.txt Add support for 8 bit color sprites (needs less RAM) 2017-11-21 22:57:11 +00:00
library.json Version update, minor tweaks and typos 2017-11-22 00:53:09 +00:00
library.properties Version update, minor tweaks and typos 2017-11-22 00:53:09 +00:00
README.md Update ReadMe 2017-11-22 00:59:32 +00:00
README.txt Raise version number, update ReadMe 2017-07-15 19:29:13 +01:00
TFT_eSPI.cpp Version update, minor tweaks and typos 2017-11-22 00:53:09 +00:00
TFT_eSPI.h Add support for 8 bit color sprites (needs less RAM) 2017-11-21 22:57:11 +00:00
User_Setup_Select.h Add sprite class 2017-11-15 20:26:22 +00:00
User_Setup.h XPT2046 SPI frequency can be always defined 2017-10-23 15:11:57 +01:00

TFT_eSPI

An Arduino IDE compatible graphics and fonts library for ESP8266 and ESP32 processors with a driver for ILI9341, ILI9163, ST7735 and S6D02A1 based TFT displays that support SPI.

The library also supports TFT displays designed for the Raspberry Pi that are based on a ILI9486 driver chip with a 480 x 320 pixel screen. This display must be of the Waveshare design and use a 16 bit serial interface based on the 74HC04, 74HC4040 and 2 x 74HC4094 logic chips. A modification to these displays is possible (see mod image in Tools folder) to make many graphics functions much faster (e.g. 23ms to clear the screen, 1.2ms to draw a 72 pixel high numeral).

A new "Sprite" class has been added, this enables flicker free updates of complex graphics. Exmaples are in the "examples/Sprite" folder. A Sprite is notionally an invisible graphics screen that is kept in the processors RAM. Graphics can be drawn into the Sprite just as it can be drawn directly to the screen. Once the Sprite is completed it can be plotted onto the screen in any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. On an ESP8266 the largest 16 bit colour Sprite that can be created is about 160x128 pixels, this consumes 40Kbytes of RAM. On an ESP32 the workspace RAM is more limited than the datsheet implies so the Sprite is limited to about 200x200 pixels (~80Kbytes).

The RAM needed for a 16 bit colour depth Sprite is (2 x width x height) bytes, for a Sprite with 8 bit colour depth the RAM needed is (width x height) bytes . Drawing graphics into a sprite is very fast, for those familiar with the Adafruit "graphicstest" example, this whole test completes in less than 27ms in a 160x128 sprite.

The XPT2046 touch screen controller is supported. The SPI bus for the touch controller is shared with the TFT and only an additional chip select line is needed.

The Button class from Adafruit_GFX is incorporated, with the enhancement that the button labels can be in any font.

The library supports SPI overlap on the ESP8266 so the TFT screen can share MOSI, MISO and SCLK pins with the program FLASH.

The library contains proportional fonts, different sizes can be enabled/disabled at compile time to optimise the use of FLASH memory. The library has been tested with the NodeMCU (ESP8266 based) and an ESP32 demo board.

The library is based on the Adafruit GFX and Adafruit driver libraries and the aim is to retain compatibility. Significant additions have been made to the library to boost the speed for ESP8266/ESP32 processors (it is typically 3 to 10 times faster) and to add new features. The new graphics functions include different size proportional fonts and formatting features. There are a significant number of example sketches to demonstrate the different features.

Configuration of the library font selections, pins used to interface with the TFT and other features is made by editting the User_Setup.h file in the library folder. Fonts and features can easily be disabled by commenting out lines.