TFT_eSPI
V2.5.43Features
-
Optimized drivers for ESP32, ESP8266, RP2040, and STM32 series processors.
-
Direct Memory Access (DMA) support for SPI displays on ESP32, RP2040, and STM32.
-
Sprite class for off-screen buffering and flicker-free updates in 1, 8, or 16-bit color depths.
-
Anti-aliased (smooth) font rendering from .vlw files or FLASH arrays with Unicode support.
-
Vector graphics functions for smooth arcs, circles, and rounded rectangles using optimized fixed-point math.
-
Support for 4-wire SPI, 8-bit parallel, and 16-bit parallel display interfaces.
-
RP2040 PIO integration to offload screen fills and manage high-speed SPI/parallel timing.
-
Unicode and UTF-8 string support for multi-language text rendering.
-
Built-in XPT2046 touch screen controller driver for SPI-based displays.
-
PNG image decoding and rendering capability requiring approximately 40KB of RAM.
-
Horizontal and vertical color gradient fills for rectangular areas.
-
Compatibility with Adafruit GFX and Adafruit driver library APIs for easy migration.
-
PSRAM support on ESP32 for large full-screen frame buffers.
-
SPI overlap mode for ESP8266 to share pins with program FLASH memory.
-
Support for over 20 display controllers including ILI9341, ST7789, and GC9A01.
-
Line-by-line and block-by-block smooth font rendering to minimize flicker during updates.
Architecture
TFT_eSPI is designed with a driver-abstraction layer that allows it to interface with a wide variety of display controllers while maintaining a consistent API. The architecture prioritizes performance by utilizing processor-specific optimizations such as Direct Memory Access (DMA) for SPI transfers and Programmable I/O (PIO) on the RP2040 to offload bus timing and block fills. This design ensures that the main CPU is released for other tasks while the hardware handles data transmission to the display.
A central configuration model is used where hardware-specific parameters—such as pins, clock speeds, and controller types—are defined in header files within the library rather than the application sketch. This approach keeps user code clean and portable across different hardware setups. The library also supports PSRAM on ESP32 devices, allowing for large, high-resolution frame buffers that would otherwise exceed internal RAM limits.
Core Components
- TFT_eSPI Core: The primary class handling low-level driver initialization and basic drawing primitives.
- TFT_eSprite: A RAM-based graphics canvas that acts as a frame buffer for flicker-free rendering and complex rotations.
- Font Engine: Supports both legacy bitmapped fonts and modern anti-aliased (smooth) fonts with Unicode and UTF-8 support.
- Driver Layer: Optimized low-level drivers for over 20 different display controllers (e.g., ILI9341, ST7789, GC9A01).
Use Cases
This library is ideal for:
- Industrial Dashboards: Creating high-resolution, flicker-free meters and gauges using anti-aliased arcs and sprites.
- Multi-language Interfaces: Rendering complex scripts such as Japanese or Greek using Unicode-compatible smooth fonts.
- Portable Gaming: Developing responsive UI and sprites for handheld devices using 8-bit or 16-bit parallel interfaces for high frame rates.
- IoT Monitoring: Displaying compressed PNG images and real-time graphs on low-power ESP32 or ESP8266 modules.
- Automotive Displays: Utilizing hardware-accelerated gradients and smooth graphics for modern instrument clusters.
Getting Started
To begin, install the library via the Arduino Library Manager. Unlike most Arduino libraries, hardware configuration is performed by editing the User_Setup.h file or selecting a predefined configuration in User_Setup_Select.h located within the library folder. This setup includes defining the display driver, pin assignments, and SPI frequency.
Once configured, any example sketch provided with the library can be run without further modification. For PlatformIO users, these settings can be defined on a per-project basis within the platformio.ini file. Developers are encouraged to explore the examples folder, which contains specialized demonstrations for DMA transfers, Sprite-based animation, and smooth font rendering from SPIFFS or LittleFS.
Related Projects (31)
View All 31 Projects →
Giulia TFT
An ESP32-based telemetry display for Alfa Romeo Giulia and Stelvio JTDm vehicles. It interfaces with a Bluetooth OBD2 adapter to monitor engine parameters, DPF regeneration cycles, and battery health using the LVGL graphics library on a touchscreen TFT display.
esp-lvgl
A comprehensive collection of LVGL (Light and Versatile Graphics Library) examples and tutorials for ESP32 and ESP8266 platforms. It supports multiple development frameworks including Arduino, ESP-IDF, and MicroPython, providing drivers and UI templates for various display types.
Air Quality Monitor
An ESP32-powered air quality monitoring system featuring the Sensirion SEN66 sensor and a LilyGO TTGO T-Display. It tracks CO2, particulate matter, VOC, and NOx indices, offering both a local TFT interface and a responsive web dashboard with historical graphing and JSON API support.
BetterMochi
An enhanced firmware for the Mochi car pet device, targeting ESP32-based hardware like the M5Dial. It adds features such as a GPS-based speed gauge, real-time clock, and customizable settings using the TFT_eSPI library and ESP-NOW for sensor data transmission.
PONS: Pilot Oriented Navigation System for Human-Powered Aircraft
A specialized GNSS navigation system designed for human-powered aircraft pilots, specifically optimized for the Japan International Birdman Rally at Lake Biwa. It features a dual-core architecture on the Raspberry Pi Pico 2 to handle high-speed TFT map rendering, GPS tracking, and SD card data logging simultaneously.
ESP32 Marauder for Cheap Yellow Display (CYD)
A specialized port of the ESP32-Marauder firmware tailored for the Cheap Yellow Display (CYD) hardware family. It provides a comprehensive suite of WiFi and Bluetooth testing tools, including wardriving, packet capture, and signal analysis, optimized for various ESP32 and ESP32-S3 touch screen modules.
ESP32 MFA Authenticator
A standalone hardware TOTP generator for the ESP32 platform, featuring a touch-screen interface powered by LVGL. It provides a secure way to manage MFA codes without a smartphone, supporting WiFi time synchronization and SD card configuration.
Nebaura Labs Mote
Mote is an open-source ESP32-S3 voice companion device designed to bring personal AI into the physical world. It features real-time speech-to-text via Deepgram, natural voice synthesis through ElevenLabs, and an animated face display. The project includes a complete firmware stack, a gateway server, and a mobile application for configuration.