[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6593":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},6593,"TFT_eSPI","Bodmer\u002FTFT_eSPI","Bodmer","Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips","",null,"C",4787,1377,106,266,0,1,9,46,8,31.42,"Other",false,"master",true,[27,28,29,30,31,32,33,34,35,36,37],"arduino","arduino-library","esp32","esp8266","raspberry-pico","rp2040","spi","stm32","tft","tft-displays","ttgo","2026-06-12 02:01:27","A [\"Discussions\"](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Fdiscussions) facility has been added for Q&A etc. Use the [\"Issues\"](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Fissues) tab only for problems with the library. Thanks!\n\nI have setup a Ko-fi account so you can [\"buy me a coffee!\"](https:\u002F\u002Fko-fi.com\u002FBodmer) This encourages me to add new features and capabiities to TFT_eSPI.\n\n# News\n1. The ESP32 S3 DMA capability now works with ESP-IDF versions greater than 2.0.14. This has been tested with the Arduino 3.3.6 board package. ChatGPT gave me a clue for the change (use SPI_DMA_CH_AUTO for the register selection) but the AI generated response did contain duff info regarding some (mostly harmless) register bit settings needed!\n\n2. The Create_font Processing sketch has been updated to automatically create a complete C header file. The automatic opening of the font folder can also be disabled within the Processing sketch. (Thanks to Pierre-Loup Martin).\n\n3. New board setup files have been added for the Seeed XIAO with round display, LilyGo T-Embed S3, LilyGo_T_QT_Pro_S3, ESP32 S3 Box and ESP32_S3_Box_Lite. The \"RPi\" interface style boards are now supported with the ESP32 S3.\n\n4. New functions have been added to draw smooth (antialiased) arcs, circles, and rounded rectangle outlines. New sketches are provided in the \"Smooth Graphics\" examples folder. Arcs can be drawn with or without anti-aliasing (which will then render faster). The arc ends can be straight or rounded. The arc drawing algorithm uses an optimised fixed point sqrt() function to improve performance on processors that do not have a hardware Floating Point Unit (e.g. RP2040). Here are two demo images, on the left smooth (anti-aliased) arcs with rounded ends, the image to the right is the same resolution (grabbed from the same 240x240 TFT) with the smoothing diasbled (no anti-aliasing):\n\n      ![arcs](https:\u002F\u002Fgithub.com\u002FBodmer\u002FGithub-images\u002Fblob\u002Fmain\u002Faa_arc_240x240.png)  ![pixelated_arcs](https:\u002F\u002Fgithub.com\u002FBodmer\u002FGithub-images\u002Fblob\u002Fmain\u002Fno_aa_arc_240x240.png)\n\n      Here the smooth arcs have been used to create anti-aliased meter gauges on a 320x240 TFT:\n \n      ![arcs](https:\u002F\u002Fgithub.com\u002FBodmer\u002FGithub-images\u002Fblob\u002Fmain\u002Fxarc_meters_320x240.png)\n\n5. An excellent new compatible library is available which can render TrueType fonts on a TFT screen (or into a sprite). This has been developed by [takkaO](https:\u002F\u002Fgithub.com\u002FtakkaO\u002FOpenFontRender). The library provides access to compact font files, with fully scaleable anti-aliased glyphs. Left, middle and right justified text can also be printed to the screen. I have added TFT_eSPI specific examples to the OpenFontRender library and tested on RP2040 and ESP32 processors, the ESP8266 does not have sufficient RAM due to the glyph render complexity. Here is a demo screen where a single 12kbyte font file binary was used to render fully anti-aliased glyphs of gradually increasing size on a 320x480 TFT screen:\n\n      ![ttf_font_demo](https:\u002F\u002Fi.imgur.com\u002FbKkilIb.png)\n\n6. New GUI examples have been added for sliders, buttons, graphs and meters. These examples require a new support library here:\n\n   [TFT_eWidget](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eWidget)\n\n7. Support has been added in v2.4.70 for the RP2040 with 16-bit parallel displays. This has been tested and the screen update performance is very good (4ms to clear 320 x 480 screen with HC8357C). The use of the RP2040 PIO makes it easy to change the write cycle timing for different displays. DMA with 16-bit transfers is also supported.\n\n8. Support for the ESP32-S2, ESP32-S3 and ESP32-C3 has been added (DMA only on ESP32 S3 at the moment). Tested with v2.0.3 RC1 of the ESP32 board package. Example setups:\n\n      [Setup70_ESP32_S2_ILI9341.h](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Fblob\u002Fmaster\u002FUser_Setups\u002FSetup70_ESP32_S2_ILI9341.h)\n      \n      [Setup70b_ESP32_S3_ILI9341.h](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Fblob\u002Fmaster\u002FUser_Setups\u002FSetup70b_ESP32_S3_ILI9341.h)\n      \n      [Setup70c_ESP32_C3_ILI9341.h](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Fblob\u002Fmaster\u002FUser_Setups\u002FSetup70c_ESP32_C3_ILI9341.h)\n\n      [Setup70d_ILI9488_S3_Parallel.h](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Fblob\u002Fmaster\u002FUser_Setups\u002FSetup70d_ILI9488_S3_Parallel.h)\n\n8. Smooth fonts can now be rendered direct to the TFT with very little flicker for quickly changing values. This is achieved by a line-by-line and block-by-block update of the glyph area without drawing pixels twice. This is a \"breaking\" change for some sketches because a new true\u002Ffalse parameter is needed to render the background. The default is false if the parameter is missing, Examples:\n\n      tft.setTextColor(TFT_WHITE, TFT_BLUE, true);\n      spr.setTextColor(TFT_BLUE, TFT_BLACK, true);\n\nNote: background rendering for Smooth fonts is also now available when using the print stream e.g. with: tft.println(\"Hello World\");\n\n10. New anti-aliased graphics functions to draw lines, wedge shaped lines, circles and rounded rectangles. [Examples are included](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Ftree\u002Fmaster\u002Fexamples\u002FSmooth%20Graphics). Examples have also been added to [display PNG compressed images](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Ftree\u002Fmaster\u002Fexamples\u002FPNG%20Images) (note: requires ~40kbytes RAM).\n\n11. The RP2040 8-bit parallel interface uses the PIO. The PIO now manages the \"setWindow\" and \"block fill\" actions, releasing the processor for other tasks when areas of the screen are being filled with a colour. The PIO can optionally be used for SPI interface displays if #define RP2040_PIO_SPI is put in the setup file. Touch screens and pixel read operations are not supported when the PIO interface is used.\nThe RP2040 PIO features only work with [Earle Philhower's board package](https:\u002F\u002Fgithub.com\u002Fearlephilhower\u002Farduino-pico), NOT the Arduino Mbed version.\n\nThe use of PIO for SPI allows the RP2040 to be over-clocked (up to 250MHz works on my boards) in Earle's board package whilst still maintaining high SPI clock rates.\n\n# TFT_eSPI\n\nA feature rich Arduino IDE compatible graphics and fonts library for 32-bit processors. The library is targeted at 32-bit processors, it  has been performance optimised for RP2040, STM32, ESP8266 and ESP32 types, other 32-bit processors may be used but will use the slower generic Arduino interface calls. The library can be loaded using the Arduino IDE's Library Manager. Direct Memory Access (DMA) can be used with the ESP32, RP2040 and STM32 processors with SPI interface displays to improve rendering performance. DMA with a parallel interface (8 and 16-bit) is only supported with the RP2040.\n\nThe updates for the ESP32 S2\u002FC3\u002FS3 means that the library requires the ESP32 Arduino board package 2.x.x or later.\n\nThe screen controller, interface pins and library configuration settings must be defined inside the library. They can NOT be defined in the Arduino sketch. See the User_Setup_Select.h file for details. This approach has significant advantages, it keeps the examples clean from long configuration options and once the setup is defined any example can be run without modification. PlatformIO users can define these settings on a per project basis within a platformio.ini file, see Docs folder in library.\n\nLots of example sketches are provided which demonstrate using the functions in the library. Due to the popularity of the library there are lots of online tutorials for TFT_eSPI that have been created by enthusiastic users.\n\nOptimised drivers have been tested with the following processors:\n\n* RP2040, e.g. Raspberry Pi Pico\n* ESP32 and ESP32-S2, ESP32-C3, ESP32-S3\n* ESP8266\n* STM32F1xx, STM32F2xx, STM32F4xx, STM32F767 (higher RAM processors recommended)\n\nThe library supports the following interface types for these processors:\n\n| Processor | 4 wire SPI | 8-bit parallel | 16-bit parallel |   DMA support    |\n|-----------|    :---:   |     :---:      |      :---:      |       :---:      |\n| RP2040    |     Yes    |      Yes       |       Yes       |  Yes (all)       |\n| ESP32     |     Yes    |      Yes       |       No        |  Yes (SPI only)  |\n| ESP32 C3  |     Yes    |      No        |       No        |  No              |\n| ESP32 S2  |     Yes    |      No        |       No        |  No              |\n| ESP32 S3  |     Yes    |      Yes       |       No        |  Yes (SPI only)  |\n| ESP8266   |     Yes    |      No        |       No        |  No              |\n| STM32Fxxx |     Yes    |      Yes       |       No        |  Yes (SPI only)  |\n| Other     |     Yes    |      No        |       No        |  No              |\n\nFor other (generic) processors only SPI interface displays are supported and the slower Arduino SPI library functions are used by the library. Higher clock speed processors such as used for the Teensy 3.x and 4.x boards will still provide a very good performance with the generic Arduino SPI functions.\n\n4 wire SPI means the display must have SPI interface compatible signals and a \"Data\u002FCommand\" control signal, this signal line is sometimes labelled DC, RS or A0. \n\nDue to lack of GPIO pins the 8-bit parallel interface is NOT supported on the ESP8266. 8-bit parallel interface TFTs  (e.g. UNO format mcufriend shields) can used with the STM32Fxxx Nucleo 64\u002F144 range or the UNO format ESP32 (see below for ESP32).\n\nSupport for the XPT2046 touch screen controller is built into the library and can be used with SPI interface displays. Third party touch support libraries are also available when using a display parallel interface.\n\nDisplays using the following controllers are supported:\n\n* GC9A01\n* ILI9163\n* ILI9225\n* ILI9341\n* ILI9342\n* ILI9481 (DMA not supported with SPI)\n* ILI9486 (DMA not supported with SPI)\n* ILI9488 (DMA not supported with SPI)\n* HX8357B (16-bit parallel tested with RP2040)\n* HX8357C (16-bit parallel tested with RP2040)\n* HX8357D\n* R61581\n* RM68120 (support files added but untested)\n* RM68140\n* S6D02A1\n* SSD1351\n* SSD1963 (this controller only has a parallel interface option)\n* ST7735\n* ST7789\n* ST7796\n\nILI9341 and ST7796 SPI based displays are recommended as starting point for experimenting with this library.\n\nThe library supports some TFT displays designed for the Raspberry Pi (RPi) that are based on a ILI9486 or ST7796 driver chip with a 480 x 320 pixel screen. The ILI9486 RPi 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. Note that due to design variations between these displays not all RPi displays will work with this library, so purchasing a RPi display of these types solely for use with this library is NOT recommended.\n\nA \"good\" RPi display is the [MHS-4.0 inch Display-B type ST7796](http:\u002F\u002Fwww.lcdwiki.com\u002FMHS-4.0inch_Display-B) which provides good performance. This has a dedicated controller and can be clocked at up to 80MHz with the ESP32 (125MHz with overclocked RP2040, 55MHz with STM32 and 40MHz with ESP8266). The [MHS-3.5 inch RPi ILI9486](http:\u002F\u002Fwww.lcdwiki.com\u002FMHS-3.5inch_RPi_Display) based display is also supported, however the MHS ILI9341 based display of the same type does NOT work with this library.\n\nSome displays permit the internal TFT screen RAM to be read, a few of the examples use this feature. The TFT_Screen_Capture example allows full screens to be captured and sent to a PC, this is handy to create program documentation.\n\nThe library includes a \"Sprite\" class, this enables flicker free updates of complex graphics. Direct writes to the TFT with graphics functions are still available, so existing sketches do not need to be changed.\n\n# Sprites\n\nA Sprite is notionally an invisible graphics screen that is kept in the processors RAM. Graphics can be drawn into the Sprite just as they 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. Sprites by default use 16-bit colours, the bit depth can be set to 8 bits (256 colours) , or 1 bit (any 2 colours) to reduce the RAM needed. 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 datasheet implies so a 16-bit colour Sprite is limited to about 200x200 pixels (~80Kbytes), an 8-bit sprite to 320x240 pixels (~76kbytes). A 1 bit per pixel Sprite requires only 9600 bytes for a full 320 x 240 screen buffer, this is ideal for supporting use with 2 colour bitmap fonts.\n\nOne or more sprites can be created, a sprite can be any pixel width and height, limited only by available RAM. 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. Sprites can be created and deleted dynamically as needed in the sketch, this means RAM can be freed up after the Sprite has been plotted on the screen, more RAM intensive WiFi based code can then be run and normal graphics operations still work.\n\nDrawing graphics into a sprite is very fast, for those familiar with the Adafruit \"graphicstest\" example, this whole test completes in 18ms in a 160x128 sprite. Examples of sprite use can be found in the \"examples\u002FSprite\" folder.\n\nSprites can be plotted to the TFT with one colour being specified as \"transparent\", see Transparent_Sprite_Demo example.\n\nIf an ESP32 board has SPIRAM (i.e. PSRAM) fitted then Sprites will use the PSRAM memory and large full screen buffer Sprites can be created. Full screen Sprites take longer to render (~45ms for a 320 x 240 16-bit Sprite), so bear that in mind.\n\nThe \"Animated_dial\" example shows how dials can be created using a rotated Sprite for the needle. To run this example the TFT interface must support reading from the screen RAM (not all do). The dial rim and scale is a jpeg image, created using a paint program.\n\n![Animated_dial](https:\u002F\u002Fi.imgur.com\u002FS736Rg6.png)\n\n\n# Touch controller support\n\nThe XPT2046 touch screen controller is supported for SPI based displays only. The SPI bus for the touch controller is shared with the TFT and only an additional chip select line is needed. This support will eventually be deprecated when a suitable touch screen library is available.\n\nThe Button class from Adafruit_GFX is incorporated, with the enhancement that the button labels can be in any font.\n\n# ESP8266 overlap mode\n\nThe library supports SPI overlap on the ESP8266 so the TFT screen can share MOSI, MISO and SCLK pins with the program FLASH, this frees up GPIO pins for other uses. Only one SPI device can be connected to the FLASH pins and the chips select for the TFT must be on pin D3 (GPIO0).\n\n\n# Fonts\n\nThe library contains proportional fonts, different sizes can be enabled\u002Fdisabled at compile time to optimise the use of FLASH memory. Anti-aliased (smooth) font files in vlw format stored in SPIFFS are supported. Any 16-bit Unicode character can be included and rendered, this means many language specific characters can be rendered to the screen.\n\nThe 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 the different 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 lots of example sketches to demonstrate the different features and included functions.\n\nConfiguration of the library font selections, pins used to interface with the TFT and other features is made by editing the User_Setup.h file in the library folder, or by selecting your own configuration in the \"User_Setup_Selet,h\" file.  Fonts and features can easily be enabled\u002Fdisabled by commenting out lines.\n\n\n# Anti-aliased Fonts\n\nAnti-aliased (smooth) font files in \"vlw\" format are generated by the free [Processing IDE](https:\u002F\u002Fprocessing.org\u002F) using a sketch included in the library Tools folder. This sketch with the Processing IDE can be used to generate font files from your computer's font set or any TrueType (.ttf) font, the font file can include **any** combination of 16-bit Unicode characters. This means Greek, Japanese and any other UCS-2 glyphs can be used. Character arrays and Strings in UTF-8 format are supported.\n\nThe .vlw files must be uploaded to the processors FLASH filing system (SPIFFS, LittleFS or SD card) for use. Alternatively the .vlw files can be converted to C arrays (see \"Smooth Font -> FLASH_Array\" examples) and stored directly in FLASH as part of the compile process.  The array based approach is convenient, provides performance improvements and is suitable where: either use of a filing system is undesirable, or the processor type (e.g. STM32) does not support a FLASH based filing system.\n\nHere is the Adafruit_GFX \"FreeSans12pt\" bitmap font compared to the same font drawn as anti-aliased:\n\n![Smooth_font](https:\u002F\u002Fi.imgur.com\u002FgAeDPFY.png)\n\nThe smooth font example displays the following screen:\n\n![Example](https:\u002F\u002Fi.imgur.com\u002FxJF0Oz7.png)\n\nIt would be possible to compress the vlw font files but the rendering performance to a TFT is still good when storing the font file(s) in SPIFFS, LittleFS or FLASH arrays.\n\nHere is an example screenshot showing the anti-aliased Hiragana character Unicode block (0x3041 to 0x309F) in 24pt from the Microsoft Yahei font:\n\n![Hiragana glyphs](https:\u002F\u002Fi.imgur.com\u002FjeXf2st.png)\n\nAnti-aliased fonts can also be drawn over a gradient background with a callback to fetch the background colour of each pixel. This pixel colour can be set by the gradient algorithm or by reading back the TFT screen memory (if reading the display is supported).\n\nAnti-aliased fonts cannot be scaled with setTextSize so you need to create a font for each size you need. See examples.\n\n# 8-bit parallel support\n\nThe common 8-bit \"Mcufriend\" shields are supported for the STM Nucleo 64\u002F144 boards and ESP32 UNO style board. The STM32 \"Blue\u002FBlack Pill\" boards can also be used with 8-bit parallel displays.\n\nThe ESP32 board I have been using for testing has the following pinout:\n\n![Example](https:\u002F\u002Fi.imgur.com\u002FbvM6leE.jpg)\n\nUNO style boards with a Wemos R32(ESP32) label are also available at low cost with the same pinout.\n\nUnfortunately the typical UNO\u002Fmcufriend TFT display board maps LCD_RD, LCD_CS and LCD_RST signals to the ESP32 analogue pins 35, 34 and 36 which are input only.  To solve this I linked in the 3 spare pins IO15, IO33 and IO32 by adding wires to the bottom of the board as follows:\n\nIO15 wired to IO35\n\nIO33 wired to IO34\n\nIO32 wired to IO36\n\nThis is an [example setup file](https:\u002F\u002Fgithub.com\u002FBodmer\u002FTFT_eSPI\u002Fblob\u002Fmaster\u002FUser_Setups\u002FSetup14_ILI9341_Parallel.h) with the correct GPIO for this UNO board.\n\n![Example](https:\u002F\u002Fi.imgur.com\u002FpUZn6lF.jpg)\n\nIf the display board is fitted with a resistance based touch screen then this can be used by performing the modifications described here and the fork of the Adafruit library:\nhttps:\u002F\u002Fgithub.com\u002Fs60sc\u002FAdafruit_TouchScreen\n\n# Using an SPI display and SD card at the same time on Arduino\n\nIf you wish to use this library and an SD card on the same SPI bus you must ensure that _TFT_MISO_, _TFT_MOSI_ and _TFT_SCLK_ are explicitly defined in your User_setup.h file, even if you are using the default SPI pins for your board.\n\nFailure to declare these pins explicitly may prevent your SD card from being usable after display initialisation.\n\n# Tips\nIf you load a new copy of TFT_eSPI then it will overwrite your setups if they are kept within the TFT_eSPI folder. One way around this is to create a new folder in your Arduino library folder called \"TFT_eSPI_Setups\". You then place your custom setup.h files in there. After an upgrade simply edit the User_Setup_Select.h file to point to your custom setup file e.g.:\n```\n#include \u003C..\u002FTFT_eSPI_Setups\u002Fmy_custom_setup.h>\n```\nYou must make sure only one setup file is called. In the custom setup file I add the file path as a commented out first line that can be cut and pasted back into the upgraded User_Setup_Select.h file.  The ..\u002F at the start of the path means go up one directory level. Clearly you could use different file paths or directory names as long as it does not clash with another library or folder name.\n\nYou can take this one step further and have your own setup select file and then you only need to replace the Setup.h line reference in User_Setup_Select.h to, for example:\n```\n#include \u003C..\u002FTFT_eSPI_Setups\u002Fmy_setup_select.h>\n```\nTo select a new setup you then edit your own my_setup_select.h file (which will not get overwritten during an upgrade).\n","TFT_eSPI 是一个与 Arduino 和 PlatformIO IDE 兼容的 TFT 库，专为 Raspberry Pi Pico (RP2040)、STM32、ESP8266 和 ESP32 设计，支持多种驱动芯片。该项目通过优化 SPI 通信和图形算法，提供了高效且功能丰富的显示控制能力，包括平滑（抗锯齿）弧线、圆形及圆角矩形绘制等功能，并支持 TrueType 字体渲染。适合于需要高质量图形界面输出的小型嵌入式系统项目，如物联网设备、手持仪器仪表等场景使用。",2,"2026-06-11 03:07:48","top_language"]