├── Fonts ├── TrueType │ └── Not_yet_supported.txt ├── Font16.h ├── Font32rle.h ├── Font64rle.h ├── Font72rle.h ├── Font7srle.h ├── Font72x53rle.h └── GFXFF │ ├── license.txt │ └── print.txt ├── CMakeFiles ├── cmake.check_cache └── 3.28.1 │ └── CMakeSystem.cmake ├── Tools ├── bmp2array4bit │ ├── star.bmp │ └── README.md └── Create_Smooth_Font │ └── Create_font │ └── data │ └── Final-Frontier.ttf ├── CMakeLists.txt ├── docs ├── RPi_TFT_connections │ ├── RPi_TFT_mod.png │ └── RPi_TFT_Connections.png ├── ESP32 UNO board mod │ ├── ESP32 UNO board mod.jpg │ └── ESP32 UNO board pinout.jpg └── PlatformIO │ ├── Configuring options.txt │ └── rp2040.txt ├── examples ├── Sprite │ ├── Animated_dial │ │ └── data │ │ │ └── dial.jpg │ ├── Rotated_Sprite_3 │ │ └── data │ │ │ ├── EagleEye.jpg │ │ │ └── Eye_80x64.jpg │ └── Sprite_image_4bit │ │ └── sample_images.h ├── Generic │ ├── TFT_SPIFFS_BMP │ │ └── data │ │ │ └── parrot.bmp │ ├── ESP32_SDcard_jpeg │ │ └── Data │ │ │ ├── Baboon40.jpg │ │ │ ├── EagleEye.jpg │ │ │ ├── Mouse480.jpg │ │ │ └── lena20k.jpg │ ├── Gradient_Fill │ │ └── Gradient_Fill.ino │ ├── Animated_Eyes_2 │ │ └── wiring.ino │ └── drawXBitmap │ │ └── drawXBitmap.ino ├── PNG Images │ ├── LittleFS_PNG │ │ ├── data │ │ │ ├── panda.png │ │ │ └── EagleEye.png │ │ └── PNG_FS_Support.ino │ ├── LittleFS_PNG_DMA │ │ ├── data │ │ │ ├── panda.png │ │ │ └── EagleEye.png │ │ └── PNG_FS_Support.ino │ └── Flash_transparent_PNG │ │ └── png_support.ino ├── ePaper │ └── Floyd_Steinberg │ │ └── data │ │ ├── Tiger.bmp │ │ └── TestCard.bmp ├── Smooth Fonts │ ├── SPIFFS │ │ ├── Font_Demo_1 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ │ └── Notes.ino │ │ ├── Font_Demo_2 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ │ └── Notes.ino │ │ ├── Font_Demo_3 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ ├── NotoSansBold36.vlw │ │ │ │ └── NotoSansMonoSCB20.vlw │ │ │ └── Notes.ino │ │ ├── Font_Demo_4 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ │ └── Notes.ino │ │ ├── Unicode_test │ │ │ └── data │ │ │ │ ├── Unicode-Test-72.vlw │ │ │ │ ├── Final-Frontier-28.vlw │ │ │ │ └── Latin-Hiragana-24.vlw │ │ ├── Print_Smooth_Font │ │ │ └── data │ │ │ │ └── Final-Frontier-28.vlw │ │ ├── Smooth_font_gradient │ │ │ └── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ └── Smooth_font_reading_TFT │ │ │ └── data │ │ │ ├── NotoSansBold15.vlw │ │ │ └── NotoSansBold36.vlw │ ├── LittleFS │ │ ├── Font_Demo_1 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ │ └── Notes.ino │ │ ├── Font_Demo_2 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ │ └── Notes.ino │ │ ├── Font_Demo_3 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ ├── NotoSansBold36.vlw │ │ │ │ └── NotoSansMonoSCB20.vlw │ │ │ └── Notes.ino │ │ ├── Font_Demo_4 │ │ │ ├── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ │ └── Notes.ino │ │ ├── Unicode_test │ │ │ ├── data │ │ │ │ ├── Final-Frontier-28.vlw │ │ │ │ ├── Latin-Hiragana-24.vlw │ │ │ │ └── Unicode-Test-72.vlw │ │ │ └── LittleFS_functions.ino │ │ ├── Print_Smooth_Font │ │ │ └── data │ │ │ │ └── Final-Frontier-28.vlw │ │ ├── Smooth_font_gradient │ │ │ └── data │ │ │ │ ├── NotoSansBold15.vlw │ │ │ │ └── NotoSansBold36.vlw │ │ └── Smooth_font_reading_TFT │ │ │ └── data │ │ │ ├── NotoSansBold15.vlw │ │ │ └── NotoSansBold36.vlw │ ├── FLASH_Array │ │ ├── Unicode_test │ │ │ └── data │ │ │ │ ├── Unicode-Test-72.vlw │ │ │ │ ├── Final-Frontier-28.vlw │ │ │ │ └── Latin-Hiragana-24.vlw │ │ ├── Font_Demo_1_Array │ │ │ └── Notes.ino │ │ ├── Font_Demo_2_Array │ │ │ └── Notes.ino │ │ ├── Font_Demo_4_Array │ │ │ └── Notes.ino │ │ └── Font_Demo_3_Array │ │ │ └── Notes.ino │ └── SD_Card │ │ └── ESP32_Smooth_Font_SD │ │ └── data │ │ └── Final-Frontier-28.vlw ├── Test and diagnostics │ ├── TFT_ReadWrite_Test │ │ └── TFT_ReadWrite_Test.ino │ └── Test_Touch_Controller │ │ └── Test_Touch_Controller.ino ├── 320 x 240 │ └── TFT_Ellipse │ │ └── TFT_Ellipse.ino ├── 480 x 320 │ ├── TFT_Ellipse │ │ └── TFT_Ellipse.ino │ └── Touch_Controller_Demo │ │ └── Touch_Controller_Demo.ino ├── 160 x 128 │ └── TFT_Ellipse │ │ └── TFT_Ellipse.ino └── Smooth Graphics │ ├── Smooth_Rounded_Rectangles │ └── Smooth_Rounded_Rectangles.ino │ ├── Smooth_Arc │ └── Smooth_Arc.ino │ └── Colour_Wheel │ └── Colour_Wheel.ino ├── README.txt ├── library.properties ├── .gitattributes ├── TFT_Drivers ├── ST7789_2_Init.h ├── SSD1351_Defines.h ├── EPD_Defines.h ├── S6D02A1_Rotation.h ├── SSD1963_Rotation.h ├── ILI9481_Rotation.h ├── ILI9488_Rotation.h ├── R61581_Rotation.h ├── RM68120_Rotation.h ├── SSD1351_Rotation.h ├── HX8357D_Rotation.h ├── SSD1351_Init.h ├── GC9A01_Defines.h ├── ILI9481_Defines.h ├── ILI9488_Defines.h ├── R61581_Defines.h ├── RM68140_Defines.h ├── ILI9163_Rotation.h ├── RM68140_Rotation.h ├── ILI9225_Rotation.h ├── HX8357B_Defines.h ├── HX8357C_Defines.h ├── GC9A01_Rotation.h ├── RM68120_Defines.h ├── ILI9486_Rotation.h ├── HX8357B_Rotation.h ├── HX8357C_Rotation.h ├── ILI9163_Init.h ├── SSD1963_Defines.h ├── HX8357B_Init.h ├── RM68140_Init.h ├── R61581_Init.h └── ST7796_Rotation.h ├── User_Setups ├── Setup250_ESP32_S3_Box_Lite.h ├── Setup204_ESP32_TouchDown.h ├── Setup71_ESP32_S2_ST7789.h ├── Setup205_ESP32_TouchDown_S3.h ├── Setup22_TTGO_T4_v1.3.h ├── Setup17_ePaper.h ├── Setup22_TTGO_T4.h ├── Setup70h_ESP32_S3_GC9A01.h ├── Setup70d_ILI9488_S3_Parallel.h ├── Setup25_TTGO_T_Display.h ├── Setup206_LilyGo_T_Display_S3.h ├── Setup70_ESP32_S2_ILI9341.h ├── Setup70f_ESP32_S2_ST7735.h ├── Setup70b_ESP32_S3_ILI9341.h ├── Setup23_TTGO_TM.h ├── Setup70c_ESP32_C3_ILI9341.h ├── Setup251_ESP32_S3_Box.h ├── Setup45_TTGO_T_Watch.h ├── Setup46_GC9A01_ESP32.h ├── Setup12_M5Stack_Basic_Core.h ├── Setup44_TTGO_CameraPlus.h ├── Setup302_Waveshare_ESP32S3_GC9A01.h ├── Setup36_RPi_touch_ST7796.h ├── Setup51_LilyPi_ILI9481.h ├── Setup52_LilyPi_ST7796.h ├── Setup5_RPi_ILI9486.h ├── Setup1_ILI9341.h ├── Setup136_LilyGo_TTV.h ├── Setup11_RPi_touch_ILI9486.h ├── Setup20_ILI9488.h ├── Setup200_GC9A01.h ├── Setup66_Seeed_XIAO_Round.h ├── Setup21_ILI9488.h ├── Setup60_RP2040_RPI_MHS.h ├── Setup6_RPi_Wr_ILI9486.h ├── Setup16_ILI9488_Parallel.h ├── Setup138_Pico_Explorer_Base_RP2040_ST7789.h ├── Setup19_RM68140_Parallel.h ├── Setup13_ILI9481_Parallel.h ├── Setup14_ILI9341_Parallel.h ├── Setup213_LilyGo_T_Beam_Shield.h ├── Setup10_RPi_touch_ILI9486.h ├── Setup137_LilyGo_TDisplay_RP2040.h ├── Setup4_S6D02A1.h ├── Setup0_Sprite.h ├── Setup72_ESP32_ST7789_172x320.h ├── Setup3_ILI9163.h ├── Setup42_ILI9341_ESP32.h ├── Setup8_ILI9163_128x128.h ├── Setup15_HX8357D.h ├── Setup212_LilyGo_T_PicoPro.h ├── Setup210_LilyGo_T_Embed_S3.h ├── Setup211_LilyGo_T_QT_Pro_S3.h ├── Setup26_TTGO_T_Wristband.h ├── User_Custom_Fonts.h ├── Setup301_BW16_ST7735.h ├── Setup2_ST7735.h ├── Setup201_WT32_SC01.h ├── Setup7_ST7735_128x128.h ├── Setup18_ST7789.h ├── Setup209_LilyGo_T_Dongle_S3.h ├── Setup207_LilyGo_T_HMI.h └── Setup47_ST7735.h ├── .gitignore ├── library.json ├── Extensions └── Button.h └── .github └── ISSUE_TEMPLATE └── issue-template.md /Fonts/TrueType/Not_yet_supported.txt: -------------------------------------------------------------------------------- 1 | TO DO: Add support for converted True Type fonts in an RLE format. -------------------------------------------------------------------------------- /CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /Tools/bmp2array4bit/star.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/Tools/bmp2array4bit/star.bmp -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | idf_component_register(SRCS "TFT_eSPI.cpp" 3 | INCLUDE_DIRS "." 4 | PRIV_REQUIRES arduino) -------------------------------------------------------------------------------- /docs/RPi_TFT_connections/RPi_TFT_mod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/docs/RPi_TFT_connections/RPi_TFT_mod.png -------------------------------------------------------------------------------- /examples/Sprite/Animated_dial/data/dial.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Sprite/Animated_dial/data/dial.jpg -------------------------------------------------------------------------------- /examples/Generic/TFT_SPIFFS_BMP/data/parrot.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Generic/TFT_SPIFFS_BMP/data/parrot.bmp -------------------------------------------------------------------------------- /examples/PNG Images/LittleFS_PNG/data/panda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/PNG Images/LittleFS_PNG/data/panda.png -------------------------------------------------------------------------------- /examples/ePaper/Floyd_Steinberg/data/Tiger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/ePaper/Floyd_Steinberg/data/Tiger.bmp -------------------------------------------------------------------------------- /docs/ESP32 UNO board mod/ESP32 UNO board mod.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/docs/ESP32 UNO board mod/ESP32 UNO board mod.jpg -------------------------------------------------------------------------------- /docs/RPi_TFT_connections/RPi_TFT_Connections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/docs/RPi_TFT_connections/RPi_TFT_Connections.png -------------------------------------------------------------------------------- /examples/PNG Images/LittleFS_PNG/data/EagleEye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/PNG Images/LittleFS_PNG/data/EagleEye.png -------------------------------------------------------------------------------- /examples/Sprite/Rotated_Sprite_3/data/EagleEye.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Sprite/Rotated_Sprite_3/data/EagleEye.jpg -------------------------------------------------------------------------------- /examples/ePaper/Floyd_Steinberg/data/TestCard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/ePaper/Floyd_Steinberg/data/TestCard.bmp -------------------------------------------------------------------------------- /docs/ESP32 UNO board mod/ESP32 UNO board pinout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/docs/ESP32 UNO board mod/ESP32 UNO board pinout.jpg -------------------------------------------------------------------------------- /examples/Generic/ESP32_SDcard_jpeg/Data/Baboon40.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Generic/ESP32_SDcard_jpeg/Data/Baboon40.jpg -------------------------------------------------------------------------------- /examples/Generic/ESP32_SDcard_jpeg/Data/EagleEye.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Generic/ESP32_SDcard_jpeg/Data/EagleEye.jpg -------------------------------------------------------------------------------- /examples/Generic/ESP32_SDcard_jpeg/Data/Mouse480.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Generic/ESP32_SDcard_jpeg/Data/Mouse480.jpg -------------------------------------------------------------------------------- /examples/Generic/ESP32_SDcard_jpeg/Data/lena20k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Generic/ESP32_SDcard_jpeg/Data/lena20k.jpg -------------------------------------------------------------------------------- /examples/PNG Images/LittleFS_PNG_DMA/data/panda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/PNG Images/LittleFS_PNG_DMA/data/panda.png -------------------------------------------------------------------------------- /examples/Sprite/Rotated_Sprite_3/data/Eye_80x64.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Sprite/Rotated_Sprite_3/data/Eye_80x64.jpg -------------------------------------------------------------------------------- /examples/PNG Images/LittleFS_PNG_DMA/data/EagleEye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/PNG Images/LittleFS_PNG_DMA/data/EagleEye.png -------------------------------------------------------------------------------- /Tools/Create_Smooth_Font/Create_font/data/Final-Frontier.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/Tools/Create_Smooth_Font/Create_font/data/Final-Frontier.ttf -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_1/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_1/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_1/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_1/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_2/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_2/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_2/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_2/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_3/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_3/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_3/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_3/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_4/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_4/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_4/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_4/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_1/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_1/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_1/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_1/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_2/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_2/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_2/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_2/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_3/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_3/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_3/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_3/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_4/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_4/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_4/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_4/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_3/data/NotoSansMonoSCB20.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Font_Demo_3/data/NotoSansMonoSCB20.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Unicode_test/data/Unicode-Test-72.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Unicode_test/data/Unicode-Test-72.vlw -------------------------------------------------------------------------------- /examples/Sprite/Sprite_image_4bit/sample_images.h: -------------------------------------------------------------------------------- 1 | #include // Include the graphics library (this includes the sprite functions) 2 | 3 | extern const uint8_t stars[12800] PROGMEM ; -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_3/data/NotoSansMonoSCB20.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Font_Demo_3/data/NotoSansMonoSCB20.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Unicode_test/data/Final-Frontier-28.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Unicode_test/data/Final-Frontier-28.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Unicode_test/data/Latin-Hiragana-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Unicode_test/data/Latin-Hiragana-24.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Unicode_test/data/Unicode-Test-72.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Unicode_test/data/Unicode-Test-72.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Unicode_test/data/Final-Frontier-28.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Unicode_test/data/Final-Frontier-28.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Unicode_test/data/Latin-Hiragana-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Unicode_test/data/Latin-Hiragana-24.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/FLASH_Array/Unicode_test/data/Unicode-Test-72.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/FLASH_Array/Unicode_test/data/Unicode-Test-72.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/FLASH_Array/Unicode_test/data/Final-Frontier-28.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/FLASH_Array/Unicode_test/data/Final-Frontier-28.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/FLASH_Array/Unicode_test/data/Latin-Hiragana-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/FLASH_Array/Unicode_test/data/Latin-Hiragana-24.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Print_Smooth_Font/data/Final-Frontier-28.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Print_Smooth_Font/data/Final-Frontier-28.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Smooth_font_gradient/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Smooth_font_gradient/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Smooth_font_gradient/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Smooth_font_gradient/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Print_Smooth_Font/data/Final-Frontier-28.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Print_Smooth_Font/data/Final-Frontier-28.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SD_Card/ESP32_Smooth_Font_SD/data/Final-Frontier-28.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SD_Card/ESP32_Smooth_Font_SD/data/Final-Frontier-28.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/data/NotoSansBold15.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/data/NotoSansBold15.vlw -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/data/NotoSansBold36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/SeeedStudio_TFT_eSPI/master/examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/data/NotoSansBold36.vlw -------------------------------------------------------------------------------- /Fonts/Font16.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define nr_chrs_f16 96 4 | #define chr_hgt_f16 16 5 | #define baseline_f16 13 6 | #define data_size_f16 8 7 | #define firstchr_f16 32 8 | 9 | extern const unsigned char widtbl_f16[96]; 10 | extern const unsigned char* const chrtbl_f16[96]; 11 | -------------------------------------------------------------------------------- /Fonts/Font32rle.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define nr_chrs_f32 96 4 | #define chr_hgt_f32 26 5 | #define baseline_f32 19 6 | #define data_size_f32 8 7 | #define firstchr_f32 32 8 | 9 | extern const unsigned char widtbl_f32[96]; 10 | extern const unsigned char* const chrtbl_f32[96]; 11 | -------------------------------------------------------------------------------- /Fonts/Font64rle.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define nr_chrs_f64 96 4 | #define chr_hgt_f64 48 5 | #define baseline_f64 36 6 | #define data_size_f64 8 7 | #define firstchr_f64 32 8 | 9 | extern const unsigned char widtbl_f64[96]; 10 | extern const unsigned char* const chrtbl_f64[96]; 11 | -------------------------------------------------------------------------------- /Fonts/Font72rle.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define nr_chrs_f72 96 4 | #define chr_hgt_f72 75 5 | #define baseline_f72 73 6 | #define data_size_f72 8 7 | #define firstchr_f72 32 8 | 9 | extern const unsigned char widtbl_f72[96]; 10 | extern const unsigned char* const chrtbl_f72[96]; 11 | -------------------------------------------------------------------------------- /Fonts/Font7srle.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define nr_chrs_f7s 96 4 | #define chr_hgt_f7s 48 5 | #define baseline_f7s 47 6 | #define data_size_f7s 8 7 | #define firstchr_f7s 32 8 | 9 | extern const unsigned char widtbl_f7s[96]; 10 | extern const unsigned char* const chrtbl_f7s[96]; 11 | -------------------------------------------------------------------------------- /Fonts/Font72x53rle.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define nr_chrs_f72 96 4 | #define chr_hgt_f72 75 5 | #define baseline_f72 73 6 | #define data_size_f72 8 7 | #define firstchr_f72 32 8 | 9 | extern const unsigned char widtbl_f72[96]; 10 | extern const unsigned char* const chrtbl_f72[96]; 11 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | This is a stand-alone library that contains both graphics functions 2 | and the TFT chip driver library. It supports the ESP8266, ESP32, 3 | STM32 and RP2040 processors with performance optimised code. Other 4 | Arduino IDE compatible boards are also supported but the library 5 | then uses generic functions which will be slower. The library uses 6 | 32-bit variables extensively so this will affect performance on 8 7 | and 16-bit processors. 8 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=TFT_eSPI 2 | version=2.5.43 3 | author=Bodmer 4 | maintainer=Bodmer 5 | sentence=TFT graphics library for Arduino processors with performance optimisation for RP2040, STM32, ESP8266 and ESP32 6 | paragraph=Supports TFT displays using drivers (ILI9341 etc.) that operate with hardware SPI or 8/16-bit parallel. 7 | category=Display 8 | url=https://github.com/Bodmer/TFT_eSPI 9 | architectures=* 10 | includes=TFT_eSPI.h 11 | 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /CMakeFiles/3.28.1/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.19045") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.19045") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Windows-10.0.19045") 9 | set(CMAKE_SYSTEM_NAME "Windows") 10 | set(CMAKE_SYSTEM_VERSION "10.0.19045") 11 | set(CMAKE_SYSTEM_PROCESSOR "") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /TFT_Drivers/ST7789_2_Init.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that initialises the ST7789 driver 3 | 4 | // Configure ST7789 display 5 | 6 | { 7 | static const uint8_t PROGMEM 8 | st7789[] = { 9 | 8, 10 | TFT_SLPOUT, TFT_INIT_DELAY, 255, 11 | TFT_COLMOD, 1+TFT_INIT_DELAY, 0x55, 10, 12 | TFT_MADCTL, 1, 0x00, 13 | TFT_CASET, 4, 0x00, 0x00, 0x00, 0xF0, 14 | TFT_PASET, 4, 0x00, 0x00, 0x00, 0xF0, 15 | TFT_INVON, TFT_INIT_DELAY, 10, 16 | TFT_NORON, TFT_INIT_DELAY, 10, 17 | TFT_DISPON, TFT_INIT_DELAY, 255 18 | }; 19 | 20 | commandList(st7789); 21 | } 22 | // End of ST7789 display configuration -------------------------------------------------------------------------------- /TFT_Drivers/SSD1351_Defines.h: -------------------------------------------------------------------------------- 1 | #ifndef TFT_WIDTH 2 | #define TFT_WIDTH 128 3 | #endif 4 | #ifndef TFT_HEIGHT 5 | #define TFT_HEIGHT 128 6 | #endif 7 | 8 | // Delay between some initialisation commands 9 | #define TFT_INIT_DELAY 0x80 10 | 11 | // Generic commands used by TFT_eSPI.cpp 12 | #define TFT_NOP 0x00 13 | #define TFT_SWRST TFT_NOP 14 | #define TFT_CASET 0x15 // SETCOLUMN 15 | #define TFT_PASET 0x75 // SETROW 16 | #define TFT_RAMWR 0x5C // WRITERAM 17 | #define TFT_RAMRD 0x5D // READRAM 18 | #define TFT_IDXRD TFT_NOP 19 | #define TFT_INVOFF 0xA6 // NORMALDISPLAY 20 | #define TFT_INVON 0xA7 // INVERTDISPLAY 21 | -------------------------------------------------------------------------------- /TFT_Drivers/EPD_Defines.h: -------------------------------------------------------------------------------- 1 | // Null set for ePaper 2 | #define TFT_WIDTH 1000 3 | #define TFT_HEIGHT 1000 4 | 5 | #define TFT_INIT_DELAY 0 6 | 7 | #define TFT_NOP 0x00 8 | #define TFT_SWRST 0x00 9 | 10 | #define TFT_CASET 0x00 11 | #define TFT_PASET 0x00 12 | #define TFT_RAMWR 0x00 13 | 14 | #define TFT_RAMRD 0x00 15 | #define TFT_IDXRD 0x00 16 | 17 | #define TFT_MADCTL 0x00 18 | #define TFT_MAD_MY 0x00 19 | #define TFT_MAD_MX 0x00 20 | #define TFT_MAD_MV 0x00 21 | #define TFT_MAD_ML 0x00 22 | #define TFT_MAD_BGR 0x00 23 | #define TFT_MAD_MH 0x00 24 | #define TFT_MAD_RGB 0x00 25 | 26 | #define TFT_INVOFF 0x00 27 | #define TFT_INVON 0x00 28 | -------------------------------------------------------------------------------- /User_Setups/Setup250_ESP32_S3_Box_Lite.h: -------------------------------------------------------------------------------- 1 | // Display configuration for ST7789-based ESP32-S3-Box-Lite 2 | 3 | #define USER_SETUP_ID 250 4 | #define USER_SETUP_INFO "ESP32-S3-BOX-LITE" 5 | 6 | #define ST7789_DRIVER 7 | #define TFT_RGB_ORDER TFT_BGR 8 | 9 | #define TFT_WIDTH 240 10 | #define TFT_HEIGHT 320 11 | 12 | #define TFT_BL 45 13 | #define TFT_BACKLIGHT_ON LOW 14 | 15 | #define TFT_CS 5 16 | #define TFT_DC 4 17 | #define TFT_RST 48 18 | 19 | #define TFT_MOSI 6 20 | #define TFT_SCLK 7 21 | 22 | #define LOAD_GLCD 23 | #define LOAD_FONT2 24 | #define LOAD_FONT4 25 | #define LOAD_FONT6 26 | #define LOAD_FONT7 27 | #define LOAD_FONT8 28 | #define LOAD_GFXFF 29 | 30 | #define SMOOTH_FONT 31 | 32 | #define SPI_FREQUENCY 40000000 33 | -------------------------------------------------------------------------------- /User_Setups/Setup204_ESP32_TouchDown.h: -------------------------------------------------------------------------------- 1 | // User Setup for the ESP32 TouchDown V1.0 and V1.1 2 | // ILI9488 using 4-wire SPI and using an FT6206 touch controller 3 | 4 | #define USER_SETUP_ID 204 5 | 6 | #define ILI9488_DRIVER 7 | 8 | #define TFT_BL 32 9 | #define TFT_BACKLIGHT_ON HIGH 10 | 11 | #define TFT_MISO 19 12 | #define TFT_MOSI 23 13 | #define TFT_SCLK 18 14 | #define TFT_CS 15 15 | #define TFT_DC 2 16 | #define TFT_RST 4 17 | 18 | #define TOUCH_CS 21 19 | 20 | #define LOAD_GLCD 21 | #define LOAD_FONT2 22 | #define LOAD_FONT4 23 | #define LOAD_FONT6 24 | #define LOAD_FONT7 25 | #define LOAD_FONT8 26 | #define LOAD_GFXFF 27 | 28 | #define SMOOTH_FONT 29 | 30 | #define SPI_FREQUENCY 27000000 31 | #define SPI_READ_FREQUENCY 20000000 32 | #define SPI_TOUCH_FREQUENCY 2500000 -------------------------------------------------------------------------------- /User_Setups/Setup71_ESP32_S2_ST7789.h: -------------------------------------------------------------------------------- 1 | // Setup for the ESP32 S2 with ST7789 display 2 | // Note SPI DMA with ESP32 S2 is not currently supported 3 | #define USER_SETUP_ID 71 4 | // See SetupX_Template.h for all options available 5 | 6 | #define ST7789_DRIVER // Configure all registers 7 | 8 | 9 | #define TFT_CS 34 // 10 or 34 10 | #define TFT_MOSI 35 // 11 or 35 11 | #define TFT_SCLK 37 // 12 or 36 12 | #define TFT_MISO 36 // 13 or 37 13 | 14 | #define TFT_DC 33 15 | #define TFT_RST -1 16 | 17 | #define LOAD_GLCD 18 | #define LOAD_FONT2 19 | #define LOAD_FONT4 20 | #define LOAD_FONT6 21 | #define LOAD_FONT7 22 | #define LOAD_FONT8 23 | #define LOAD_GFXFF 24 | 25 | #define SMOOTH_FONT 26 | 27 | #define SPI_FREQUENCY 27000000 28 | 29 | #define SPI_TOUCH_FREQUENCY 2500000 30 | -------------------------------------------------------------------------------- /User_Setups/Setup205_ESP32_TouchDown_S3.h: -------------------------------------------------------------------------------- 1 | // User Setup for the ESP32 TouchDown S3 V1.1 2 | // ILI9488 using 8-bit Parallel and using an FT6206 touch controller 3 | 4 | #define USER_SETUP_ID 205 5 | 6 | #define ESP32_PARALLEL 7 | 8 | #define ILI9488_DRIVER 9 | 10 | #define TFT_DC 5 11 | #define TFT_RST 46 12 | 13 | #define TFT_WR 7 14 | #define TFT_RD 6 15 | 16 | #define TFT_D0 21 17 | #define TFT_D1 14 18 | #define TFT_D2 13 19 | #define TFT_D3 12 20 | #define TFT_D4 11 21 | #define TFT_D5 10 22 | #define TFT_D6 9 23 | #define TFT_D7 8 24 | 25 | #define TFT_BL 48 26 | #define TFT_BACKLIGHT_ON HIGH 27 | 28 | #define LOAD_GLCD 29 | #define LOAD_FONT2 30 | #define LOAD_FONT4 31 | #define LOAD_FONT6 32 | #define LOAD_FONT7 33 | #define LOAD_FONT8 34 | #define LOAD_GFXFF 35 | 36 | #define SMOOTH_FONT -------------------------------------------------------------------------------- /TFT_Drivers/S6D02A1_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the S6D02A1 driver coordinate frame 3 | 4 | rotation = m % 4; 5 | 6 | writecommand(TFT_MADCTL); 7 | switch (rotation) { 8 | case 0: 9 | writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR); 10 | _width = _init_width; 11 | _height = _init_height; 12 | break; 13 | case 1: 14 | writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR); 15 | _width = _init_height; 16 | _height = _init_width; 17 | break; 18 | case 2: 19 | writedata(TFT_MAD_BGR); 20 | _width = _init_width; 21 | _height = _init_height; 22 | break; 23 | case 3: 24 | writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR); 25 | _width = _init_height; 26 | _height = _init_width; 27 | break; 28 | } 29 | -------------------------------------------------------------------------------- /TFT_Drivers/SSD1963_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the SSD1963 driver coordinate frame 3 | 4 | rotation = m % 4; // Limit the range of values to 0-3 5 | 6 | writecommand(TFT_MADCTL); 7 | switch (rotation) { 8 | case 0: 9 | writedata(0x21 | TFT_MAD_COLOR_ORDER); 10 | _width = _init_width; 11 | _height = _init_height; 12 | break; 13 | case 1: 14 | writedata(0x00 | TFT_MAD_COLOR_ORDER); 15 | _width = _init_height; 16 | _height = _init_width; 17 | break; 18 | case 2: 19 | writedata(0x22 | TFT_MAD_COLOR_ORDER); 20 | _width = _init_width; 21 | _height = _init_height; 22 | break; 23 | case 3: 24 | writedata(0x03 | TFT_MAD_COLOR_ORDER); 25 | _width = _init_height; 26 | _height = _init_width; 27 | break; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /TFT_Drivers/ILI9481_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the ILI9481 driver coordinate frame 2 | 3 | writecommand(TFT_MADCTL); 4 | rotation = m % 4; 5 | switch (rotation) { 6 | case 0: // Portrait 7 | writedata(TFT_MAD_BGR | TFT_MAD_SS); 8 | _width = TFT_WIDTH; 9 | _height = TFT_HEIGHT; 10 | break; 11 | case 1: // Landscape (Portrait + 90) 12 | writedata(TFT_MAD_MV | TFT_MAD_BGR); 13 | _width = TFT_HEIGHT; 14 | _height = TFT_WIDTH; 15 | break; 16 | case 2: // Inverter portrait 17 | writedata(TFT_MAD_BGR | TFT_MAD_GS); 18 | _width = TFT_WIDTH; 19 | _height = TFT_HEIGHT; 20 | break; 21 | case 3: // Inverted landscape 22 | writedata(TFT_MAD_MV | TFT_MAD_BGR | TFT_MAD_SS | TFT_MAD_GS); 23 | _width = TFT_HEIGHT; 24 | _height = TFT_WIDTH; 25 | break; 26 | } 27 | -------------------------------------------------------------------------------- /TFT_Drivers/ILI9488_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the ILI9488 driver coordinate frame 2 | 3 | writecommand(TFT_MADCTL); 4 | rotation = m % 4; 5 | switch (rotation) { 6 | case 0: // Portrait 7 | writedata(TFT_MAD_MX | TFT_MAD_BGR); 8 | _width = TFT_WIDTH; 9 | _height = TFT_HEIGHT; 10 | break; 11 | case 1: // Landscape (Portrait + 90) 12 | writedata(TFT_MAD_MV | TFT_MAD_BGR); 13 | _width = TFT_HEIGHT; 14 | _height = TFT_WIDTH; 15 | break; 16 | case 2: // Inverter portrait 17 | writedata(TFT_MAD_MY | TFT_MAD_BGR); 18 | _width = TFT_WIDTH; 19 | _height = TFT_HEIGHT; 20 | break; 21 | case 3: // Inverted landscape 22 | writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_BGR); 23 | _width = TFT_HEIGHT; 24 | _height = TFT_WIDTH; 25 | break; 26 | } 27 | -------------------------------------------------------------------------------- /TFT_Drivers/R61581_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the R61581 driver coordinate frame 2 | 3 | writecommand(TFT_MADCTL); 4 | rotation = m % 4; 5 | switch (rotation) { 6 | case 0: // Portrait 7 | writedata(TFT_MAD_BGR | TFT_MAD_MX); 8 | _width = TFT_WIDTH; 9 | _height = TFT_HEIGHT; 10 | break; 11 | case 1: // Landscape (Portrait + 90) 12 | writedata(TFT_MAD_MV | TFT_MAD_BGR); 13 | _width = TFT_HEIGHT; 14 | _height = TFT_WIDTH; 15 | break; 16 | case 2: // Inverter portrait 17 | writedata(TFT_MAD_BGR | TFT_MAD_GS); 18 | _width = TFT_WIDTH; 19 | _height = TFT_HEIGHT; 20 | break; 21 | case 3: // Inverted landscape 22 | writedata(TFT_MAD_MV | TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_GS); 23 | _width = TFT_HEIGHT; 24 | _height = TFT_WIDTH; 25 | break; 26 | } 27 | -------------------------------------------------------------------------------- /examples/PNG Images/LittleFS_PNG/PNG_FS_Support.ino: -------------------------------------------------------------------------------- 1 | // Here are the callback functions that the decPNG library 2 | // will use to open files, fetch data and close the file. 3 | 4 | File pngfile; 5 | 6 | void * pngOpen(const char *filename, int32_t *size) { 7 | Serial.printf("Attempting to open %s\n", filename); 8 | pngfile = FileSys.open(filename, "r"); 9 | *size = pngfile.size(); 10 | return &pngfile; 11 | } 12 | 13 | void pngClose(void *handle) { 14 | File pngfile = *((File*)handle); 15 | if (pngfile) pngfile.close(); 16 | } 17 | 18 | int32_t pngRead(PNGFILE *page, uint8_t *buffer, int32_t length) { 19 | if (!pngfile) return 0; 20 | page = page; // Avoid warning 21 | return pngfile.read(buffer, length); 22 | } 23 | 24 | int32_t pngSeek(PNGFILE *page, int32_t position) { 25 | if (!pngfile) return 0; 26 | page = page; // Avoid warning 27 | return pngfile.seek(position); 28 | } 29 | -------------------------------------------------------------------------------- /TFT_Drivers/RM68120_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the RM68120 driver coordinate frame 3 | 4 | rotation = m % 4; // Limit the range of values to 0-3 5 | uint8_t reg = 0; 6 | 7 | switch (rotation) { 8 | case 0: 9 | reg = TFT_MAD_COLOR_ORDER; 10 | _width = _init_width; 11 | _height = _init_height; 12 | break; 13 | case 1: 14 | reg = TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_COLOR_ORDER; 15 | _width = _init_height; 16 | _height = _init_width; 17 | break; 18 | case 2: 19 | reg = TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER; 20 | _width = _init_width; 21 | _height = _init_height; 22 | break; 23 | case 3: 24 | reg = TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER; 25 | _width = _init_height; 26 | _height = _init_width; 27 | break; 28 | } 29 | writeRegister16(TFT_MADCTL, reg); -------------------------------------------------------------------------------- /User_Setups/Setup22_TTGO_T4_v1.3.h: -------------------------------------------------------------------------------- 1 | // Setup for the TTGO T4 v1.3 ESP32 board with 2.2" ILI9341 display 2 | #define USER_SETUP_ID 99922 3 | 4 | // See SetupX_Template.h for all options available 5 | 6 | #define ILI9341_DRIVER 7 | 8 | #define TFT_BACKLIGHT_ON HIGH 9 | #define TFT_BL 4 10 | 11 | #define TFT_MISO 12 12 | #define TFT_MOSI 23 13 | #define TFT_SCLK 18 14 | 15 | #define TFT_CS 27 16 | #define TFT_DC 32 // pin 26 for TTGO T4 v1.3 17 | #define TFT_RST 5 18 | 19 | #define LOAD_GLCD 20 | #define LOAD_FONT2 21 | #define LOAD_FONT4 22 | #define LOAD_FONT6 23 | #define LOAD_FONT7 24 | #define LOAD_FONT8 25 | #define LOAD_GFXFF 26 | 27 | #define SMOOTH_FONT 28 | 29 | //#define SPI_FREQUENCY 27000000 30 | #define SPI_FREQUENCY 40000000 // Maximum for ILI9341 31 | 32 | #define USE_HSPI_PORT 33 | 34 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V 35 | -------------------------------------------------------------------------------- /examples/PNG Images/LittleFS_PNG_DMA/PNG_FS_Support.ino: -------------------------------------------------------------------------------- 1 | // Here are the callback functions that the decPNG library 2 | // will use to open files, fetch data and close the file. 3 | 4 | File pngfile; 5 | 6 | void * pngOpen(const char *filename, int32_t *size) { 7 | Serial.printf("Attempting to open %s\n", filename); 8 | pngfile = FileSys.open(filename, "r"); 9 | *size = pngfile.size(); 10 | return &pngfile; 11 | } 12 | 13 | void pngClose(void *handle) { 14 | File pngfile = *((File*)handle); 15 | if (pngfile) pngfile.close(); 16 | } 17 | 18 | int32_t pngRead(PNGFILE *page, uint8_t *buffer, int32_t length) { 19 | if (!pngfile) return 0; 20 | page = page; // Avoid warning 21 | return pngfile.read(buffer, length); 22 | } 23 | 24 | int32_t pngSeek(PNGFILE *page, int32_t position) { 25 | if (!pngfile) return 0; 26 | page = page; // Avoid warning 27 | return pngfile.seek(position); 28 | } 29 | -------------------------------------------------------------------------------- /TFT_Drivers/SSD1351_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the SSD1351 driver coordinate frame 3 | 4 | rotation = m % 4; // Limit the range of values to 0-3 5 | 6 | uint8_t madctl = 0x64; 7 | 8 | switch (rotation) { 9 | case 0: 10 | madctl |= 0x10; 11 | _width = _init_width; 12 | _height = _init_height; 13 | break; 14 | case 1: 15 | madctl |= 0x13; 16 | _width = _init_height; 17 | _height = _init_width; 18 | break; 19 | case 2: 20 | madctl |= 0x02; 21 | _width = _init_width; 22 | _height = _init_height; 23 | break; 24 | case 3: 25 | madctl |= 0x01; 26 | _width = _init_height; 27 | _height = _init_width; 28 | break; 29 | } 30 | 31 | writecommand(0xA0); // SETREMAP 32 | writedata(madctl); 33 | writecommand(0xA1); // STARTLINE 34 | writedata(rotation < 2 ? TFT_HEIGHT : 0); 35 | -------------------------------------------------------------------------------- /TFT_Drivers/HX8357D_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the HX8357D driver coordinate frame 2 | 3 | writecommand(TFT_MADCTL); 4 | rotation = m % 4; 5 | switch (rotation) { 6 | case 0: // Portrait 7 | writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER); 8 | _width = _init_width; 9 | _height = _init_height; 10 | break; 11 | case 1: // Landscape (Portrait + 90) 12 | writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER); 13 | _width = _init_height; 14 | _height = _init_width; 15 | break; 16 | case 2: // Inverter portrait 17 | writedata(TFT_MAD_COLOR_ORDER); 18 | _width = _init_width; 19 | _height = _init_height; 20 | break; 21 | case 3: // Inverted landscape 22 | writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER); 23 | _width = _init_height; 24 | _height = _init_width; 25 | break; 26 | } 27 | -------------------------------------------------------------------------------- /examples/Test and diagnostics/TFT_ReadWrite_Test/TFT_ReadWrite_Test.ino: -------------------------------------------------------------------------------- 1 | // Walking 1 write and read pixel test 2 | 3 | #include 4 | #include 5 | 6 | #define TDELAY 500 7 | 8 | TFT_eSPI tft = TFT_eSPI(); 9 | 10 | void setup() { 11 | Serial.begin(115200); 12 | 13 | tft.init(); 14 | tft.fillScreen(0xF81F); 15 | } 16 | 17 | void loop() { 18 | static uint32_t wr = 1; 19 | static uint32_t rd = 0xFFFFFFFF; 20 | 21 | delay(TDELAY); 22 | 23 | tft.drawPixel(30,30,wr); 24 | Serial.print(" Pixel value written = ");Serial.println(wr,HEX); 25 | 26 | rd = tft.readPixel(30,30); 27 | Serial.print(" Pixel value read = ");Serial.println(rd,HEX); 28 | 29 | if (rd!=wr) { 30 | Serial.println(" ERROR ^^^^"); 31 | //while(1) yield(); 32 | } 33 | else Serial.println(" PASS "); 34 | // Walking 1 test 35 | wr = wr<<1; 36 | if (wr >= 0x10000) wr = 1; 37 | } 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # Arduino debug 21 | debug.cfg 22 | debug_custom.json 23 | *.svd 24 | 25 | # ========================= 26 | # Operating System Files 27 | # ========================= 28 | 29 | # OSX 30 | # ========================= 31 | 32 | .DS_Store 33 | .AppleDouble 34 | .LSOverride 35 | 36 | # Thumbnails 37 | ._* 38 | 39 | # Files that might appear in the root of a volume 40 | .DocumentRevisions-V100 41 | .fseventsd 42 | .Spotlight-V100 43 | .TemporaryItems 44 | .Trashes 45 | .VolumeIcon.icns 46 | 47 | # Directories potentially created on remote AFP share 48 | .AppleDB 49 | .AppleDesktop 50 | Network Trash Folder 51 | Temporary Items 52 | .apdisk 53 | -------------------------------------------------------------------------------- /library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TFT_eSPI", 3 | "version": "2.5.43", 4 | "keywords": "Arduino, tft, display, ttgo, LilyPi, WT32-SC01, ePaper, display, Pico, RP2040 Nano Connect, RP2040, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9481, ILI9486, ILI9488, ST7789, ST7796, RM68140, SSD1351, SSD1963, ILI9225, HX8357D, GC9A01, R61581", 5 | "description": "A TFT and ePaper (SPI or parallel interface) graphics library with optimisation for Raspberry Pi Pico, RP2040, ESP8266, ESP32 and STM32 processors", 6 | "repository": 7 | { 8 | "type": "git", 9 | "url": "https://github.com/Bodmer/TFT_eSPI" 10 | }, 11 | "authors": 12 | [ 13 | { 14 | "name": "Bodmer", 15 | "email": "bodmer@anola.net", 16 | "maintainer": true 17 | } 18 | ], 19 | "frameworks": "arduino", 20 | "platforms": "raspberrypi, espressif8266, espressif32, ststm32", 21 | "headers": "TFT_eSPI.h" 22 | } 23 | -------------------------------------------------------------------------------- /User_Setups/Setup17_ePaper.h: -------------------------------------------------------------------------------- 1 | #define EPD_DRIVER // ePaper driver 2 | 3 | #define TFT_MISO -1 4 | #define TFT_MOSI -1 5 | #define TFT_SCLK -1 6 | #define TFT_RST -1 7 | 8 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 9 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 10 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 11 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 12 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 13 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 14 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 15 | 16 | #define SMOOTH_FONT 17 | -------------------------------------------------------------------------------- /User_Setups/Setup22_TTGO_T4.h: -------------------------------------------------------------------------------- 1 | // Setup for the TTGO T4 v1.1 ("Bitcoin Tracker") ESP32 board with 2.2" ILI9341 display 2 | #define USER_SETUP_ID 22 3 | 4 | // See SetupX_Template.h for all options available 5 | 6 | #define ILI9341_DRIVER 7 | 8 | //#define TFT_BACKLIGHT_ON HIGH // LED control for TTGO T4 v1.3 only 9 | //#define TFT_BL 4 10 | 11 | #define TFT_MISO 12 12 | #define TFT_MOSI 23 13 | #define TFT_SCLK 18 14 | 15 | #define TFT_CS 27 16 | #define TFT_DC 26 // pin 32 for TTGO T4 v1.3 17 | #define TFT_RST 5 18 | 19 | #define TOUCH_CS -1 20 | 21 | #define LOAD_GLCD 22 | #define LOAD_FONT2 23 | #define LOAD_FONT4 24 | #define LOAD_FONT6 25 | #define LOAD_FONT7 26 | #define LOAD_FONT8 27 | #define LOAD_GFXFF 28 | 29 | #define SMOOTH_FONT 30 | 31 | //#define SPI_FREQUENCY 27000000 32 | #define SPI_FREQUENCY 40000000 // Maximum for ILI9341 33 | 34 | #define USE_HSPI_PORT 35 | 36 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V 37 | -------------------------------------------------------------------------------- /User_Setups/Setup70h_ESP32_S3_GC9A01.h: -------------------------------------------------------------------------------- 1 | // Setup for the ESP32 S3 with GC9A01 display 2 | #define USER_SETUP_ID 70 3 | 4 | #define GC9A01_DRIVER 5 | 6 | #define TFT_WIDTH 240 7 | #define TFT_HEIGHT 240 8 | // Typical board default pins - change to match your board 9 | #define TFT_CS 10 //34 // 10 or 34 (FSPI CS0) 10 | #define TFT_MOSI 11 //35 // 11 or 35 (FSPI D) 11 | #define TFT_SCLK 12 //36 // 12 or 36 (FSPI CLK) 12 | #define TFT_MISO 13 //37 // 13 or 37 (FSPI Q) 13 | 14 | // Use pins in range 0-31 15 | #define TFT_DC 7 16 | #define TFT_RST 6 17 | 18 | #define LOAD_GLCD 19 | #define LOAD_FONT2 20 | #define LOAD_FONT4 21 | #define LOAD_FONT6 22 | #define LOAD_FONT7 23 | #define LOAD_FONT8 24 | #define LOAD_GFXFF 25 | 26 | #define SMOOTH_FONT 27 | 28 | // FSPI port (SPI2) used unless following defined 29 | #define USE_HSPI_PORT 30 | 31 | #define SPI_FREQUENCY 80000000 // Maximum for ILI9341 32 | -------------------------------------------------------------------------------- /User_Setups/Setup70d_ILI9488_S3_Parallel.h: -------------------------------------------------------------------------------- 1 | 2 | #define USER_SETUP_ID 146 3 | 4 | #define TFT_PARALLEL_8_BIT 5 | 6 | //#define ILI9341_DRIVER 7 | //#define ST7796_DRIVER 8 | #define ILI9488_DRIVER 9 | 10 | // ESP32 S3 pins used for the parallel interface TFT 11 | #define TFT_CS 9 12 | #define TFT_DC 8 // Data Command control pin - must use a GPIO in the range 0-31 13 | #define TFT_RST 34 14 | 15 | #define TFT_WR 7 // Write strobe control pin - must use a GPIO in the range 0-31 16 | #define TFT_RD 6 17 | 18 | #define TFT_D0 12 // Must use GPIO in the range 0-31 for the data bus 19 | #define TFT_D1 13 // so a single register write sets/clears all bits 20 | #define TFT_D2 14 21 | #define TFT_D3 15 22 | #define TFT_D4 16 23 | #define TFT_D5 21 24 | #define TFT_D6 5 25 | #define TFT_D7 4 26 | 27 | 28 | #define LOAD_GLCD 29 | #define LOAD_FONT2 30 | #define LOAD_FONT4 31 | #define LOAD_FONT6 32 | #define LOAD_FONT7 33 | #define LOAD_FONT8 34 | #define LOAD_GFXFF 35 | 36 | #define SMOOTH_FONT 37 | -------------------------------------------------------------------------------- /examples/PNG Images/Flash_transparent_PNG/png_support.ino: -------------------------------------------------------------------------------- 1 | 2 | // PNGdec support functions 3 | 4 | //=========================================v========================================== 5 | // pngDraw: Callback function to draw pixels to the display 6 | //==================================================================================== 7 | // This function will be called during decoding of the png file to render each image 8 | // line to the TFT. PNGdec generates the image line and a 1bpp mask. 9 | void pngDraw(PNGDRAW *pDraw) { 10 | uint16_t lineBuffer[MAX_IMAGE_WIDTH]; // Line buffer for rendering 11 | uint8_t maskBuffer[1 + MAX_IMAGE_WIDTH / 8]; // Mask buffer 12 | 13 | png.getLineAsRGB565(pDraw, lineBuffer, PNG_RGB565_BIG_ENDIAN, 0xffffffff); 14 | 15 | if (png.getAlphaMask(pDraw, maskBuffer, 255)) { 16 | // Note: pushMaskedImage is for pushing to the TFT and will not work pushing into a sprite 17 | tft.pushMaskedImage(xpos, ypos + pDraw->y, pDraw->iWidth, 1, lineBuffer, maskBuffer); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /TFT_Drivers/SSD1351_Init.h: -------------------------------------------------------------------------------- 1 | { 2 | writecommand(0xFD); // COMMANDLOCK 3 | writedata(0x12); 4 | writecommand(0xFD); // COMMANDLOCK 5 | writedata(0xB1); 6 | writecommand(0xAE); // DISPLAYOFF 7 | writecommand(0xB3); // CLOCKDIV 8 | writedata(0xF1); 9 | writecommand(0xCA); // MUXRATIO 10 | writedata(127); 11 | writecommand(0xA2); // DISPLAYOFFSET 12 | writedata(0x00); 13 | writecommand(0xB5); // SETGPIO 14 | writedata(0x00); 15 | writecommand(0xAB); // FUNCTIONSELECT 16 | writedata(0x01); 17 | writecommand(0xB1); // PRECHARGE 18 | writedata(0x32); 19 | writecommand(0xBE); // VCOMH 20 | writedata(0x05); 21 | writecommand(0xA6); // NORMALDISPLAY 22 | writecommand(0xC1); // CONTRASTABC 23 | writedata(0xC8); 24 | writedata(0x80); 25 | writedata(0xC8); 26 | writecommand(0xC7); // CONTRASTMASTER 27 | writedata(0x0F); 28 | writecommand(0xB4); // SETVSL 29 | writedata(0xA0); 30 | writedata(0xB5); 31 | writedata(0x55); 32 | writecommand(0xB6); // PRECHARGE2 33 | writedata(0x01); 34 | writecommand(0xAF); // DISPLAYON 35 | } 36 | -------------------------------------------------------------------------------- /examples/320 x 240/TFT_Ellipse/TFT_Ellipse.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Ellipse drawing example 3 | 4 | This sketch does not use any fonts. 5 | */ 6 | 7 | #include // Hardware-specific library 8 | #include 9 | 10 | TFT_eSPI tft = TFT_eSPI(); // Invoke custom library 11 | 12 | void setup(void) { 13 | tft.init(); 14 | 15 | tft.setRotation(1); 16 | 17 | } 18 | 19 | void loop() { 20 | 21 | tft.fillScreen(TFT_BLACK); 22 | 23 | // Draw some random ellipses 24 | for (int i = 0; i < 40; i++) 25 | { 26 | int rx = random(60); 27 | int ry = random(60); 28 | int x = rx + random(320 - rx - rx); 29 | int y = ry + random(240 - ry - ry); 30 | tft.fillEllipse(x, y, rx, ry, random(0xFFFF)); 31 | } 32 | 33 | delay(2000); 34 | tft.fillScreen(TFT_BLACK); 35 | 36 | for (int i = 0; i < 40; i++) 37 | { 38 | int rx = random(60); 39 | int ry = random(60); 40 | int x = rx + random(320 - rx - rx); 41 | int y = ry + random(240 - ry - ry); 42 | tft.drawEllipse(x, y, rx, ry, random(0xFFFF)); 43 | } 44 | 45 | delay(2000); 46 | } 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /examples/480 x 320/TFT_Ellipse/TFT_Ellipse.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Ellipse drawing example 3 | 4 | This sketch does not use any fonts. 5 | */ 6 | 7 | #include 8 | 9 | #include // Hardware-specific library 10 | 11 | TFT_eSPI tft = TFT_eSPI(); // Invoke custom library 12 | 13 | 14 | void setup(void) { 15 | tft.init(); 16 | 17 | tft.setRotation(1); 18 | 19 | } 20 | 21 | void loop() { 22 | 23 | tft.fillScreen(TFT_BLACK); 24 | 25 | // Draw some random circles 26 | for (int i = 0; i < 40; i++) 27 | { 28 | int rx = random(60); 29 | int ry = random(60); 30 | int x = rx + random(480 - rx - rx); 31 | int y = ry + random(320 - ry - ry); 32 | tft.fillEllipse(x, y, rx, ry, random(0xFFFF)); 33 | } 34 | 35 | delay(2000); 36 | tft.fillScreen(TFT_BLACK); 37 | 38 | for (int i = 0; i < 40; i++) 39 | { 40 | int rx = random(60); 41 | int ry = random(60); 42 | int x = rx + random(480 - rx - rx); 43 | int y = ry + random(320 - ry - ry); 44 | tft.drawEllipse(x, y, rx, ry, random(0xFFFF)); 45 | } 46 | 47 | delay(2000); 48 | } 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /TFT_Drivers/GC9A01_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #ifndef TFT_WIDTH 4 | #define TFT_WIDTH 240 5 | #endif 6 | #ifndef TFT_HEIGHT 7 | #define TFT_HEIGHT 240 8 | #endif 9 | 10 | // Delay between some initialisation commands 11 | #define TFT_INIT_DELAY 0x80 12 | 13 | // Generic commands used by TFT_eSPI.cpp 14 | #define TFT_NOP 0x00 15 | #define TFT_SWRST 0x01 16 | 17 | #define TFT_SLPIN 0x10 18 | #define TFT_SLPOUT 0x11 19 | 20 | #define TFT_INVOFF 0x20 21 | #define TFT_INVON 0x21 22 | 23 | #define TFT_DISPOFF 0x28 24 | #define TFT_DISPON 0x29 25 | 26 | #define TFT_CASET 0x2A 27 | #define TFT_PASET 0x2B 28 | #define TFT_RAMWR 0x2C 29 | 30 | #define TFT_RAMRD 0x2E 31 | #define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read 32 | 33 | #define TFT_MADCTL 0x36 34 | #define TFT_MAD_MY 0x80 35 | #define TFT_MAD_MX 0x40 36 | #define TFT_MAD_MV 0x20 37 | #define TFT_MAD_ML 0x10 38 | #define TFT_MAD_BGR 0x08 39 | #define TFT_MAD_MH 0x04 40 | #define TFT_MAD_RGB 0x00 41 | -------------------------------------------------------------------------------- /User_Setups/Setup25_TTGO_T_Display.h: -------------------------------------------------------------------------------- 1 | // Setup for the TTGO T Display 2 | #define USER_SETUP_ID 25 3 | 4 | // See SetupX_Template.h for all options available 5 | 6 | #define ST7789_DRIVER 7 | #define TFT_SDA_READ // Display has a bidirectional SDA pin 8 | 9 | #define TFT_WIDTH 135 10 | #define TFT_HEIGHT 240 11 | 12 | #define CGRAM_OFFSET // Library will add offsets required 13 | 14 | //#define TFT_MISO -1 15 | 16 | #define TFT_MOSI 19 17 | #define TFT_SCLK 18 18 | #define TFT_CS 5 19 | #define TFT_DC 16 20 | #define TFT_RST 23 21 | 22 | #define TFT_BL 4 // Display backlight control pin 23 | 24 | #define TFT_BACKLIGHT_ON HIGH // HIGH or LOW are options 25 | 26 | #define LOAD_GLCD 27 | #define LOAD_FONT2 28 | #define LOAD_FONT4 29 | #define LOAD_FONT6 30 | #define LOAD_FONT7 31 | #define LOAD_FONT8 32 | #define LOAD_GFXFF 33 | 34 | #define SMOOTH_FONT 35 | 36 | //#define SPI_FREQUENCY 27000000 37 | #define SPI_FREQUENCY 40000000 38 | 39 | 40 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V 41 | -------------------------------------------------------------------------------- /User_Setups/Setup206_LilyGo_T_Display_S3.h: -------------------------------------------------------------------------------- 1 | // ST7789 using 8-bit Parallel 2 | 3 | #define USER_SETUP_ID 206 4 | 5 | #define ST7789_DRIVER 6 | #define INIT_SEQUENCE_3 // Using this initialisation sequence improves the display image 7 | 8 | #define CGRAM_OFFSET 9 | #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 10 | //#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 11 | 12 | #define TFT_INVERSION_ON 13 | // #define TFT_INVERSION_OFF 14 | 15 | #define TFT_PARALLEL_8_BIT 16 | 17 | #define TFT_WIDTH 170 18 | #define TFT_HEIGHT 320 19 | 20 | #define TFT_CS 6 21 | #define TFT_DC 7 22 | #define TFT_RST 5 23 | 24 | #define TFT_WR 8 25 | #define TFT_RD 9 26 | 27 | #define TFT_D0 39 28 | #define TFT_D1 40 29 | #define TFT_D2 41 30 | #define TFT_D3 42 31 | #define TFT_D4 45 32 | #define TFT_D5 46 33 | #define TFT_D6 47 34 | #define TFT_D7 48 35 | 36 | #define TFT_BL 38 37 | #define TFT_BACKLIGHT_ON HIGH 38 | 39 | #define LOAD_GLCD 40 | #define LOAD_FONT2 41 | #define LOAD_FONT4 42 | #define LOAD_FONT6 43 | #define LOAD_FONT7 44 | #define LOAD_FONT8 45 | #define LOAD_GFXFF 46 | 47 | #define SMOOTH_FONT 48 | -------------------------------------------------------------------------------- /User_Setups/Setup70_ESP32_S2_ILI9341.h: -------------------------------------------------------------------------------- 1 | // Setup for the ESP32 S2 with ILI9341 display 2 | // Note SPI DMA with ESP32 S2 is not currently supported 3 | #define USER_SETUP_ID 70 4 | // See SetupX_Template.h for all options available 5 | #define ILI9341_DRIVER 6 | 7 | // Typical board default pins 8 | #define TFT_CS 10 // 10 or 34 9 | 10 | #define TFT_MOSI 11 // 11 or 35 11 | #define TFT_SCLK 12 // 12 or 36 12 | #define TFT_MISO 13 // 13 or 37 13 | 14 | #define TFT_DC 14 15 | #define TFT_RST 15 16 | 17 | //#define TOUCH_CS 16 // Optional for touch screen 18 | 19 | #define LOAD_GLCD 20 | #define LOAD_FONT2 21 | #define LOAD_FONT4 22 | #define LOAD_FONT6 23 | #define LOAD_FONT7 24 | #define LOAD_FONT8 25 | #define LOAD_GFXFF 26 | 27 | #define SMOOTH_FONT 28 | 29 | // FSPI port will be used unless the following is defined 30 | #define USE_HSPI_PORT 31 | 32 | //#define SPI_FREQUENCY 27000000 33 | #define SPI_FREQUENCY 40000000 // Maximum for ILI9341 34 | 35 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V 36 | 37 | #define SPI_TOUCH_FREQUENCY 2500000 38 | -------------------------------------------------------------------------------- /examples/160 x 128/TFT_Ellipse/TFT_Ellipse.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Ellipse drawing example 3 | 4 | This sketch does not use any fonts. 5 | */ 6 | 7 | #include // Hardware-specific library 8 | #include 9 | 10 | TFT_eSPI tft = TFT_eSPI(); // Invoke custom library 11 | 12 | void setup(void) { 13 | tft.init(); 14 | 15 | tft.setRotation(1); 16 | 17 | } 18 | 19 | void loop() { 20 | 21 | tft.fillScreen(TFT_BLACK); 22 | 23 | // Draw some random filled ellipses 24 | for (int i = 0; i < 20; i++) 25 | { 26 | int rx = random(40); 27 | int ry = random(40); 28 | int x = rx + random(160 - rx - rx); 29 | int y = ry + random(128 - ry - ry); 30 | tft.fillEllipse(x, y, rx, ry, random(0xFFFF)); 31 | } 32 | 33 | delay(2000); 34 | tft.fillScreen(TFT_BLACK); 35 | 36 | // Draw some random outline ellipses 37 | for (int i = 0; i < 20; i++) 38 | { 39 | int rx = random(40); 40 | int ry = random(40); 41 | int x = rx + random(160 - rx - rx); 42 | int y = ry + random(128 - ry - ry); 43 | tft.drawEllipse(x, y, rx, ry, random(0xFFFF)); 44 | } 45 | 46 | delay(2000); 47 | } 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /TFT_Drivers/ILI9481_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #define TFT_WIDTH 320 4 | #define TFT_HEIGHT 480 5 | 6 | 7 | // Delay between some initialisation commands 8 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 9 | 10 | 11 | // Generic commands used by TFT_eSPI.cpp 12 | #define TFT_NOP 0x00 13 | #define TFT_SWRST 0x01 14 | 15 | #define TFT_SLPIN 0x10 16 | #define TFT_SLPOUT 0x11 17 | 18 | #define TFT_INVOFF 0x20 19 | #define TFT_INVON 0x21 20 | 21 | #define TFT_DISPOFF 0x28 22 | #define TFT_DISPON 0x29 23 | 24 | #define TFT_CASET 0x2A 25 | #define TFT_PASET 0x2B 26 | #define TFT_RAMWR 0x2C 27 | 28 | #define TFT_RAMRD 0x2E 29 | 30 | #define TFT_MADCTL 0x36 31 | 32 | #define TFT_MAD_MY 0x80 33 | #define TFT_MAD_MX 0x40 34 | #define TFT_MAD_MV 0x20 35 | #define TFT_MAD_ML 0x10 36 | #define TFT_MAD_RGB 0x00 37 | #define TFT_MAD_BGR 0x08 38 | #define TFT_MAD_MH 0x04 39 | #define TFT_MAD_SS 0x02 40 | #define TFT_MAD_GS 0x01 41 | 42 | #define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read 43 | -------------------------------------------------------------------------------- /TFT_Drivers/ILI9488_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #define TFT_WIDTH 320 4 | #define TFT_HEIGHT 480 5 | 6 | 7 | // Delay between some initialisation commands 8 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 9 | 10 | 11 | // Generic commands used by TFT_eSPI.cpp 12 | #define TFT_NOP 0x00 13 | #define TFT_SWRST 0x01 14 | 15 | #define TFT_SLPIN 0x10 16 | #define TFT_SLPOUT 0x11 17 | 18 | #define TFT_INVOFF 0x20 19 | #define TFT_INVON 0x21 20 | 21 | #define TFT_DISPOFF 0x28 22 | #define TFT_DISPON 0x29 23 | 24 | #define TFT_CASET 0x2A 25 | #define TFT_PASET 0x2B 26 | #define TFT_RAMWR 0x2C 27 | 28 | #define TFT_RAMRD 0x2E 29 | 30 | #define TFT_MADCTL 0x36 31 | 32 | #define TFT_MAD_MY 0x80 33 | #define TFT_MAD_MX 0x40 34 | #define TFT_MAD_MV 0x20 35 | #define TFT_MAD_ML 0x10 36 | #define TFT_MAD_RGB 0x00 37 | #define TFT_MAD_BGR 0x08 38 | #define TFT_MAD_MH 0x04 39 | #define TFT_MAD_SS 0x02 40 | #define TFT_MAD_GS 0x01 41 | 42 | #define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read 43 | -------------------------------------------------------------------------------- /TFT_Drivers/R61581_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #define TFT_WIDTH 320 4 | #define TFT_HEIGHT 480 5 | 6 | 7 | // Delay between some initialisation commands 8 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 9 | 10 | 11 | // Generic commands used by TFT_eSPI.cpp 12 | #define TFT_NOP 0x00 13 | #define TFT_SWRST 0x01 14 | 15 | #define TFT_SLPIN 0x10 16 | #define TFT_SLPOUT 0x11 17 | 18 | #define TFT_INVOFF 0x20 19 | #define TFT_INVON 0x21 20 | 21 | #define TFT_DISPOFF 0x28 22 | #define TFT_DISPON 0x29 23 | 24 | #define TFT_CASET 0x2A 25 | #define TFT_PASET 0x2B 26 | #define TFT_RAMWR 0x2C 27 | 28 | #define TFT_RAMRD 0x2E 29 | 30 | #define TFT_MADCTL 0x36 31 | 32 | #define TFT_MAD_MY 0x80 33 | #define TFT_MAD_MX 0x40 34 | #define TFT_MAD_MV 0x20 35 | #define TFT_MAD_ML 0x10 36 | #define TFT_MAD_RGB 0x00 37 | #define TFT_MAD_BGR 0x08 38 | #define TFT_MAD_MH 0x04 39 | #define TFT_MAD_SS 0x02 40 | #define TFT_MAD_GS 0x01 41 | 42 | #define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read 43 | -------------------------------------------------------------------------------- /TFT_Drivers/RM68140_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #define TFT_WIDTH 320 4 | #define TFT_HEIGHT 480 5 | 6 | 7 | // Delay between some initialisation commands 8 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 9 | 10 | 11 | // Generic commands used by TFT_eSPI.cpp 12 | #define TFT_NOP 0x00 13 | #define TFT_SWRST 0x01 14 | 15 | #define TFT_SLPIN 0x10 16 | #define TFT_SLPOUT 0x11 17 | 18 | #define TFT_INVOFF 0x20 19 | #define TFT_INVON 0x21 20 | 21 | #define TFT_DISPOFF 0x28 22 | #define TFT_DISPON 0x29 23 | 24 | #define TFT_CASET 0x2A 25 | #define TFT_PASET 0x2B 26 | #define TFT_RAMWR 0x2C 27 | 28 | #define TFT_RAMRD 0x2E 29 | 30 | #define TFT_MADCTL 0x36 31 | 32 | #define TFT_MAD_MY 0x80 33 | #define TFT_MAD_MX 0x40 34 | #define TFT_MAD_MV 0x20 35 | #define TFT_MAD_ML 0x10 36 | #define TFT_MAD_RGB 0x00 37 | #define TFT_MAD_BGR 0x08 38 | #define TFT_MAD_MH 0x04 39 | #define TFT_MAD_SS 0x02 40 | #define TFT_MAD_GS 0x01 41 | 42 | #define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read 43 | -------------------------------------------------------------------------------- /TFT_Drivers/ILI9163_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the ILI9163 driver coordinate frame 3 | 4 | rotation = m % 4; 5 | 6 | writecommand(TFT_MADCTL); 7 | switch (rotation) { 8 | case 0: 9 | writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR); 10 | _width = _init_width; 11 | _height = _init_height; 12 | #ifdef CGRAM_OFFSET 13 | colstart = 0; 14 | rowstart = 0; 15 | #endif 16 | break; 17 | case 1: 18 | writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR); 19 | _width = _init_height; 20 | _height = _init_width; 21 | #ifdef CGRAM_OFFSET 22 | colstart = 0; 23 | rowstart = 0; 24 | #endif 25 | break; 26 | case 2: 27 | writedata(TFT_MAD_BGR); 28 | _width = _init_width; 29 | _height = _init_height; 30 | #ifdef CGRAM_OFFSET 31 | colstart = 0; 32 | rowstart = 32; 33 | #endif 34 | break; 35 | case 3: 36 | writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR); 37 | _width = _init_height; 38 | _height = _init_width; 39 | #ifdef CGRAM_OFFSET 40 | colstart = 32; 41 | rowstart = 0; 42 | #endif 43 | break; 44 | } 45 | -------------------------------------------------------------------------------- /User_Setups/Setup70f_ESP32_S2_ST7735.h: -------------------------------------------------------------------------------- 1 | // Setup for the ESP32 S2 with ST7735 80x160 display 2 | // See SetupX_Template.h for all options available 3 | 4 | #define USER_SETUP_ID 70 5 | 6 | #define ST7735_DRIVER 7 | 8 | #define TFT_SDA_READ // Display has a bidirectional SDA pin (no MISO) 9 | 10 | #define TFT_WIDTH 80 11 | #define TFT_HEIGHT 160 12 | 13 | #define ST7735_GREENTAB160x80 14 | //#define ST7735_REDTAB160x80 15 | 16 | //#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 17 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 18 | 19 | #define TFT_INVERSION_ON 20 | // #define TFT_INVERSION_OFF 21 | 22 | // Typical board default pins 23 | #define TFT_CS 10 // 10 or 34 24 | 25 | #define TFT_MOSI 11 // 11 or 35 26 | #define TFT_SCLK 12 // 12 or 36 27 | 28 | #define TFT_DC 14 29 | #define TFT_RST 15 30 | 31 | #define LOAD_GLCD 32 | #define LOAD_FONT2 33 | #define LOAD_FONT4 34 | #define LOAD_FONT6 35 | #define LOAD_FONT7 36 | #define LOAD_FONT8 37 | #define LOAD_GFXFF 38 | 39 | #define SMOOTH_FONT 40 | 41 | // FSPI port must be used for SDA reads. Do not use #define USE_HSPI_PORT 42 | 43 | #define SPI_FREQUENCY 27000000 44 | #define SPI_READ_FREQUENCY 16000000 45 | -------------------------------------------------------------------------------- /examples/Generic/Gradient_Fill/Gradient_Fill.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This sketch demonstrates the use of the horizontal and vertical gradient 3 | rectangle fill functions. 4 | 5 | Example for library: 6 | https://github.com/Bodmer/TFT_eSPI 7 | 8 | Created by Bodmer 27/1/22 9 | */ 10 | 11 | #include // Include the graphics library 12 | TFT_eSPI tft = TFT_eSPI(); // Create object "tft" 13 | 14 | // ------------------------------------------------------------------------- 15 | // Setup 16 | // ------------------------------------------------------------------------- 17 | void setup(void) { 18 | tft.init(); 19 | tft.setRotation(1); 20 | tft.fillScreen(TFT_DARKGREY); 21 | tft.setTextFont(2); 22 | } 23 | 24 | // ------------------------------------------------------------------------- 25 | // Main loop 26 | // ------------------------------------------------------------------------- 27 | void loop() 28 | { 29 | tft.fillRectHGradient(0, 0, 160, 50, TFT_MAGENTA, TFT_BLUE); 30 | tft.setCursor(10,10); 31 | tft.print("Horizontal gradient"); 32 | 33 | tft.fillRectVGradient(0, 60, 160, 50, TFT_ORANGE, TFT_RED); 34 | tft.setCursor(10,70); 35 | tft.print("Vertical gradient"); 36 | 37 | while(1) delay(100); // Wait here 38 | } 39 | -------------------------------------------------------------------------------- /User_Setups/Setup70b_ESP32_S3_ILI9341.h: -------------------------------------------------------------------------------- 1 | // Setup for the ESP32 S3 with ILI9341 display 2 | // Note SPI DMA with ESP32 S3 is not currently supported 3 | #define USER_SETUP_ID 70 4 | // See SetupX_Template.h for all options available 5 | #define ILI9341_DRIVER 6 | 7 | // Typical board default pins - change to match your board 8 | #define TFT_CS 34 // 10 or 34 (FSPI CS0) 9 | #define TFT_MOSI 35 // 11 or 35 (FSPI D) 10 | #define TFT_SCLK 36 // 12 or 36 (FSPI CLK) 11 | #define TFT_MISO 37 // 13 or 37 (FSPI Q) 12 | 13 | // Use pins in range 0-31 14 | #define TFT_DC 7 15 | #define TFT_RST 6 16 | 17 | //#define TOUCH_CS 16 // Optional for touch screen 18 | 19 | #define LOAD_GLCD 20 | #define LOAD_FONT2 21 | #define LOAD_FONT4 22 | #define LOAD_FONT6 23 | #define LOAD_FONT7 24 | #define LOAD_FONT8 25 | #define LOAD_GFXFF 26 | 27 | #define SMOOTH_FONT 28 | 29 | // FSPI (or VSPI) port (SPI2) used unless following defined. HSPI port is (SPI3) on S3. 30 | //#define USE_HSPI_PORT 31 | 32 | //#define SPI_FREQUENCY 27000000 33 | #define SPI_FREQUENCY 40000000 // Maximum for ILI9341 34 | 35 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V 36 | 37 | #define SPI_TOUCH_FREQUENCY 2500000 38 | -------------------------------------------------------------------------------- /TFT_Drivers/RM68140_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the RM68140 driver coordinate frame 2 | 3 | 4 | writecommand(TFT_MADCTL); 5 | rotation = m % 4; 6 | switch (rotation) { 7 | case 0: // Portrait 8 | writedata(TFT_MAD_BGR); 9 | writecommand(0xB6); 10 | writedata(0); 11 | writedata(0x22); 12 | writedata(0x3B); 13 | _width = TFT_WIDTH; 14 | _height = TFT_HEIGHT; 15 | break; 16 | case 1: // Landscape (Portrait + 90) 17 | writedata(TFT_MAD_MV | TFT_MAD_BGR); 18 | writecommand(0xB6); 19 | writedata(0); 20 | writedata(0x02); 21 | writedata(0x3B); 22 | _width = TFT_HEIGHT; 23 | _height = TFT_WIDTH; 24 | break; 25 | case 2: // Inverter portrait 26 | writedata(TFT_MAD_BGR); 27 | writecommand(0xB6); 28 | writedata(0); 29 | writedata(0x42); 30 | writedata(0x3B); 31 | _width = TFT_WIDTH; 32 | _height = TFT_HEIGHT; 33 | break; 34 | case 3: // Inverted landscape 35 | writedata(TFT_MAD_MV | TFT_MAD_BGR); 36 | writecommand(0xB6); 37 | writedata(0); 38 | writedata(0x62); 39 | writedata(0x3B); 40 | _width = TFT_HEIGHT; 41 | _height = TFT_WIDTH; 42 | break; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_1/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_2/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_4/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_1/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_2/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_4/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/FLASH_Array/Font_Demo_1_Array/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/FLASH_Array/Font_Demo_2_Array/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/FLASH_Array/Font_Demo_4_Array/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | //These are the text plotting alignment (reference datum point) 7 | 8 | TL_DATUM = Top left (default) 9 | TC_DATUM = Top centre 10 | TR_DATUM = Top right 11 | 12 | ML_DATUM = Middle left 13 | MC_DATUM = Middle centre 14 | MR_DATUM = Middle right 15 | 16 | BL_DATUM = Bottom left 17 | BC_DATUM = Bottom centre 18 | BR_DATUM = Bottom right 19 | 20 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 21 | C_BASELINE = Centre character baseline 22 | R_BASELINE = Right character baseline 23 | 24 | // Basic colours already defined: 25 | 26 | TFT_BLACK 0x0000 27 | TFT_NAVY 0x000F 28 | TFT_DARKGREEN 0x03E0 29 | TFT_DARKCYAN 0x03EF 30 | TFT_MAROON 0x7800 31 | TFT_PURPLE 0x780F 32 | TFT_OLIVE 0x7BE0 33 | TFT_LIGHTGREY 0xC618 34 | TFT_DARKGREY 0x7BEF 35 | TFT_BLUE 0x001F 36 | TFT_GREEN 0x07E0 37 | TFT_CYAN 0x07FF 38 | TFT_RED 0xF800 39 | TFT_MAGENTA 0xF81F 40 | TFT_YELLOW 0xFFE0 41 | TFT_WHITE 0xFFFF 42 | TFT_ORANGE 0xFDA0 43 | TFT_GREENYELLOW 0xB7E0 44 | TFT_PINK 0xFC9F 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | */ 57 | -------------------------------------------------------------------------------- /User_Setups/Setup23_TTGO_TM.h: -------------------------------------------------------------------------------- 1 | // Setup for the TTGO TM (Music) ESP32 board with 2.4" ST7789V display 2 | #define USER_SETUP_ID 23 3 | 4 | // See SetupX_Template.h for all options available 5 | 6 | #define ST7789_DRIVER 7 | 8 | #define TFT_SDA_READ // Read from display, it only provides an SDA pin 9 | 10 | #define TFT_MISO 19 // Must be defined even though it is not used 11 | #define TFT_MOSI 23 // Connected to display SDA line 12 | #define TFT_SCLK 18 13 | 14 | #define TFT_CS 05 15 | #define TFT_DC 16 16 | #define TFT_RST 17 17 | 18 | #define TOUCH_CS -1 19 | 20 | #define TFT_WIDTH 240 21 | #define TFT_HEIGHT 320 22 | 23 | //#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 24 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 25 | 26 | // Black and white swap option 27 | //#define TFT_INVERSION_ON 28 | #define TFT_INVERSION_OFF 29 | 30 | #define LOAD_GLCD 31 | #define LOAD_FONT2 32 | #define LOAD_FONT4 33 | #define LOAD_FONT6 34 | #define LOAD_FONT7 35 | #define LOAD_FONT8 36 | #define LOAD_GFXFF 37 | 38 | #define SMOOTH_FONT 39 | 40 | #define SPI_FREQUENCY 40000000 // This display also seems to work reliably at 80MHz 41 | //#define SPI_FREQUENCY 80000000 42 | 43 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V 44 | -------------------------------------------------------------------------------- /User_Setups/Setup70c_ESP32_C3_ILI9341.h: -------------------------------------------------------------------------------- 1 | // Setup for the ESP32 C3 with ILI9341 display 2 | // Note SPI DMA with ESP32 C3 is not currently supported 3 | 4 | #define USER_SETUP_ID 70 5 | // See SetupX_Template.h for all options available 6 | 7 | #define ILI9341_DRIVER 8 | //#define ST7796_DRIVER 9 | //#define ILI9488_DRIVER 10 | 11 | // Adafruit qtpy default 12 | //TFT_CS 6 13 | //TFT_MOSI 7 14 | //TFT_MISO 8 15 | //TFT_SCLK 10 16 | 17 | // Lolin C3 mini default 18 | //TFT_CS 5 19 | //TFT_MOSI 4 20 | //TFT_MISO 3 21 | //TFT_SCLK 2 22 | 23 | //ESP32 C3 generic default 24 | //TFT_CS 7 25 | //TFT_MOSI 6 26 | //TFT_MISO 5 27 | //TFT_SCLK 4 28 | 29 | 30 | #define TFT_CS 7 31 | 32 | #define TFT_MOSI 6 33 | #define TFT_MISO 5 34 | #define TFT_SCLK 4 35 | 36 | #define TFT_DC 8 37 | #define TFT_RST 10 38 | 39 | //#define TOUCH_CS 1 // Optional for touch screen 40 | 41 | #define LOAD_GLCD 42 | #define LOAD_FONT2 43 | #define LOAD_FONT4 44 | #define LOAD_FONT6 45 | #define LOAD_FONT7 46 | #define LOAD_FONT8 47 | #define LOAD_GFXFF 48 | 49 | #define SMOOTH_FONT 50 | 51 | //#define SPI_FREQUENCY 27000000 52 | #define SPI_FREQUENCY 40000000 // Maximum for ILI9341 53 | 54 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V 55 | 56 | #define SPI_TOUCH_FREQUENCY 2500000 57 | -------------------------------------------------------------------------------- /User_Setups/Setup251_ESP32_S3_Box.h: -------------------------------------------------------------------------------- 1 | // Display configuration for ILI9342-based ESP32-S3-Box 2 | 3 | #define USER_SETUP_ID 251 4 | #define USER_SETUP_INFO "ESP32-S3-BOX" 5 | 6 | #define M5STACK // S3-Box uses the same ILI9342 display, don't remove 7 | 8 | #define ILI9341_DRIVER 9 | 10 | #define TFT_MISO 0 11 | #define TFT_MOSI 6 12 | #define TFT_SCLK 7 13 | #define TFT_CS 5 // Chip select control pin 14 | #define TFT_DC 4 // Data Command control pin 15 | #define TFT_RST 48 // Reset pin (could connect to Arduino RESET pin) 16 | #define TFT_BL 45 // LED back-light 17 | 18 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 19 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 20 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 21 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 22 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 23 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 24 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 25 | 26 | #define SMOOTH_FONT 27 | 28 | #define SPI_FREQUENCY 27000000 29 | -------------------------------------------------------------------------------- /TFT_Drivers/ILI9225_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the ILI9225 driver coordinate frame 3 | 4 | rotation = m % 4; // Limit the range of values to 0-3 5 | 6 | switch (rotation) { 7 | case 0: 8 | writecommand(ILI9225_DRIVER_OUTPUT_CTRL); 9 | writedata(0x01);writedata(0x1C); 10 | writecommand(ILI9225_ENTRY_MODE); 11 | writedata(TFT_MAD_COLOR_ORDER);writedata(0x30); 12 | _width = _init_width; 13 | _height = _init_height; 14 | break; 15 | case 1: 16 | writecommand(ILI9225_DRIVER_OUTPUT_CTRL); 17 | writedata(0x00);writedata(0x1C); 18 | writecommand(ILI9225_ENTRY_MODE); 19 | writedata(TFT_MAD_COLOR_ORDER);writedata(0x38); 20 | _width = _init_height; 21 | _height = _init_width; 22 | break; 23 | case 2: 24 | writecommand(ILI9225_DRIVER_OUTPUT_CTRL); 25 | writedata(0x02);writedata(0x1C); 26 | writecommand(ILI9225_ENTRY_MODE); 27 | writedata(TFT_MAD_COLOR_ORDER);writedata(0x30); 28 | _width = _init_width; 29 | _height = _init_height; 30 | break; 31 | case 3: 32 | writecommand(ILI9225_DRIVER_OUTPUT_CTRL); 33 | writedata(0x03);writedata(0x1C); 34 | writecommand(ILI9225_ENTRY_MODE); 35 | writedata(TFT_MAD_COLOR_ORDER);writedata(0x38); 36 | _width = _init_height; 37 | _height = _init_width; 38 | break; 39 | } 40 | -------------------------------------------------------------------------------- /TFT_Drivers/HX8357B_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #define TFT_WIDTH 320 4 | #define TFT_HEIGHT 480 5 | 6 | 7 | // Delay between some initialisation commands 8 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 9 | 10 | 11 | // Generic commands used by TFT_eSPar.cpp 12 | #define TFT_NOP 0x00 13 | #define TFT_SWRST 0x01 14 | 15 | #define TFT_SLPIN 0x10 16 | #define TFT_SLPOUT 0x11 17 | 18 | #define TFT_INVOFF 0x20 19 | #define TFT_INVON 0x21 20 | 21 | #define TFT_DISPOFF 0x28 22 | #define TFT_DISPON 0x29 23 | 24 | #define TFT_CASET 0x2A 25 | #define TFT_PASET 0x2B 26 | #define TFT_RAMWR 0x2C 27 | 28 | #define TFT_RAMRD 0x2E 29 | 30 | #define TFT_MADCTL 0x36 31 | 32 | #define TFT_MAD_MY 0x80 33 | #define TFT_MAD_MX 0x40 34 | #define TFT_MAD_MV 0x20 35 | #define TFT_MAD_ML 0x10 36 | #define TFT_MAD_RGB 0x00 37 | #define TFT_MAD_BGR 0x08 38 | #define TFT_MAD_MH 0x04 39 | #define TFT_MAD_SS 0x02 40 | #define TFT_MAD_GS 0x01 41 | 42 | #ifdef TFT_RGB_ORDER 43 | #if (TFT_RGB_ORDER == 1) 44 | #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 45 | #else 46 | #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 47 | #endif 48 | #else 49 | #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 50 | #endif 51 | 52 | #define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read 53 | -------------------------------------------------------------------------------- /TFT_Drivers/HX8357C_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #define TFT_WIDTH 320 4 | #define TFT_HEIGHT 480 5 | 6 | 7 | // Delay between some initialisation commands 8 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 9 | 10 | 11 | // Generic commands used by TFT_eSPar.cpp 12 | #define TFT_NOP 0x00 13 | #define TFT_SWRST 0x01 14 | 15 | #define TFT_SLPIN 0x10 16 | #define TFT_SLPOUT 0x11 17 | 18 | #define TFT_INVOFF 0x20 19 | #define TFT_INVON 0x21 20 | 21 | #define TFT_DISPOFF 0x28 22 | #define TFT_DISPON 0x29 23 | 24 | #define TFT_CASET 0x2A 25 | #define TFT_PASET 0x2B 26 | #define TFT_RAMWR 0x2C 27 | 28 | #define TFT_RAMRD 0x2E 29 | 30 | #define TFT_MADCTL 0x36 31 | 32 | #define TFT_MAD_MY 0x80 33 | #define TFT_MAD_MX 0x40 34 | #define TFT_MAD_MV 0x20 35 | #define TFT_MAD_ML 0x10 36 | #define TFT_MAD_RGB 0x00 37 | #define TFT_MAD_BGR 0x08 38 | #define TFT_MAD_MH 0x04 39 | #define TFT_MAD_SS 0x02 40 | #define TFT_MAD_GS 0x01 41 | 42 | #ifdef TFT_RGB_ORDER 43 | #if (TFT_RGB_ORDER == 1) 44 | #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 45 | #else 46 | #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 47 | #endif 48 | #else 49 | #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 50 | #endif 51 | 52 | #define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read 53 | -------------------------------------------------------------------------------- /Tools/bmp2array4bit/README.md: -------------------------------------------------------------------------------- 1 | ## bmp2array4bit 2 | 3 | bmp2array4bit.py reads a bmp file, and creates C (or C++) code that contains two arrays for adding images to four-bit sprites. See [Sprite_image_4bit](../../examples/Sprite/Sprite_image_4bit) for an example. 4 | 5 | It is loosely based on Spark Fun's bmp2array script, https://github.com/sparkfun/BMPtoArray/blob/master/bmp2array.py. The bmp file format is documented in https://en.wikipedia.org/wiki/BMP_file_format. 6 | 7 | You'll need python 3.6 (the original uses Python 2.7) 8 | 9 | `usage: python bmp2array4bit.py [-v] star.bmp [-o myfile.c]` 10 | 11 | Create the bmp file in Gimp (www.gimp.org) from any image as follows: 12 | 13 | * Remove the alpha channel (if it has one) 14 | Layer -> Transparency -> Remove Alpha Channel 15 | * Set the mode to indexed. 16 | Image -> Mode -> Indexed... 17 | * Select Generate optimum palette with 16 colors (max) 18 | * Export the file with a .bmp extension. Do **NOT** select options: 19 | * Run-Length Encoded 20 | * Compatibility Options: "Do not write color space information" 21 | * There are no Advanced Options available with these settings 22 | 23 | (There are other tools that will produce bmp files, and these should work provided you don't use run-length encoding or other advanced features). 24 | 25 | The first array produced is the palette for the image. 26 | The second is the image itself. 27 | -------------------------------------------------------------------------------- /User_Setups/Setup45_TTGO_T_Watch.h: -------------------------------------------------------------------------------- 1 | #define USER_SETUP_ID 45 2 | 3 | #define ST7789_DRIVER 4 | 5 | #define TFT_WIDTH 240 6 | #define TFT_HEIGHT 240 7 | 8 | #define TFT_MISO -1 9 | #define TFT_MOSI 19 10 | #define TFT_SCLK 18 11 | #define TFT_CS 5 12 | #define TFT_DC 27 13 | 14 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 15 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 16 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 17 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 18 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 19 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 20 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 21 | #define SMOOTH_FONT 22 | 23 | // #define SPI_FREQUENCY 1000000 24 | // #define SPI_FREQUENCY 5000000 25 | // #define SPI_FREQUENCY 10000000 26 | // #define SPI_FREQUENCY 20000000 27 | // #define SPI_FREQUENCY 27000000 // Actually sets it to 26.67MHz = 80/3 28 | #define SPI_FREQUENCY 40000000 29 | //#define SPI_FREQUENCY 80000000 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /User_Setups/Setup46_GC9A01_ESP32.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 46 3 | 4 | #define GC9A01_DRIVER 5 | 6 | #define TFT_MISO 19 7 | #define TFT_MOSI 23 8 | #define TFT_SCLK 18 9 | #define TFT_CS 15 // Chip select control pin 10 | #define TFT_DC 2 // Data Command control pin 11 | #define TFT_RST 4 // Reset pin (could connect to RST pin) 12 | //#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST 13 | 14 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 15 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 16 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 17 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 18 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 19 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 20 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 21 | #define SMOOTH_FONT 22 | 23 | #define SPI_FREQUENCY 40000000 24 | 25 | #define SPI_READ_FREQUENCY 20000000 26 | 27 | #define SPI_TOUCH_FREQUENCY 2500000 28 | 29 | // #define SUPPORT_TRANSACTIONS -------------------------------------------------------------------------------- /User_Setups/Setup12_M5Stack_Basic_Core.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 12 3 | 4 | //Setup file for the M5Stack Basic Core 5 | 6 | #define ILI9341_DRIVER 7 | 8 | #define M5STACK 9 | 10 | #define TFT_MISO 19 11 | #define TFT_MOSI 23 12 | #define TFT_SCLK 18 13 | #define TFT_CS 14 // Chip select control pin 14 | #define TFT_DC 27 // Data Command control pin 15 | #define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin) 16 | #define TFT_BL 32 // LED back-light 17 | 18 | 19 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 20 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 21 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 22 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 23 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 24 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 25 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 26 | 27 | #define SMOOTH_FONT 28 | 29 | 30 | #define SPI_FREQUENCY 27000000 31 | 32 | // Optional reduced SPI frequency for reading TFT 33 | #define SPI_READ_FREQUENCY 5000000 -------------------------------------------------------------------------------- /User_Setups/Setup44_TTGO_CameraPlus.h: -------------------------------------------------------------------------------- 1 | #define USER_SETUP_ID 44 2 | 3 | #define ST7789_DRIVER 4 | 5 | #define TFT_WIDTH 240 6 | #define TFT_HEIGHT 240 7 | 8 | #define TFT_MOSI 19 9 | #define TFT_MISO 22 10 | #define TFT_SCLK 21 11 | #define TFT_CS 12 12 | #define TFT_DC 15 13 | #define TFT_RST -1 14 | #define TFT_BL 2 15 | 16 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 17 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 18 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 19 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 20 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 21 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 22 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 23 | 24 | #define SMOOTH_FONT 25 | 26 | // #define SPI_FREQUENCY 1000000 27 | // #define SPI_FREQUENCY 5000000 28 | // #define SPI_FREQUENCY 10000000 29 | // #define SPI_FREQUENCY 20000000 30 | // #define SPI_FREQUENCY 27000000 // Actually sets it to 26.67MHz = 80/3 31 | #define SPI_FREQUENCY 40000000 // Maximum to use SPIFFS 32 | // #define SUPPORT_TRANSACTIONS 33 | -------------------------------------------------------------------------------- /User_Setups/Setup302_Waveshare_ESP32S3_GC9A01.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 302 3 | 4 | #define GC9A01_DRIVER 5 | 6 | #define TFT_MISO 12 7 | #define TFT_MOSI 11 8 | #define TFT_SCLK 10 9 | #define TFT_CS 9 // Chip select control pin 10 | #define TFT_DC 8 // Data Command control pin 11 | #define TFT_RST 14 // Reset pin (could connect to RST pin) 12 | #define TFT_BL 2 13 | #define TFT_BACKLIGHT_ON HIGH 14 | 15 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 16 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 17 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 18 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 19 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 20 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 21 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 22 | #define SMOOTH_FONT 23 | 24 | #define TFT_WIDTH 240 25 | #define TFT_HEIGHT 240 26 | 27 | #define SPI_FREQUENCY 40000000 28 | 29 | #define SPI_READ_FREQUENCY 20000000 30 | 31 | #define SPI_TOUCH_FREQUENCY 2500000 32 | 33 | // #define SUPPORT_TRANSACTIONS -------------------------------------------------------------------------------- /User_Setups/Setup36_RPi_touch_ST7796.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 36 3 | 4 | #define RPI_DISPLAY_TYPE 5 | #define ST7796_DRIVER 6 | 7 | 8 | #define TFT_MISO 19 9 | #define TFT_MOSI 23 10 | #define TFT_SCLK 18 11 | #define TFT_CS 15 // Chip select control pin 12 | #define TFT_DC 2 // Data Command control pin 13 | #define TFT_RST 4 // Reset pin (could connect to RST pin) 14 | //#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST 15 | 16 | #define TOUCH_CS 22 // Chip select pin (T_CS) of touch screen 17 | 18 | 19 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 20 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 21 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 22 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 23 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 24 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 25 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 26 | 27 | #define SMOOTH_FONT 28 | 29 | 30 | #define SPI_FREQUENCY 40000000 31 | 32 | #define SPI_TOUCH_FREQUENCY 2500000 33 | -------------------------------------------------------------------------------- /User_Setups/Setup51_LilyPi_ILI9481.h: -------------------------------------------------------------------------------- 1 | #define USER_SETUP_ID 51 2 | 3 | #define ILI9481_DRIVER 4 | 5 | #define TFT_BL 12 // LED back-light control pin 6 | #define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW) 7 | 8 | #define TFT_MISO 23 9 | #define TFT_MOSI 19 10 | #define TFT_SCLK 18 11 | #define TFT_CS 5 // Chip select control pin 12 | #define TFT_DC 27 // Data Command control pin 13 | #define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST 14 | 15 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 16 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 17 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 18 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 19 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 20 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 21 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 22 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 23 | 24 | #define SMOOTH_FONT 25 | 26 | #define SPI_FREQUENCY 26666666 27 | #define SPI_READ_FREQUENCY 20000000 -------------------------------------------------------------------------------- /TFT_Drivers/GC9A01_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the GC9A01 driver coordinate frame 3 | 4 | rotation = m % 4; 5 | 6 | writecommand(TFT_MADCTL); 7 | switch (rotation) { 8 | case 0: // Portrait 9 | writedata(TFT_MAD_BGR); 10 | _width = _init_width; 11 | _height = _init_height; 12 | #ifdef CGRAM_OFFSET 13 | if (_init_width == 128) 14 | { 15 | colstart = 2; 16 | rowstart = 1; 17 | } 18 | #endif 19 | break; 20 | case 1: // Landscape (Portrait + 90) 21 | writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR); 22 | _width = _init_height; 23 | _height = _init_width; 24 | #ifdef CGRAM_OFFSET 25 | if (_init_width == 128) 26 | { 27 | colstart = 1; 28 | rowstart = 2; 29 | } 30 | #endif 31 | break; 32 | case 2: // Inverter portrait 33 | writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR); 34 | _width = _init_width; 35 | _height = _init_height; 36 | #ifdef CGRAM_OFFSET 37 | if (_init_width == 128) 38 | { 39 | colstart = 2; 40 | rowstart = 1; 41 | } 42 | #endif 43 | break; 44 | case 3: // Inverted landscape 45 | writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR); 46 | _width = _init_height; 47 | _height = _init_width; 48 | #ifdef CGRAM_OFFSET 49 | if (_init_width == 128) 50 | { 51 | colstart = 1; 52 | rowstart = 2; 53 | } 54 | #endif 55 | break; 56 | } 57 | -------------------------------------------------------------------------------- /User_Setups/Setup52_LilyPi_ST7796.h: -------------------------------------------------------------------------------- 1 | #define USER_SETUP_ID 52 2 | 3 | #define ST7796_DRIVER 4 | 5 | #define TFT_BL 12 // LED back-light control pin 6 | #define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW) 7 | 8 | #define ESP32_DMA 9 | #define TFT_MISO 23 10 | #define TFT_MOSI 19 11 | #define TFT_SCLK 18 12 | #define TFT_CS 5 // Chip select control pin 13 | #define TFT_DC 27 // Data Command control pin 14 | #define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST 15 | 16 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 17 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 18 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 19 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 20 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 21 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 22 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 23 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 24 | 25 | #define SMOOTH_FONT 26 | 27 | #define SPI_FREQUENCY 40000000 28 | #define SPI_READ_FREQUENCY 12000000 29 | -------------------------------------------------------------------------------- /User_Setups/Setup5_RPi_ILI9486.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 5 3 | 4 | #define RPI_ILI9486_DRIVER // 20MHz maximum SPI 5 | 6 | 7 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 8 | #define TFT_CS PIN_D8 // Chip select control pin D8 9 | #define TFT_DC PIN_D3 // Data Command control pin 10 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 11 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 12 | 13 | 14 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 15 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 16 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 17 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 18 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 19 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 20 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 21 | 22 | #define SMOOTH_FONT 23 | 24 | 25 | #define SPI_FREQUENCY 20000000 26 | 27 | #define SPI_TOUCH_FREQUENCY 2500000 28 | 29 | 30 | // #define SUPPORT_TRANSACTIONS 31 | -------------------------------------------------------------------------------- /User_Setups/Setup1_ILI9341.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 1 3 | 4 | #define ILI9341_DRIVER 5 | 6 | 7 | #define TFT_CS PIN_D8 // Chip select control pin D8 8 | #define TFT_DC PIN_D3 // Data Command control pin 9 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 10 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 11 | 12 | 13 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 14 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 15 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 16 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 17 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 18 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 19 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 20 | 21 | 22 | #define SMOOTH_FONT 23 | 24 | 25 | // #define SPI_FREQUENCY 27000000 26 | #define SPI_FREQUENCY 40000000 27 | // #define SPI_FREQUENCY 80000000 28 | 29 | #define SPI_READ_FREQUENCY 20000000 30 | 31 | #define SPI_TOUCH_FREQUENCY 2500000 32 | 33 | 34 | // #define SUPPORT_TRANSACTIONS 35 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Unicode_test/LittleFS_functions.ino: -------------------------------------------------------------------------------- 1 | /*==================================================================================== 2 | This sketch supports the ESP6266 with LittleFS Flash filing system 3 | 4 | Created by Bodmer 15th Jan 2017 5 | ==================================================================================*/ 6 | 7 | //==================================================================================== 8 | // Print a Flash FS directory list (root directory) 9 | //==================================================================================== 10 | 11 | void listFiles(void) { 12 | Serial.println(); 13 | Serial.println("Flash FS files found:"); 14 | 15 | fs::Dir dir = LittleFS.openDir("/"); // Root directory 16 | String line = "====================================="; 17 | 18 | Serial.println(line); 19 | Serial.println(" File name Size"); 20 | Serial.println(line); 21 | 22 | while (dir.next()) { 23 | String fileName = dir.fileName(); 24 | Serial.print(fileName); 25 | int spaces = 25 - fileName.length(); // Tabulate nicely 26 | if (spaces < 0) spaces = 1; 27 | while (spaces--) Serial.print(" "); 28 | fs::File f = dir.openFile("r"); 29 | Serial.print(f.size()); Serial.println(" bytes"); 30 | yield(); 31 | } 32 | 33 | Serial.println(line); 34 | 35 | Serial.println(); 36 | delay(1000); 37 | } 38 | //==================================================================================== 39 | 40 | -------------------------------------------------------------------------------- /User_Setups/Setup136_LilyGo_TTV.h: -------------------------------------------------------------------------------- 1 | // ST7789 135 x 240 display with no chip select line 2 | #define USER_SETUP_ID 136 3 | 4 | #define ST7789_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 135 7 | #define TFT_HEIGHT 240 8 | 9 | #define CGRAM_OFFSET // Library will add offsets required 10 | 11 | // Generic ESP32 setup 12 | //#define TFT_MISO 19 13 | #define TFT_MOSI 23 14 | #define TFT_SCLK 18 15 | #define TFT_CS 5 16 | #define TFT_DC 19 17 | #define TFT_RST 4 18 | 19 | 20 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 21 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 22 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 23 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 24 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 25 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 26 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 27 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 28 | 29 | #define SMOOTH_FONT 30 | 31 | 32 | // #define SPI_FREQUENCY 27000000 33 | #define SPI_FREQUENCY 40000000 34 | 35 | // #define SUPPORT_TRANSACTIONS -------------------------------------------------------------------------------- /TFT_Drivers/RM68120_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | // RM68120_DRIVER 4 | 5 | #define TFT_WIDTH 480 6 | #define TFT_HEIGHT 800 7 | 8 | //Set driver type common to all TBD initialisation options 9 | #ifndef RM68120_DRIVER 10 | #define RM68120_DRIVER 11 | #endif 12 | 13 | // Delay between some initialisation commands 14 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 15 | 16 | // Generic commands used by TFT_eSPI.cpp 17 | #define TFT_NOP 0x0000 18 | #define TFT_SWRST 0x0100 19 | 20 | #define TFT_INVOFF 0x2000 21 | #define TFT_INVON 0x2100 22 | 23 | #define TFT_DISPOFF 0x2800 24 | #define TFT_DISPON 0x2900 25 | 26 | #define TFT_CASET 0x2A00 27 | #define TFT_PASET 0x2B00 28 | #define TFT_RAMWR 0x2C00 29 | 30 | #define TFT_RAMRD 0x2E00 31 | #define TFT_IDXRD 0xDD00 // ILI9341 only, indexed control register read 32 | 33 | #define TFT_MADCTL 0x3600 34 | #define TFT_MAD_MY 0x80 35 | #define TFT_MAD_MX 0x40 36 | #define TFT_MAD_MV 0x20 37 | #define TFT_MAD_ML 0x10 38 | #define TFT_MAD_BGR 0x08 39 | #define TFT_MAD_RGB 0x00 40 | #define TFT_MAD_MH 0x04 41 | #define TFT_MAD_H_FLIP 0x02 42 | #define TFT_MAD_V_FLIP 0x01 43 | 44 | #ifdef TFT_RGB_ORDER 45 | #if (TFT_RGB_ORDER == 1) 46 | #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 47 | #else 48 | #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 49 | #endif 50 | #else 51 | #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 52 | #endif 53 | -------------------------------------------------------------------------------- /User_Setups/Setup11_RPi_touch_ILI9486.h: -------------------------------------------------------------------------------- 1 | // For ESP32 2 | // See SetupX_Template.h for all options available 3 | #define USER_SETUP_ID 11 4 | 5 | #define RPI_DISPLAY_TYPE 6 | #define ILI9486_DRIVER 7 | 8 | #define TFT_MISO 19 9 | #define TFT_MOSI 23 10 | #define TFT_SCLK 18 11 | #define TFT_CS 15 // Chip select control pin 12 | #define TFT_DC 2 // Data Command control pin 13 | #define TFT_RST 4 // Reset pin (could connect to RST pin) 14 | //#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST 15 | 16 | #define TOUCH_CS 22 // Chip select pin (T_CS) of touch screen 17 | 18 | 19 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 20 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 21 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 22 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 23 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 24 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 25 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 26 | 27 | #define SMOOTH_FONT 28 | 29 | 30 | #define SPI_FREQUENCY 20000000 // Some displays will operate at higher frequencies 31 | 32 | #define SPI_TOUCH_FREQUENCY 2500000 33 | -------------------------------------------------------------------------------- /examples/Generic/Animated_Eyes_2/wiring.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This is the example wiring used for the sketch testing. 3 | 4 | You must not define the TFT_CS pin in the TFT_eSPI library if you are 5 | using two independant displays. Instead the chip selects (CS) must be 6 | defined in the "config.h" tab of this sketch. The sketch can then select 7 | the dispay to send graphics to. 8 | 9 | If you are only using one display, then TFT_CS can be defined in the 10 | TFT_eSPI library. 11 | 12 | The "Setup47_ST7735.h" file was used for the two TFT test using the wiring 13 | as shown below: 14 | 15 | Function ESP32 pin TFT 1 TFT 2 16 | MOSI 23 -> SDA -> SDA // The TFT pin may be named DIN 17 | MISO 19 // Not connected 18 | SCLK 18 -> CLK -> CLK // The TFT pin may be named SCK 19 | TFT_DC 2 -> DC -> DC // The TFT pin may be named AO 20 | TFT_RST 4 -> RST -> RST 21 | CS 1 22 -> CS // Connected to TFT 1 only 22 | CS 2 21 -> CS // Connected to TFT 2 only 23 | +5V/VIN -> VCC -> VCC 24 | 0V -> GND -> GND 25 | +5V/VIN -> LED -> LED // Some displays do not have a backlight BL/LED pin 26 | 27 | The displays used for testing were 128x128 ST7735 displays, the TFT_eSPI library setup file may need 28 | to be changed as these displays come in many configuration variants. 29 | 30 | 31 | */ 32 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/LittleFS/Font_Demo_3/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | Note: it is best to use drawNumber() and drawFloat() for numeric values 7 | this reduces digit position movement when the value changes 8 | drawNumber() and drawFloat() functions behave like drawString() and are 9 | supported by setTextDatum() and setTextPadding() 10 | 11 | //These are the text plotting alignment (reference datum point) 12 | 13 | TL_DATUM = Top left (default) 14 | TC_DATUM = Top centre 15 | TR_DATUM = Top right 16 | 17 | ML_DATUM = Middle left 18 | MC_DATUM = Middle centre 19 | MR_DATUM = Middle right 20 | 21 | BL_DATUM = Bottom left 22 | BC_DATUM = Bottom centre 23 | BR_DATUM = Bottom right 24 | 25 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 26 | C_BASELINE = Centre character baseline 27 | R_BASELINE = Right character baseline 28 | 29 | // Basic colours already defined: 30 | 31 | TFT_BLACK 0x0000 32 | TFT_NAVY 0x000F 33 | TFT_DARKGREEN 0x03E0 34 | TFT_DARKCYAN 0x03EF 35 | TFT_MAROON 0x7800 36 | TFT_PURPLE 0x780F 37 | TFT_OLIVE 0x7BE0 38 | TFT_LIGHTGREY 0xC618 39 | TFT_DARKGREY 0x7BEF 40 | TFT_BLUE 0x001F 41 | TFT_GREEN 0x07E0 42 | TFT_CYAN 0x07FF 43 | TFT_RED 0xF800 44 | TFT_MAGENTA 0xF81F 45 | TFT_YELLOW 0xFFE0 46 | TFT_WHITE 0xFFFF 47 | TFT_ORANGE 0xFDA0 48 | TFT_GREENYELLOW 0xB7E0 49 | TFT_PINK 0xFC9F 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | */ 62 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/SPIFFS/Font_Demo_3/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | Note: it is best to use drawNumber() and drawFloat() for numeric values 7 | this reduces digit position movement when the value changes 8 | drawNumber() and drawFloat() functions behave like drawString() and are 9 | supported by setTextDatum() and setTextPadding() 10 | 11 | //These are the text plotting alignment (reference datum point) 12 | 13 | TL_DATUM = Top left (default) 14 | TC_DATUM = Top centre 15 | TR_DATUM = Top right 16 | 17 | ML_DATUM = Middle left 18 | MC_DATUM = Middle centre 19 | MR_DATUM = Middle right 20 | 21 | BL_DATUM = Bottom left 22 | BC_DATUM = Bottom centre 23 | BR_DATUM = Bottom right 24 | 25 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 26 | C_BASELINE = Centre character baseline 27 | R_BASELINE = Right character baseline 28 | 29 | // Basic colours already defined: 30 | 31 | TFT_BLACK 0x0000 32 | TFT_NAVY 0x000F 33 | TFT_DARKGREEN 0x03E0 34 | TFT_DARKCYAN 0x03EF 35 | TFT_MAROON 0x7800 36 | TFT_PURPLE 0x780F 37 | TFT_OLIVE 0x7BE0 38 | TFT_LIGHTGREY 0xC618 39 | TFT_DARKGREY 0x7BEF 40 | TFT_BLUE 0x001F 41 | TFT_GREEN 0x07E0 42 | TFT_CYAN 0x07FF 43 | TFT_RED 0xF800 44 | TFT_MAGENTA 0xF81F 45 | TFT_YELLOW 0xFFE0 46 | TFT_WHITE 0xFFFF 47 | TFT_ORANGE 0xFDA0 48 | TFT_GREENYELLOW 0xB7E0 49 | TFT_PINK 0xFC9F 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | */ 62 | -------------------------------------------------------------------------------- /User_Setups/Setup20_ILI9488.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 20 3 | 4 | #define ILI9488_DRIVER 5 | 6 | 7 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 8 | #define TFT_CS PIN_D8 // Chip select control pin D8 9 | #define TFT_DC PIN_D3 // Data Command control pin 10 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 11 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 12 | 13 | 14 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 15 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 16 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 17 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 18 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 19 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 20 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 21 | 22 | #define SMOOTH_FONT 23 | 24 | 25 | // #define SPI_FREQUENCY 20000000 26 | #define SPI_FREQUENCY 27000000 27 | // #define SPI_FREQUENCY 40000000 28 | 29 | 30 | #define SPI_TOUCH_FREQUENCY 2500000 31 | 32 | 33 | // #define SUPPORT_TRANSACTIONS 34 | -------------------------------------------------------------------------------- /examples/Smooth Fonts/FLASH_Array/Font_Demo_3_Array/Notes.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Information notes only: 4 | ====================== 5 | 6 | Note: it is best to use drawNumber() and drawFloat() for numeric values 7 | this reduces digit position movement when the value changes 8 | drawNumber() and drawFloat() functions behave like drawString() and are 9 | supported by setTextDatum() and setTextPadding() 10 | 11 | //These are the text plotting alignment (reference datum point) 12 | 13 | TL_DATUM = Top left (default) 14 | TC_DATUM = Top centre 15 | TR_DATUM = Top right 16 | 17 | ML_DATUM = Middle left 18 | MC_DATUM = Middle centre 19 | MR_DATUM = Middle right 20 | 21 | BL_DATUM = Bottom left 22 | BC_DATUM = Bottom centre 23 | BR_DATUM = Bottom right 24 | 25 | L_BASELINE = Left character baseline (Line the 'A' character would sit on) 26 | C_BASELINE = Centre character baseline 27 | R_BASELINE = Right character baseline 28 | 29 | // Basic colours already defined: 30 | 31 | TFT_BLACK 0x0000 32 | TFT_NAVY 0x000F 33 | TFT_DARKGREEN 0x03E0 34 | TFT_DARKCYAN 0x03EF 35 | TFT_MAROON 0x7800 36 | TFT_PURPLE 0x780F 37 | TFT_OLIVE 0x7BE0 38 | TFT_LIGHTGREY 0xC618 39 | TFT_DARKGREY 0x7BEF 40 | TFT_BLUE 0x001F 41 | TFT_GREEN 0x07E0 42 | TFT_CYAN 0x07FF 43 | TFT_RED 0xF800 44 | TFT_MAGENTA 0xF81F 45 | TFT_YELLOW 0xFFE0 46 | TFT_WHITE 0xFFFF 47 | TFT_ORANGE 0xFDA0 48 | TFT_GREENYELLOW 0xB7E0 49 | TFT_PINK 0xFC9F 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | */ 62 | -------------------------------------------------------------------------------- /User_Setups/Setup200_GC9A01.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 200 3 | 4 | #define GC9A01_DRIVER 5 | 6 | // For ESP32 Dev board (only tested with GC9A01 display) 7 | // The hardware SPI can be mapped to any pins 8 | 9 | #define TFT_MOSI 15 // In some display driver board, it might be written as "SDA" and so on. 10 | #define TFT_SCLK 14 11 | #define TFT_CS 5 // Chip select control pin 12 | #define TFT_DC 27 // Data Command control pin 13 | #define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin) 14 | #define TFT_BL 22 // LED back-light 15 | 16 | 17 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 18 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 19 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 20 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 21 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 22 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 23 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 24 | 25 | #define SMOOTH_FONT 26 | 27 | 28 | //#define SPI_FREQUENCY 80000000 29 | #define SPI_FREQUENCY 27000000 30 | 31 | // Optional reduced SPI frequency for reading TFT 32 | #define SPI_READ_FREQUENCY 5000000 -------------------------------------------------------------------------------- /TFT_Drivers/ILI9486_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the ILI9486 driver coordinate frame 2 | 3 | writecommand(TFT_MADCTL); 4 | rotation = m % 8; 5 | switch (rotation) { 6 | case 0: // Portrait 7 | writedata(TFT_MAD_BGR | TFT_MAD_MX); 8 | _width = _init_width; 9 | _height = _init_height; 10 | break; 11 | case 1: // Landscape (Portrait + 90) 12 | writedata(TFT_MAD_BGR | TFT_MAD_MV); 13 | _width = _init_height; 14 | _height = _init_width; 15 | break; 16 | case 2: // Inverter portrait 17 | writedata( TFT_MAD_BGR | TFT_MAD_MY); 18 | _width = _init_width; 19 | _height = _init_height; 20 | break; 21 | case 3: // Inverted landscape 22 | writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY); 23 | _width = _init_height; 24 | _height = _init_width; 25 | break; 26 | case 4: // Portrait 27 | writedata(TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_MY); 28 | _width = _init_width; 29 | _height = _init_height; 30 | break; 31 | case 5: // Landscape (Portrait + 90) 32 | writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX); 33 | _width = _init_height; 34 | _height = _init_width; 35 | break; 36 | case 6: // Inverter portrait 37 | writedata( TFT_MAD_BGR); 38 | _width = _init_width; 39 | _height = _init_height; 40 | break; 41 | case 7: // Inverted landscape 42 | writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MY); 43 | _width = _init_height; 44 | _height = _init_width; 45 | break; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /User_Setups/Setup66_Seeed_XIAO_Round.h: -------------------------------------------------------------------------------- 1 | #define USER_SETUP_ID 66 2 | 3 | #define GC9A01_DRIVER // Full configuration option, define additional parameters below for this display 4 | 5 | #define TFT_RGB_ORDER TFT_RGB // Colour order Blue-Green-Red 6 | #define TFT_HEIGHT 240 // GC9A01 240 x 240 7 | 8 | #define TFT_SCLK D8 9 | #define TFT_MISO D9 10 | #define TFT_MOSI D10 11 | #define TFT_CS D1 // Chip select control pin 12 | #define TFT_DC D3 // Data Command control pin 13 | #define TFT_BL D6 14 | #define TFT_RST -1 // Reset pin (could connect to RST pin) 15 | 16 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 17 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 18 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 19 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 20 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 21 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 22 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 23 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 24 | 25 | #define SMOOTH_FONT 26 | 27 | #define SPI_FREQUENCY 40000000 28 | #define SPI_READ_FREQUENCY 20000000 29 | // #define USE_HSPI_PORT 30 | -------------------------------------------------------------------------------- /User_Setups/Setup21_ILI9488.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 21 3 | 4 | #define ILI9488_DRIVER 5 | 6 | //#define TFT_INVERSION_OFF 7 | 8 | #define TFT_MISO 19 // (leave TFT SDO disconnected if other SPI devices share MISO) 9 | #define TFT_MOSI 23 10 | #define TFT_SCLK 18 11 | #define TFT_CS 15 // Chip select control pin 12 | #define TFT_DC 2 // Data Command control pin 13 | #define TFT_RST 4 // Reset pin (could connect to RST pin) 14 | 15 | 16 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 17 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 18 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 19 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 20 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 21 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 22 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 23 | 24 | #define SMOOTH_FONT 25 | 26 | 27 | // #define SPI_FREQUENCY 20000000 28 | #define SPI_FREQUENCY 27000000 29 | // #define SPI_FREQUENCY 40000000 30 | // #define SPI_FREQUENCY 80000000 31 | 32 | // Optional reduced SPI frequency for reading TFT 33 | #define SPI_READ_FREQUENCY 16000000 34 | 35 | #define SPI_TOUCH_FREQUENCY 2500000 36 | -------------------------------------------------------------------------------- /User_Setups/Setup60_RP2040_RPI_MHS.h: -------------------------------------------------------------------------------- 1 | #define USER_SETUP_ID 162 2 | #define ST7796_DRIVER 3 | 4 | #define MHS_DISPLAY_TYPE 5 | //#define RP2040_PIO_SPI 6 | #define TFT_MISO 16 7 | #define TFT_MOSI 19 8 | #define TFT_SCLK 18 9 | #define TFT_CS 17 // Chip select control pin 10 | #define TFT_DC 20 // Data Command control pin 11 | #define TFT_RST 21 // Reset pin (could connect to Arduino RESET pin) 12 | //#define TFT_BL // LED back-light 13 | 14 | #define TOUCH_CS 22 // Chip select pin (T_CS) of touch screen 15 | 16 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 17 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 18 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 19 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 20 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 21 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 22 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 23 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 24 | 25 | #define SMOOTH_FONT 26 | 27 | #define SPI_FREQUENCY 125000000 28 | #define SPI_READ_FREQUENCY 20000000 29 | #define SPI_TOUCH_FREQUENCY 2500000 -------------------------------------------------------------------------------- /User_Setups/Setup6_RPi_Wr_ILI9486.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 6 3 | 4 | #define RPI_ILI9486_DRIVER // 20MHz maximum SPI 5 | 6 | 7 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 8 | #define TFT_CS PIN_D8 // Chip select control pin D8 9 | #define TFT_DC PIN_D3 // Data Command control pin 10 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 11 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 12 | 13 | #define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only 14 | 15 | 16 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 17 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 18 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 19 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 20 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 21 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 22 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 23 | 24 | #define SMOOTH_FONT 25 | 26 | 27 | #define SPI_FREQUENCY 20000000 28 | 29 | #define SPI_TOUCH_FREQUENCY 2500000 30 | 31 | 32 | // #define SUPPORT_TRANSACTIONS 33 | -------------------------------------------------------------------------------- /examples/Test and diagnostics/Test_Touch_Controller/Test_Touch_Controller.ino: -------------------------------------------------------------------------------- 1 | // This sketch is to test the touch controller, nothing is displayed 2 | // on the TFT. The TFT_eSPI library must be configured to suit your 3 | // pins used. Make sure both the touch chip select and the TFT chip 4 | // select are correctly defined to avoid SPI bus contention. 5 | 6 | // Make sure you have defined a pin for the touch controller chip 7 | // select line in the user setup file or you will see "no member" 8 | // compile errors for the touch functions! 9 | 10 | // It is a support and diagnostic sketch for the TFT_eSPI library: 11 | // https://github.com/Bodmer/TFT_eSPI 12 | 13 | // The "raw" (unprocessed) touch sensor outputs are sent to the 14 | // serial port. Touching the screen should show changes to the x, y 15 | // and z values. x and y are raw ADC readings, not pixel coordinates. 16 | 17 | #include 18 | #include 19 | TFT_eSPI tft = TFT_eSPI(); 20 | 21 | //==================================================================== 22 | 23 | void setup(void) { 24 | Serial.begin(115200); 25 | Serial.println("\n\nStarting..."); 26 | 27 | tft.init(); 28 | } 29 | 30 | //==================================================================== 31 | 32 | void loop() { 33 | 34 | uint16_t x, y; 35 | 36 | tft.getTouchRaw(&x, &y); 37 | 38 | Serial.printf("x: %i ", x); 39 | 40 | Serial.printf("y: %i ", y); 41 | 42 | Serial.printf("z: %i \n", tft.getTouchRawZ()); 43 | 44 | delay(250); 45 | 46 | } 47 | 48 | //==================================================================== 49 | 50 | -------------------------------------------------------------------------------- /User_Setups/Setup16_ILI9488_Parallel.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 16 3 | 4 | #define ESP32_PARALLEL 5 | 6 | 7 | #define ILI9488_DRIVER 8 | 9 | 10 | // ESP32 pins used 11 | #define TFT_CS 33 // Chip select control pin 12 | #define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31 13 | #define TFT_RST 32 // Reset pin 14 | 15 | #define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31 16 | #define TFT_RD 2 17 | 18 | #define TFT_D0 12 // Must use pins in the range 0-31 for the data bus 19 | #define TFT_D1 13 // so a single register write sets/clears all bits 20 | #define TFT_D2 26 21 | #define TFT_D3 25 22 | #define TFT_D4 17 23 | #define TFT_D5 16 24 | #define TFT_D6 27 25 | #define TFT_D7 14 26 | 27 | 28 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 29 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 30 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 31 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 32 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 33 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 34 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 35 | 36 | #define SMOOTH_FONT 37 | -------------------------------------------------------------------------------- /docs/PlatformIO/Configuring options.txt: -------------------------------------------------------------------------------- 1 | ;PlatformIO User notes: 2 | 3 | ;It is possible to load settings from the calling program rather than modifying 4 | ;the library for each project by modifying the "platformio.ini" file. 5 | 6 | ;The User_Setup_Select.h file will not load the user setting header files if 7 | ;USER_SETUP_LOADED is defined. 8 | 9 | ;Instead of using #define, use the -D prefix, for example: 10 | 11 | ; PlatformIO Project Configuration File 12 | ; 13 | ; Build options: build flags, source filter 14 | ; Upload options: custom upload port, speed and extra flags 15 | ; Library options: dependencies, extra library storages 16 | ; Advanced options: extra scripting 17 | ; 18 | ; Please visit documentation for the other options and examples 19 | ; https://docs.platformio.org/page/projectconf.html 20 | 21 | [env:esp32dev] 22 | platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream 23 | board = esp32dev 24 | framework = arduino 25 | lib_deps = bodmer/TFT_eSPI@^2.4.31 26 | 27 | build_flags = 28 | -Os 29 | -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG 30 | -DUSER_SETUP_LOADED=1 31 | 32 | ; Define the TFT driver, pins etc. here: 33 | -DST7789_DRIVER=1 34 | -DTFT_WIDTH=128 35 | -DTFT_HEIGHT=160 36 | -DTFT_MISO=19 37 | -DTFT_MOSI=23 38 | -DTFT_SCLK=18 39 | -DTFT_CS=5 40 | -DTFT_DC=19 41 | -DTFT_RST=4 42 | ;-DTFT_BL=21 43 | ;-DTOUCH_CS=22 44 | -DLOAD_GLCD=1 45 | -DLOAD_FONT2=1 46 | -DLOAD_FONT4=1 47 | -DLOAD_FONT6=1 48 | -DLOAD_FONT7=1 49 | -DLOAD_FONT8=1 50 | -DLOAD_GFXFF=1 51 | -DSMOOTH_FONT=1 52 | -DSPI_FREQUENCY=27000000 53 | -------------------------------------------------------------------------------- /User_Setups/Setup138_Pico_Explorer_Base_RP2040_ST7789.h: -------------------------------------------------------------------------------- 1 | // Pico Explorer Base by Pimoroni (RP2040) (ST7789 on SPI bus with 240x240 TFT) 2 | #define USER_SETUP_ID 138 3 | 4 | #define ST7789_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 240 7 | #define TFT_HEIGHT 240 8 | 9 | #define CGRAM_OFFSET // Library will add offsets required 10 | 11 | // For Pico Explorer Base (PR2040) 12 | #define TFT_CS 17 // Chip Select pin 13 | #define TFT_DC 16 // Data Command control pin 14 | #define TFT_RST -1 // No Reset pin 15 | #define TFT_MOSI 19 16 | #define TFT_SCLK 18 17 | 18 | 19 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 20 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 21 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 22 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 23 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 24 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 25 | // #define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 26 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 27 | 28 | #define SMOOTH_FONT 29 | 30 | #define SPI_FREQUENCY 40000000 31 | #define SPI_READ_FREQUENCY 20000000 32 | #define SPI_TOUCH_FREQUENCY 2500000 33 | -------------------------------------------------------------------------------- /TFT_Drivers/HX8357B_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the HX8357C driver coordinate frame 2 | 3 | writecommand(TFT_MADCTL); 4 | rotation = m % 8; 5 | switch (rotation) { 6 | case 0: // Portrait 7 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX); 8 | _width = _init_width; 9 | _height = _init_height; 10 | break; 11 | case 1: // Landscape (Portrait + 90) 12 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV); 13 | _width = _init_height; 14 | _height = _init_width; 15 | break; 16 | case 2: // Inverter portrait 17 | writedata( TFT_MAD_COLOR_ORDER | TFT_MAD_MY); 18 | _width = _init_width; 19 | _height = _init_height; 20 | break; 21 | case 3: // Inverted landscape 22 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY); 23 | _width = _init_height; 24 | _height = _init_width; 25 | break; 26 | case 4: // Portrait 27 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX | TFT_MAD_MY); 28 | _width = _init_width; 29 | _height = _init_height; 30 | break; 31 | case 5: // Landscape (Portrait + 90) 32 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX); 33 | _width = _init_height; 34 | _height = _init_width; 35 | break; 36 | case 6: // Inverter portrait 37 | writedata( TFT_MAD_COLOR_ORDER); 38 | _width = _init_width; 39 | _height = _init_height; 40 | break; 41 | case 7: // Inverted landscape 42 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MY); 43 | _width = _init_height; 44 | _height = _init_width; 45 | break; 46 | } 47 | -------------------------------------------------------------------------------- /TFT_Drivers/HX8357C_Rotation.h: -------------------------------------------------------------------------------- 1 | // This is the command sequence that rotates the HX8357C driver coordinate frame 2 | 3 | writecommand(TFT_MADCTL); 4 | rotation = m % 8; 5 | switch (rotation) { 6 | case 0: // Portrait 7 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX); 8 | _width = _init_width; 9 | _height = _init_height; 10 | break; 11 | case 1: // Landscape (Portrait + 90) 12 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV); 13 | _width = _init_height; 14 | _height = _init_width; 15 | break; 16 | case 2: // Inverter portrait 17 | writedata( TFT_MAD_COLOR_ORDER | TFT_MAD_MY); 18 | _width = _init_width; 19 | _height = _init_height; 20 | break; 21 | case 3: // Inverted landscape 22 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY); 23 | _width = _init_height; 24 | _height = _init_width; 25 | break; 26 | case 4: // Portrait 27 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX | TFT_MAD_MY); 28 | _width = _init_width; 29 | _height = _init_height; 30 | break; 31 | case 5: // Landscape (Portrait + 90) 32 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX); 33 | _width = _init_height; 34 | _height = _init_width; 35 | break; 36 | case 6: // Inverter portrait 37 | writedata( TFT_MAD_COLOR_ORDER); 38 | _width = _init_width; 39 | _height = _init_height; 40 | break; 41 | case 7: // Inverted landscape 42 | writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MY); 43 | _width = _init_height; 44 | _height = _init_width; 45 | break; 46 | } 47 | -------------------------------------------------------------------------------- /User_Setups/Setup19_RM68140_Parallel.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 19 3 | 4 | #define ESP32_PARALLEL 5 | 6 | 7 | #define RM68140_DRIVER 8 | 9 | 10 | // ESP32 pins used for UNO format board 11 | #define TFT_CS 33 // Chip select control pin 12 | #define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31 13 | #define TFT_RST 32 // Reset pin 14 | 15 | #define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31 16 | #define TFT_RD 2 17 | 18 | #define TFT_D0 12 // Must use pins in the range 0-31 for the data bus 19 | #define TFT_D1 13 // so a single register write sets/clears all bits 20 | #define TFT_D2 26 21 | #define TFT_D3 25 22 | #define TFT_D4 17 23 | #define TFT_D5 16 24 | #define TFT_D6 27 25 | #define TFT_D7 14 26 | 27 | 28 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 29 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 30 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 31 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 32 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 33 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 34 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 35 | 36 | #define SMOOTH_FONT 37 | -------------------------------------------------------------------------------- /User_Setups/Setup13_ILI9481_Parallel.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 13 3 | 4 | #define TFT_PARALLEL_8_BIT 5 | 6 | 7 | #define ILI9481_DRIVER 8 | 9 | 10 | // ESP32 pins used for UNO format board 11 | #define TFT_CS 33 // Chip select control pin 12 | #define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31 13 | #define TFT_RST 32 // Reset pin 14 | 15 | #define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31 16 | #define TFT_RD 2 17 | 18 | #define TFT_D0 12 // Must use pins in the range 0-31 for the data bus 19 | #define TFT_D1 13 // so a single register write sets/clears all bits 20 | #define TFT_D2 26 21 | #define TFT_D3 25 22 | #define TFT_D4 17 23 | #define TFT_D5 16 24 | #define TFT_D6 27 25 | #define TFT_D7 14 26 | 27 | 28 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 29 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 30 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 31 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 32 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 33 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 34 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 35 | 36 | #define SMOOTH_FONT 37 | -------------------------------------------------------------------------------- /User_Setups/Setup14_ILI9341_Parallel.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 14 3 | 4 | #define TFT_PARALLEL_8_BIT 5 | 6 | 7 | #define ILI9341_DRIVER 8 | 9 | 10 | // ESP32 pins used for the parallel interface TFT 11 | #define TFT_CS 33 // Chip select control pin 12 | #define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31 13 | #define TFT_RST 32 // Reset pin 14 | 15 | #define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31 16 | #define TFT_RD 2 17 | 18 | #define TFT_D0 12 // Must use pins in the range 0-31 for the data bus 19 | #define TFT_D1 13 // so a single register write sets/clears all bits 20 | #define TFT_D2 26 21 | #define TFT_D3 25 22 | #define TFT_D4 17 23 | #define TFT_D5 16 24 | #define TFT_D6 27 25 | #define TFT_D7 14 26 | 27 | 28 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 29 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 30 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 31 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 32 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 33 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 34 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 35 | 36 | #define SMOOTH_FONT 37 | -------------------------------------------------------------------------------- /User_Setups/Setup213_LilyGo_T_Beam_Shield.h: -------------------------------------------------------------------------------- 1 | // ST7796 222 x 480 display with no chip select line 2 | #define USER_SETUP_ID 213 3 | 4 | #define ST7796_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 222 7 | #define TFT_HEIGHT 480 8 | 9 | #define CGRAM_OFFSET // Library will add offsets required 10 | 11 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 12 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 13 | 14 | #define TFT_INVERSION_ON 15 | 16 | #define TFT_MISO -1 17 | #define TFT_MOSI 14 18 | #define TFT_SCLK 15 19 | #define TFT_CS 25 20 | #define TFT_DC 13 21 | #define TFT_RST 2 22 | #define TFT_BL 4 23 | #define TFT_BACKLIGHT_ON HIGH 24 | 25 | 26 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 27 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 28 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 29 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 30 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 31 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 32 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 33 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 34 | 35 | #define SMOOTH_FONT 36 | #define SPI_FREQUENCY 40000000 37 | -------------------------------------------------------------------------------- /TFT_Drivers/ILI9163_Init.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that initialises the ILI9163 driver 3 | // 4 | // This setup information is in a format accecpted by the commandList() function 5 | // which reduces FLASH space, but on an ESP8266 there is plenty available! 6 | // 7 | // See ILI9341_Setup.h file for an alternative simpler format 8 | 9 | { 10 | // Initialization commands for ILI9163 screens 11 | static const uint8_t ILI9163_cmds[] PROGMEM = 12 | { 13 | 17, // 17 commands follow 14 | 0x01, 0 + TFT_INIT_DELAY, 120, // Software reset 15 | 0x11, 0 + TFT_INIT_DELAY, 5, // Exit sleep mode 16 | 0x3A, 1, 0x05, // Set pixel format 17 | 0x26, 1, 0x04, // Set Gamma curve 3 18 | 0xF2, 1, 0x01, // Gamma adjustment enabled 19 | 0xE0, 15, 0x3F, 0x25, 0x1C, 0x1E, 0x20, 0x12, 0x2A, 0x90, 20 | 0x24, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, // Positive Gamma 21 | 0xE1, 15, 0x20, 0x20, 0x20, 0x20, 0x05, 0x00, 0x15,0xA7, 22 | 0x3D, 0x18, 0x25, 0x2A, 0x2B, 0x2B, 0x3A, // Negative Gamma 23 | 0xB1, 2, 0x08, 0x08, // Frame rate control 1 24 | 0xB4, 1, 0x07, // Display inversion 25 | 0xC0, 2, 0x0A, 0x02, // Power control 1 26 | 0xC1, 1, 0x02, // Power control 2 27 | 0xC5, 2, 0x50, 0x5B, // Vcom control 1 28 | 0xC7, 1, 0x40, // Vcom offset 29 | 0x2A, 4, 0x00, 0x00, 0x00, 0x7F, // Set column address 30 | 0x2B, 4 + TFT_INIT_DELAY, 0x00, 0x00, 0x00, 0x9F, 250, // Set page address 31 | 0x36, 1, 0xC8, // Set address mode 32 | 0x29, 0, // Set display on 33 | }; 34 | 35 | commandList(ILI9163_cmds); 36 | 37 | #ifdef CGRAM_OFFSET 38 | colstart = 0; 39 | rowstart = 0; 40 | #endif 41 | } -------------------------------------------------------------------------------- /User_Setups/Setup10_RPi_touch_ILI9486.h: -------------------------------------------------------------------------------- 1 | // For ESP8266 2 | // See SetupX_Template.h for all options available 3 | #define USER_SETUP_ID 10 4 | 5 | #define RPI_DISPLAY_TYPE 6 | #define ILI9486_DRIVER 7 | 8 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 9 | #define TFT_CS PIN_D2 // Chip select control pin D2 10 | #define TFT_DC PIN_D3 // Data Command control pin 11 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 12 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 13 | 14 | #define TOUCH_CS PIN_D1 // Chip select pin (T_CS) of touch screen 15 | 16 | 17 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 18 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 19 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 20 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 21 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 22 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 23 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 24 | 25 | #define SMOOTH_FONT 26 | 27 | 28 | #define SPI_FREQUENCY 16000000 // Some displays will operate at higher frequencies 29 | 30 | #define SPI_TOUCH_FREQUENCY 2500000 31 | 32 | 33 | // #define SUPPORT_TRANSACTIONS 34 | -------------------------------------------------------------------------------- /User_Setups/Setup137_LilyGo_TDisplay_RP2040.h: -------------------------------------------------------------------------------- 1 | // LilyGo T-Display RP2040 (ST7789 135 x 240 display) 2 | #define USER_SETUP_ID 137 3 | 4 | #define ST7789_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 135 7 | #define TFT_HEIGHT 240 8 | 9 | #define CGRAM_OFFSET // Library will add offsets required 10 | 11 | // For LilyGo T-Display RP2040 12 | #define TFT_CS 5 // Chip Select pin 13 | #define TFT_DC 1 // Data Command control pin 14 | #define TFT_RST 0 // Reset pin 15 | #define TFT_MOSI 3 16 | #define TFT_SCLK 2 17 | // Don't uncomment next line if you want PWM control of the backlight in the sketch 18 | //#define TFT_BL 4 19 | 20 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 21 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 22 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 23 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 24 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 25 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 26 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 27 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 28 | 29 | #define SMOOTH_FONT 30 | 31 | #define SPI_FREQUENCY 40000000 32 | #define SPI_READ_FREQUENCY 20000000 33 | #define SPI_TOUCH_FREQUENCY 2500000 34 | -------------------------------------------------------------------------------- /User_Setups/Setup4_S6D02A1.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 4 3 | 4 | #define S6D02A1_DRIVER 5 | 6 | 7 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 8 | #define TFT_CS PIN_D8 // Chip select control pin D8 9 | #define TFT_DC PIN_D3 // Data Command control pin 10 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 11 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 12 | 13 | 14 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 15 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 16 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 17 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 18 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 19 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 20 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 21 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 22 | 23 | #define SMOOTH_FONT 24 | 25 | 26 | // #define SPI_FREQUENCY 20000000 27 | #define SPI_FREQUENCY 27000000 28 | // #define SPI_FREQUENCY 40000000 29 | 30 | #define SPI_TOUCH_FREQUENCY 2500000 31 | 32 | 33 | // #define SUPPORT_TRANSACTIONS 34 | -------------------------------------------------------------------------------- /examples/Smooth Graphics/Smooth_Rounded_Rectangles/Smooth_Rounded_Rectangles.ino: -------------------------------------------------------------------------------- 1 | // Draw random coloured smooth (anti-aliased) rounded rectangles on the TFT 2 | 3 | #include 4 | 5 | TFT_eSPI tft = TFT_eSPI(); 6 | 7 | void setup(void) { 8 | tft.init(); 9 | tft.fillScreen(TFT_BLACK); // Background is black 10 | } 11 | 12 | void loop() { 13 | tft.fillScreen(TFT_BLACK); 14 | tft.setCursor(0, 0); 15 | 16 | // Draw some random smooth rounded rectangles 17 | for (int i = 0; i < 20; i++) 18 | { 19 | int radius = random(60); 20 | int w = random(2 * radius, 160); 21 | int h = random(2 * radius, 160); 22 | int t = random(1, radius / 3); 23 | int x = random(tft.width() - w); 24 | int y = random(tft.height() - h); 25 | 26 | // Random colour is anti-aliased (blended) with background colour (black in this case) 27 | tft.drawSmoothRoundRect(x, y, radius, radius - t, w, h, random(0x10000), TFT_BLACK); 28 | } 29 | tft.print("Variable thickness"); 30 | delay(2000); 31 | 32 | tft.fillScreen(TFT_BLACK); 33 | tft.setCursor(0, 0); 34 | 35 | // Draw some random minimum thickness smooth rounded rectangles 36 | for (int i = 0; i < 20; i++) 37 | { 38 | int radius = random(60); 39 | int w = random(2 * radius, 160); 40 | int h = random(2 * radius, 160); 41 | int t = 0; 42 | int x = random(tft.width() - w); 43 | int y = random(tft.height() - h); 44 | 45 | // Random colour is anti-aliased (blended) with background colour (black in this case) 46 | tft.drawSmoothRoundRect(x, y, radius, radius - t, w, h, random(0x10000), TFT_BLACK); 47 | } 48 | tft.print("Minimum thickness"); 49 | delay(2000); 50 | } 51 | -------------------------------------------------------------------------------- /User_Setups/Setup0_Sprite.h: -------------------------------------------------------------------------------- 1 | // For sprite only functionality (untested) 2 | #define USER_SETUP_ID 0 3 | 4 | #define TFT_WIDTH 1000 5 | #define TFT_HEIGHT 1000 6 | 7 | #define TFT_INIT_DELAY 0 8 | 9 | #define TFT_NOP 0x00 10 | #define TFT_SWRST 0x00 11 | 12 | #define TFT_CASET 0x00 13 | #define TFT_PASET 0x00 14 | #define TFT_RAMWR 0x00 15 | 16 | #define TFT_RAMRD 0x00 17 | #define TFT_IDXRD 0x00 18 | 19 | /* 20 | #define TFT_MADCTL 0x00 21 | #define TFT_MAD_MY 0x00 22 | #define TFT_MAD_MX 0x00 23 | #define TFT_MAD_MV 0x00 24 | #define TFT_MAD_ML 0x00 25 | #define TFT_MAD_BGR 0x00 26 | #define TFT_MAD_MH 0x00 27 | #define TFT_MAD_RGB 0x00 28 | */ 29 | #define TFT_INVOFF 0x00 30 | #define TFT_INVON 0x00 31 | 32 | 33 | #define TFT_MISO -1 34 | #define TFT_MOSI -1 35 | #define TFT_SCLK -1 36 | 37 | 38 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 39 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 40 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 41 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 42 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 43 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 44 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 45 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 46 | 47 | #define SMOOTH_FONT 48 | -------------------------------------------------------------------------------- /User_Setups/Setup72_ESP32_ST7789_172x320.h: -------------------------------------------------------------------------------- 1 | // Support for 1.47" 320x172 Round Rectangle Color IPS TFT Display 2 | #define USER_SETUP_ID 71 3 | 4 | #define ST7789_DRIVER // Full configuration option, define additional parameters below for this display 5 | 6 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 7 | 8 | #define TFT_WIDTH 172 // ST7789 172 x 320 9 | #define TFT_HEIGHT 320 // ST7789 240 x 320 10 | 11 | #define TFT_BL 21 // LED back-light control pin 12 | #define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW) 13 | 14 | #define TFT_MOSI 23 15 | #define TFT_SCLK 18 16 | #define TFT_CS 5 // Chip select control pin 17 | #define TFT_DC 22 // Data Command control pin 18 | #define TFT_RST 17 // Reset pin (could connect to RST pin) 19 | 20 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 21 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 22 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 23 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 24 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 25 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 26 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 27 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 28 | 29 | #define SMOOTH_FONT 30 | 31 | #define SPI_FREQUENCY 27000000 32 | -------------------------------------------------------------------------------- /TFT_Drivers/SSD1963_Defines.h: -------------------------------------------------------------------------------- 1 | // Change the width and height if required (defined in portrait mode) 2 | // or use the constructor to over-ride defaults 3 | #if defined (SSD1963_480_DRIVER) 4 | #define TFT_WIDTH 272 5 | #define TFT_HEIGHT 480 6 | #elif defined (SSD1963_800_DRIVER) 7 | #define TFT_WIDTH 480 8 | #define TFT_HEIGHT 800 9 | #elif defined (SSD1963_800ALT_DRIVER) 10 | #define TFT_WIDTH 480 11 | #define TFT_HEIGHT 800 12 | #elif defined (SSD1963_800BD_DRIVER) 13 | #define TFT_WIDTH 480 14 | #define TFT_HEIGHT 800 15 | #endif 16 | 17 | //Set driver type common to all initialisation options 18 | #ifndef SSD1963_DRIVER 19 | #define SSD1963_DRIVER 20 | #endif 21 | 22 | // Delay between some initialisation commands 23 | #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 24 | 25 | // Generic commands used by TFT_eSPI.cpp 26 | #define TFT_NOP 0x00 27 | #define TFT_SWRST 0x01 28 | 29 | #define TFT_INVOFF 0x20 30 | #define TFT_INVON 0x21 31 | 32 | #define TFT_DISPOFF 0x28 33 | #define TFT_DISPON 0x29 34 | 35 | #define TFT_CASET 0x2A 36 | #define TFT_PASET 0x2B 37 | #define TFT_RAMWR 0x2C 38 | 39 | #define TFT_RAMRD 0x2E 40 | #define TFT_IDXRD 0xDD // ILI9341 only, indexed control register read 41 | 42 | #define TFT_MADCTL 0x36 43 | #define TFT_MAD_MY 0x80 44 | #define TFT_MAD_MX 0x40 45 | #define TFT_MAD_MV 0x20 46 | #define TFT_MAD_ML 0x10 47 | #define TFT_MAD_BGR 0x08 48 | #define TFT_MAD_MH 0x04 49 | #define TFT_MAD_RGB 0x00 50 | 51 | #ifdef TFT_RGB_ORDER 52 | #if (TFT_RGB_ORDER == 1) 53 | #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 54 | #else 55 | #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 56 | #endif 57 | #else 58 | #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 59 | #endif 60 | -------------------------------------------------------------------------------- /User_Setups/Setup3_ILI9163.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 3 3 | 4 | #define ILI9163_DRIVER 5 | 6 | 7 | #define TFT_WIDTH 128 8 | #define TFT_HEIGHT 160 9 | 10 | 11 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 12 | #define TFT_CS PIN_D8 // Chip select control pin D8 13 | #define TFT_DC PIN_D3 // Data Command control pin 14 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 15 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 16 | 17 | 18 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 19 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 20 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 21 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 22 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 23 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 24 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 25 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 26 | 27 | #define SMOOTH_FONT 28 | 29 | 30 | // #define SPI_FREQUENCY 20000000 31 | #define SPI_FREQUENCY 27000000 32 | // #define SPI_FREQUENCY 40000000 33 | 34 | #define SPI_TOUCH_FREQUENCY 2500000 35 | 36 | 37 | // #define SUPPORT_TRANSACTIONS 38 | -------------------------------------------------------------------------------- /TFT_Drivers/HX8357B_Init.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that initialises the HX8357B driver 3 | // 4 | // This setup information uses simple 8-bit SPI writecommand() and writedata() functions 5 | // 6 | // See ST7735_Setup.h file for an alternative format 7 | 8 | 9 | // Configure HX8357-B display 10 | writecommand(0x11); 11 | delay(20); 12 | writecommand(0xD0); 13 | writedata(0x07); 14 | writedata(0x42); 15 | writedata(0x18); 16 | 17 | writecommand(0xD1); 18 | writedata(0x00); 19 | writedata(0x07); 20 | writedata(0x10); 21 | 22 | writecommand(0xD2); 23 | writedata(0x01); 24 | writedata(0x02); 25 | 26 | writecommand(0xC0); 27 | writedata(0x10); 28 | writedata(0x3B); 29 | writedata(0x00); 30 | writedata(0x02); 31 | writedata(0x11); 32 | 33 | writecommand(0xC5); 34 | writedata(0x08); 35 | 36 | writecommand(0xC8); 37 | writedata(0x00); 38 | writedata(0x32); 39 | writedata(0x36); 40 | writedata(0x45); 41 | writedata(0x06); 42 | writedata(0x16); 43 | writedata(0x37); 44 | writedata(0x75); 45 | writedata(0x77); 46 | writedata(0x54); 47 | writedata(0x0C); 48 | writedata(0x00); 49 | 50 | writecommand(0x36); 51 | writedata(0x0a); 52 | 53 | writecommand(0x3A); 54 | writedata(0x55); 55 | 56 | writecommand(0x2A); 57 | writedata(0x00); 58 | writedata(0x00); 59 | writedata(0x01); 60 | writedata(0x3F); 61 | 62 | writecommand(0x2B); 63 | writedata(0x00); 64 | writedata(0x00); 65 | writedata(0x01); 66 | writedata(0xDF); 67 | 68 | delay(120); 69 | writecommand(0x29); 70 | 71 | delay(25); 72 | 73 | // End of HX8357B display configuration 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /User_Setups/Setup42_ILI9341_ESP32.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 42 3 | 4 | #define ILI9341_DRIVER 5 | 6 | #define TFT_MISO 19 // (leave TFT SDO disconnected if other SPI devices share MISO) 7 | #define TFT_MOSI 23 8 | #define TFT_SCLK 18 9 | #define TFT_CS 15 // Chip select control pin 10 | #define TFT_DC 2 // Data Command control pin 11 | #define TFT_RST 4 // Reset pin (could connect to RST pin) 12 | 13 | // Optional touch screen chip select 14 | //#define TOUCH_CS 5 // Chip select pin (T_CS) of touch screen 15 | 16 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 17 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 18 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 19 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 20 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 21 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 22 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 23 | 24 | #define SMOOTH_FONT 25 | 26 | // TFT SPI clock frequency 27 | // #define SPI_FREQUENCY 20000000 28 | // #define SPI_FREQUENCY 27000000 29 | #define SPI_FREQUENCY 40000000 30 | // #define SPI_FREQUENCY 80000000 31 | 32 | // Optional reduced SPI frequency for reading TFT 33 | #define SPI_READ_FREQUENCY 16000000 34 | 35 | // SPI clock frequency for touch controller 36 | #define SPI_TOUCH_FREQUENCY 2500000 37 | -------------------------------------------------------------------------------- /User_Setups/Setup8_ILI9163_128x128.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 8 3 | 4 | #define ILI9163_DRIVER 5 | 6 | 7 | #define TFT_WIDTH 128 8 | #define TFT_HEIGHT 128 9 | 10 | 11 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 12 | #define TFT_CS PIN_D8 // Chip select control pin D8 13 | #define TFT_DC PIN_D3 // Data Command control pin 14 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 15 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 16 | 17 | 18 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 19 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 20 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 21 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 22 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 23 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 24 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 25 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 26 | 27 | #define SMOOTH_FONT 28 | 29 | 30 | // #define SPI_FREQUENCY 20000000 31 | #define SPI_FREQUENCY 27000000 // Actually sets it to 26.67MHz = 80/3 32 | 33 | #define SPI_TOUCH_FREQUENCY 2500000 34 | 35 | 36 | // #define SUPPORT_TRANSACTIONS 37 | -------------------------------------------------------------------------------- /Fonts/GFXFF/license.txt: -------------------------------------------------------------------------------- 1 | This TFT_eSPI library has been developed from the Adafruit_GFX library: 2 | 3 | https://github.com/adafruit/Adafruit-GFX-Library 4 | 5 | It has been modified extensively to improve rendering speed on 6 | ESP8266 processors. There follows the original library license text. 7 | 8 | 9 | Original text follows: 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2012 Adafruit Industries. All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 18 | - Redistributions of source code must retain the above copyright notice, 19 | this list of conditions and the following disclaimer. 20 | - Redistributions in binary form must reproduce the above copyright notice, 21 | this list of conditions and the following disclaimer in the documentation 22 | and/or other materials provided with the distribution. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 28 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 | POSSIBILITY OF SUCH DAMAGE. 35 | -------------------------------------------------------------------------------- /docs/PlatformIO/rp2040.txt: -------------------------------------------------------------------------------- 1 | ;PlatformIO User notes: 2 | 3 | ;It is possible to load settings from the calling program rather than modifying 4 | ;the library for each project by modifying the "platformio.ini" file. 5 | 6 | ;The User_Setup_Select.h file will not load the user setting header files if 7 | ;USER_SETUP_LOADED is defined. 8 | 9 | ;Instead of using #define, use the -D prefix, for example: 10 | 11 | ; PlatformIO Project Configuration File 12 | ; 13 | ; Build options: build flags, source filter, extra scripting 14 | ; Upload options: custom port, speed and extra flags 15 | ; Library options: dependencies, extra library storages 16 | ; 17 | ; Please visit documentation for the other options and examples 18 | ; http://docs.platformio.org/page/projectconf.html 19 | 20 | [env:pico] 21 | platform = https://github.com/maxgerhardt/platform-raspberrypi.git 22 | board = pico 23 | framework = arduino 24 | board_build.core = earlephilhower 25 | board_build.filesystem_size = 0.5m 26 | lib_deps = bodmer/TFT_eSPI@^2.5.21 27 | ; change microcontroller 28 | board_build.mcu = rp2040 29 | 30 | ; change MCU frequency 31 | board_build.f_cpu = 133000000L 32 | 33 | build_flags = 34 | -Os 35 | -DUSER_SETUP_LOADED=1 36 | ; Define the TFT driver, pins etc. here: 37 | -DTFT_PARALLEL_8_BIT=1 38 | -DRM68120_DRIVER=1 39 | -DRP2040_PIO_CLK_DIV=1 40 | -DTFT_DC=28 41 | -DTFT_WR=22 42 | -DTFT_RST=2 43 | 44 | -DTFT_D0=6 45 | -DTFT_D1=7 46 | -DTFT_D2=8 47 | -DTFT_D3=9 48 | -DTFT_D4=10 49 | -DTFT_D5=11 50 | -DTFT_D6=12 51 | -DTFT_D7=13 52 | 53 | -DTFT_BL=16 54 | -DTFT_BACKLIGHT_ON=HIGH 55 | 56 | -DLOAD_GLCD=1 57 | -DLOAD_FONT2=1 58 | -DLOAD_FONT4=1 59 | -DLOAD_FONT6=1 60 | -DLOAD_FONT7=1 61 | -DLOAD_FONT8=1 62 | -DLOAD_GFXFF=1 63 | -DSMOOTH_FONT=1 64 | -------------------------------------------------------------------------------- /TFT_Drivers/RM68140_Init.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that initialises the RM68140 driver 3 | // 4 | // This setup information uses simple 8-bit SPI writecommand() and writedata() functions 5 | // 6 | // See ST7735_Setup.h file for an alternative format 7 | 8 | 9 | // Configure RM68140 display 10 | 11 | writecommand(TFT_SLPOUT); 12 | delay(20); 13 | 14 | writecommand(0xD0); 15 | writedata(0x07); 16 | writedata(0x42); 17 | writedata(0x18); 18 | 19 | writecommand(0xD1); 20 | writedata(0x00); 21 | writedata(0x07); 22 | writedata(0x10); 23 | 24 | writecommand(0xD2); 25 | writedata(0x01); 26 | writedata(0x02); 27 | 28 | writecommand(0xC0); 29 | writedata(0x10); 30 | writedata(0x3B); 31 | writedata(0x00); 32 | writedata(0x02); 33 | writedata(0x11); 34 | 35 | writecommand(0xC5); 36 | writedata(0x03); 37 | 38 | writecommand(0xC8); 39 | writedata(0x00); 40 | writedata(0x32); 41 | writedata(0x36); 42 | writedata(0x45); 43 | writedata(0x06); 44 | writedata(0x16); 45 | writedata(0x37); 46 | writedata(0x75); 47 | writedata(0x77); 48 | writedata(0x54); 49 | writedata(0x0C); 50 | writedata(0x00); 51 | 52 | writecommand(TFT_MADCTL); 53 | writedata(0x0A); 54 | 55 | writecommand(0x3A); 56 | writedata(0x55); 57 | 58 | writecommand(TFT_CASET); 59 | writedata(0x00); 60 | writedata(0x00); 61 | writedata(0x01); 62 | writedata(0x3F); 63 | 64 | writecommand(TFT_PASET); 65 | writedata(0x00); 66 | writedata(0x00); 67 | writedata(0x01); 68 | writedata(0xDF); 69 | 70 | delay(120); 71 | writecommand(TFT_DISPON); 72 | 73 | delay(25); 74 | // End of RM68140 display configuration 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /User_Setups/Setup15_HX8357D.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 15 3 | 4 | #define HX8357D_DRIVER 5 | 6 | // If green and blue swapped on display then change the RGB colour order 7 | // Only uncomment ONE of the following options 8 | #define TFT_RGB_ORDER TFT_RGB // Red-Green-Blue 9 | //#define TFT_RGB_ORDER TFT_BGR // Blue-Green-RED 10 | 11 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 12 | #define TFT_CS PIN_D8 // Chip select control pin D8 13 | #define TFT_DC PIN_D3 // Data Command control pin 14 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 15 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 16 | 17 | 18 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 19 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 20 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 21 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 22 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 23 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 24 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 25 | 26 | #define SMOOTH_FONT 27 | 28 | 29 | // #define SPI_FREQUENCY 20000000 30 | #define SPI_FREQUENCY 27000000 31 | // #define SPI_FREQUENCY 40000000 32 | 33 | #define SPI_TOUCH_FREQUENCY 2500000 34 | 35 | 36 | // #define SUPPORT_TRANSACTIONS 37 | -------------------------------------------------------------------------------- /User_Setups/Setup212_LilyGo_T_PicoPro.h: -------------------------------------------------------------------------------- 1 | // ST7796 222 x 480 display with no chip select line 2 | #define USER_SETUP_ID 212 3 | 4 | #define ST7796_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 222 7 | #define TFT_HEIGHT 480 8 | 9 | #define CGRAM_OFFSET // Library will add offsets required 10 | 11 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 12 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 13 | 14 | #define TFT_INVERSION_ON 15 | 16 | #define TFT_MISO 4 17 | #define TFT_MOSI 7 18 | #define TFT_SCLK 6 19 | #define TFT_CS 8 20 | #define TFT_DC 9 21 | #define TFT_RST 16 22 | #define TFT_BACKLIGHT_ON 1 23 | #define TFT_BL 10 24 | 25 | 26 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 27 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 28 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 29 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 30 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 31 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 32 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 33 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 34 | 35 | #define SMOOTH_FONT 36 | 37 | 38 | // #define SPI_FREQUENCY 27000000 39 | #define SPI_FREQUENCY 40000000 40 | 41 | #define SPI_READ_FREQUENCY 20000000 42 | 43 | #define SPI_TOUCH_FREQUENCY 2500000 44 | 45 | // #define SUPPORT_TRANSACTIONS -------------------------------------------------------------------------------- /TFT_Drivers/R61581_Init.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that initialises the R61581 driver 3 | // 4 | // This setup information uses simple 8-bit SPI writecommand() and writedata() functions 5 | // 6 | // See ST7735_Setup.h file for an alternative format 7 | 8 | 9 | // Configure R61581 display 10 | 11 | writecommand(TFT_SLPOUT); 12 | delay(20); 13 | 14 | writecommand(0xB0); 15 | writedata(0x00); 16 | 17 | writecommand(0xD0); 18 | writedata(0x07); 19 | writedata(0x42); 20 | writedata(0x18); 21 | 22 | writecommand(0xD1); 23 | writedata(0x00); 24 | writedata(0x07); 25 | writedata(0x10); 26 | 27 | writecommand(0xD2); 28 | writedata(0x01); 29 | writedata(0x02); 30 | 31 | writecommand(0xC0); 32 | writedata(0x12); 33 | writedata(0x3B); 34 | writedata(0x00); 35 | writedata(0x02); 36 | writedata(0x11); 37 | 38 | writecommand(0xC5); 39 | writedata(0x03); 40 | 41 | writecommand(0xC8); 42 | writedata(0x00); 43 | writedata(0x32); 44 | writedata(0x36); 45 | writedata(0x45); 46 | writedata(0x06); 47 | writedata(0x16); 48 | writedata(0x37); 49 | writedata(0x75); 50 | writedata(0x77); 51 | writedata(0x54); 52 | writedata(0x0C); 53 | writedata(0x00); 54 | 55 | writecommand(TFT_MADCTL); 56 | writedata(0x0A); 57 | 58 | writecommand(0x3A); 59 | writedata(0x55); 60 | 61 | writecommand(TFT_CASET); 62 | writedata(0x00); 63 | writedata(0x00); 64 | writedata(0x01); 65 | writedata(0x3F); 66 | 67 | writecommand(TFT_PASET); 68 | writedata(0x00); 69 | writedata(0x00); 70 | writedata(0x01); 71 | writedata(0xDF); 72 | 73 | delay(120); 74 | writecommand(TFT_DISPON); 75 | 76 | delay(25); 77 | // End of R61581 display configuration 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /User_Setups/Setup210_LilyGo_T_Embed_S3.h: -------------------------------------------------------------------------------- 1 | // ST7789 170 x 320 display with no chip select line 2 | #define USER_SETUP_ID 210 3 | 4 | #define ST7789_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 170 7 | #define TFT_HEIGHT 320 8 | 9 | //#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 10 | //#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 11 | 12 | #define TFT_INVERSION_ON 13 | //#define TFT_INVERSION_OFF 14 | #define TFT_BACKLIGHT_ON 1 15 | 16 | #define TFT_BL 15 // LED back-light 17 | #define TFT_MISO -1 // Not connected 18 | #define TFT_MOSI 11 19 | #define TFT_SCLK 12 20 | #define TFT_CS 10 21 | #define TFT_DC 13 22 | #define TFT_RST 9 // Connect reset to ensure display initialises 23 | 24 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 25 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 26 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 27 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 28 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 29 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 30 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 31 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 32 | 33 | #define SMOOTH_FONT 34 | 35 | 36 | // #define SPI_FREQUENCY 27000000 37 | #define SPI_FREQUENCY 40000000 38 | 39 | #define SPI_READ_FREQUENCY 20000000 40 | 41 | #define SPI_TOUCH_FREQUENCY 2500000 42 | 43 | // #define SUPPORT_TRANSACTIONS -------------------------------------------------------------------------------- /examples/480 x 320/Touch_Controller_Demo/Touch_Controller_Demo.ino: -------------------------------------------------------------------------------- 1 | #include "FS.h" 2 | #include 3 | #include 4 | TFT_eSPI tft = TFT_eSPI(); 5 | 6 | #define CALIBRATION_FILE "/calibrationData" 7 | 8 | void setup(void) { 9 | uint16_t calibrationData[5]; 10 | uint8_t calDataOK = 0; 11 | 12 | Serial.begin(115200); 13 | Serial.println("starting"); 14 | 15 | tft.init(); 16 | 17 | tft.setRotation(3); 18 | tft.fillScreen((0xFFFF)); 19 | 20 | tft.setCursor(20, 0, 2); 21 | tft.setTextColor(TFT_BLACK, TFT_WHITE); tft.setTextSize(1); 22 | tft.println("calibration run"); 23 | 24 | // check file system 25 | if (!SPIFFS.begin()) { 26 | Serial.println("formatting file system"); 27 | 28 | SPIFFS.format(); 29 | SPIFFS.begin(); 30 | } 31 | 32 | // check if calibration file exists 33 | if (SPIFFS.exists(CALIBRATION_FILE)) { 34 | File f = SPIFFS.open(CALIBRATION_FILE, "r"); 35 | if (f) { 36 | if (f.readBytes((char *)calibrationData, 14) == 14) 37 | calDataOK = 1; 38 | f.close(); 39 | } 40 | } 41 | if (calDataOK) { 42 | // calibration data valid 43 | tft.setTouch(calibrationData); 44 | } else { 45 | // data not valid. recalibrate 46 | tft.calibrateTouch(calibrationData, TFT_WHITE, TFT_RED, 15); 47 | // store data 48 | File f = SPIFFS.open(CALIBRATION_FILE, "w"); 49 | if (f) { 50 | f.write((const unsigned char *)calibrationData, 14); 51 | f.close(); 52 | } 53 | } 54 | 55 | tft.fillScreen((0xFFFF)); 56 | 57 | } 58 | 59 | void loop() { 60 | uint16_t x, y; 61 | static uint16_t color; 62 | 63 | if (tft.getTouch(&x, &y)) { 64 | 65 | tft.setCursor(5, 5, 2); 66 | tft.printf("x: %i ", x); 67 | tft.setCursor(5, 20, 2); 68 | tft.printf("y: %i ", y); 69 | 70 | tft.drawPixel(x, y, color); 71 | color += 155; 72 | } 73 | } 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Fonts/GFXFF/print.txt: -------------------------------------------------------------------------------- 1 | #define TT1 TomThumb 2 | 3 | #define FF1 FreeMono9pt7b 4 | #define FF2 FreeMono12pt7b 5 | #define FF3 FreeMono18pt7b 6 | #define FF4 FreeMono24pt7b 7 | 8 | #define FF5 FreeMonoBold9pt7b 9 | #define FF6 FreeMonoBold12pt7b 10 | #define FF7 FreeMonoBold18pt7b 11 | #define FF8 FreeMonoBold24pt7b 12 | 13 | #define FF9 FreeMonoBoldOblique9pt7b 14 | #define FF10 FreeMonoBoldOblique12pt7b 15 | #define FF11 FreeMonoBoldOblique18pt7b 16 | #define FF12 FreeMonoBoldOblique24pt7b 17 | 18 | #define FF13 FreeMonoOblique9pt7b 19 | #define FF14 FreeMonoOblique12pt7b 20 | #define FF15 FreeMonoOblique18pt7b 21 | #define FF16 FreeMonoOblique24pt7b 22 | 23 | #define FF17 FreeSans9pt7b 24 | #define FF18 FreeSans12pt7b 25 | #define FF19 FreeSans18pt7b 26 | #define FF20 FreeSans24pt7b 27 | 28 | #define FF21 FreeSansBold9pt7b 29 | #define FF22 FreeSansBold12pt7b 30 | #define FF23 FreeSansBold18pt7b 31 | #define FF24 FreeSansBold24pt7b 32 | 33 | #define FF25 FreeSansBoldOblique9pt7b 34 | #define FF26 FreeSansBoldOblique12pt7b 35 | #define FF27 FreeSansBoldOblique18pt7b 36 | #define FF28 FreeSansBoldOblique24pt7b 37 | 38 | #define FF29 FreeSansOblique9pt7b 39 | #define FF30 FreeSansOblique12pt7b 40 | #define FF31 FreeSansOblique18pt7b 41 | #define FF32 FreeSansOblique24pt7b 42 | 43 | #define FF33 FreeSerif9pt7b 44 | #define FF34 FreeSerif12pt7b 45 | #define FF35 FreeSerif18pt7b 46 | #define FF36 FreeSerif24pt7b 47 | 48 | #define FF37 FreeSerifBold9pt7b 49 | #define FF38 FreeSerifBold12pt7b 50 | #define FF39 FreeSerifBold18pt7b 51 | #define FF40 FreeSerifBold24pt7b 52 | 53 | #define FF41 FreeSerifBoldItalic9pt7b 54 | #define FF42 FreeSerifBoldItalic12pt7b 55 | #define FF43 FreeSerifBoldItalic18pt7b 56 | #define FF44 FreeSerifBoldItalic24pt7b 57 | 58 | #define FF45 FreeSerifItalic9pt7b 59 | #define FF46 FreeSerifItalic12pt7b 60 | #define FF47 FreeSerifItalic18pt7b 61 | #define FF48 FreeSerifItalic24pt7b 62 | -------------------------------------------------------------------------------- /User_Setups/Setup211_LilyGo_T_QT_Pro_S3.h: -------------------------------------------------------------------------------- 1 | // GC9A01 128 x 128 display with no chip select line 2 | #define USER_SETUP_ID 211 3 | 4 | #define GC9A01_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 128 7 | #define TFT_HEIGHT 128 8 | 9 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 10 | //#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 11 | 12 | // #define TFT_INVERSION_ON 13 | //#define TFT_INVERSION_OFF 14 | #define TFT_BACKLIGHT_ON 0 15 | #define CGRAM_OFFSET 16 | 17 | 18 | #define TFT_BL 10 // LED back-light 19 | #define TFT_MISO -1 // Not connected 20 | #define TFT_MOSI 2 21 | #define TFT_SCLK 3 22 | #define TFT_CS 5 23 | #define TFT_DC 6 24 | #define TFT_RST 1 // Connect reset to ensure display initialises 25 | 26 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 27 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 28 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 29 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 30 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 31 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 32 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 33 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 34 | 35 | #define SMOOTH_FONT 36 | 37 | 38 | // #define SPI_FREQUENCY 27000000 39 | #define SPI_FREQUENCY 40000000 40 | 41 | #define SPI_READ_FREQUENCY 20000000 42 | 43 | #define SPI_TOUCH_FREQUENCY 2500000 44 | 45 | // #define SUPPORT_TRANSACTIONS -------------------------------------------------------------------------------- /User_Setups/Setup26_TTGO_T_Wristband.h: -------------------------------------------------------------------------------- 1 | #define USER_SETUP_ID 26 2 | 3 | #define ST7735_DRIVER 4 | 5 | #define TFT_WIDTH 80 6 | #define TFT_HEIGHT 160 7 | 8 | 9 | #define TFT_RST 26 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 10 | #define TFT_MISO -1 11 | #define TFT_MOSI 19 12 | #define TFT_SCLK 18 13 | #define TFT_CS 5 14 | #define TFT_DC 23 15 | #define TFT_BL 27 // Dispaly backlight control pin 16 | 17 | #define TFT_BACKLIGHT_ON HIGH // HIGH or LOW are options 18 | 19 | #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) 20 | 21 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 22 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 23 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 24 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 25 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 26 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 27 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 28 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 29 | 30 | // Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded 31 | // this will save ~20kbytes of FLASH 32 | #define SMOOTH_FONT 33 | 34 | #define SPI_FREQUENCY 27000000 // Actually sets it to 26.67MHz = 80/3 35 | 36 | // #define SPI_FREQUENCY 40000000 // Maximum to use SPIFFS 37 | // #define SPI_FREQUENCY 80000000 38 | -------------------------------------------------------------------------------- /User_Setups/User_Custom_Fonts.h: -------------------------------------------------------------------------------- 1 | 2 | // Custom "Adafruit" compatible font files can be added to the "TFT_eSPI/Fonts/Custom" folder 3 | // Fonts in a suitable format can be created using a Squix blog web based tool here: 4 | /* 5 | https://blog.squix.org/2016/10/font-creator-now-creates-adafruit-gfx-fonts.html 6 | */ 7 | 8 | // Note: At the time of writing there is a last character code definition bug in the 9 | // Squix font file format so do NOT try and print the tilde (~) symbol (ASCII 0x7E) 10 | // Alternatively look at the end of the font header file and edit: 0x7E to read 0x7D 11 | /* e.g. vvvv 12 | (uint8_t *)Orbitron_Light_32Bitmaps,(GFXglyph *)Orbitron_Light_32Glyphs,0x20, 0x7D, 32}; 13 | ^^^^ 14 | */ 15 | 16 | // When font files are placed in the Custom folder (TFT_eSPI\Fonts\Custom) then they must 17 | // also be #included here: 18 | 19 | // The CF_OL24 etc. are a shorthand reference, but this is not essential to use the fonts 20 | 21 | #ifdef LOAD_GFXFF 22 | 23 | // New custom font file #includes 24 | #include // CF_OL24 25 | #include // CF_OL32 26 | #include // CF_RT24 27 | #include // CF_S24 28 | #include // CF_Y32 29 | 30 | #endif 31 | 32 | // Shorthand references - any coding scheme can be used, here CF_ = Custom Font 33 | // The #defines below MUST be added to sketches to use shorthand references, so 34 | // they are only put here for reference and copy+paste purposes! 35 | /* 36 | #define CF_OL24 &Orbitron_Light_24 37 | #define CF_OL32 &Orbitron_Light_32 38 | #define CF_RT24 &Roboto_Thin_24 39 | #define CF_S24 &Satisfy_24 40 | #define CF_Y32 &Yellowtail_32 41 | */ 42 | -------------------------------------------------------------------------------- /Extensions/Button.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************************** 2 | // The following button class has been ported over from the Adafruit_GFX library so 3 | // should be compatible. 4 | // A slightly different implementation in this TFT_eSPI library allows the button 5 | // legends to be in any font, allow longer labels and to adjust text positioning 6 | // within button 7 | ***************************************************************************************/ 8 | 9 | class TFT_eSPI_Button 10 | { 11 | public: 12 | TFT_eSPI_Button(void); 13 | // "Classic" initButton() uses centre & size 14 | void initButton(TFT_eSPI *gfx, int16_t x, int16_t y, 15 | uint16_t w, uint16_t h, uint16_t outline, uint16_t fill, 16 | uint16_t textcolor, char *label, uint8_t textsize); 17 | 18 | // New/alt initButton() uses upper-left corner & size 19 | void initButtonUL(TFT_eSPI *gfx, int16_t x1, int16_t y1, 20 | uint16_t w, uint16_t h, uint16_t outline, uint16_t fill, 21 | uint16_t textcolor, char *label, uint8_t textsize); 22 | 23 | // Adjust text datum and x, y deltas 24 | void setLabelDatum(int16_t x_delta, int16_t y_delta, uint8_t datum = MC_DATUM); 25 | 26 | void drawButton(bool inverted = false, String long_name = ""); 27 | bool contains(int16_t x, int16_t y); 28 | 29 | void press(bool p); 30 | bool isPressed(); 31 | bool justPressed(); 32 | bool justReleased(); 33 | 34 | private: 35 | TFT_eSPI *_gfx; 36 | int16_t _x1, _y1; // Coordinates of top-left corner of button 37 | int16_t _xd, _yd; // Button text datum offsets (wrt centre of button) 38 | uint16_t _w, _h; // Width and height of button 39 | uint8_t _textsize, _textdatum; // Text size multiplier and text datum for button 40 | uint16_t _outlinecolor, _fillcolor, _textcolor; 41 | char _label[10]; // Button text is 9 chars maximum unless long_name used 42 | 43 | bool currstate, laststate; // Button states 44 | }; 45 | -------------------------------------------------------------------------------- /examples/Smooth Graphics/Smooth_Arc/Smooth_Arc.ino: -------------------------------------------------------------------------------- 1 | // Example for drawSmoothArc function. 2 | // Draws smooth arcs with rounded or square smooth ends 3 | 4 | #include // Include the graphics library 5 | TFT_eSPI tft = TFT_eSPI(); // Create object "tft" 6 | 7 | // ------------------------------------------------------------------------- 8 | // Setup 9 | // ------------------------------------------------------------------------- 10 | void setup(void) { 11 | Serial.begin(115200); 12 | 13 | tft.init(); 14 | tft.setRotation(1); 15 | tft.fillScreen(TFT_BLACK); 16 | } 17 | 18 | // ------------------------------------------------------------------------- 19 | // Main loop 20 | // ------------------------------------------------------------------------- 21 | void loop() 22 | { 23 | static uint32_t count = 0; 24 | 25 | uint16_t fg_color = random(0x10000); 26 | uint16_t bg_color = TFT_BLACK; // This is the background colour used for smoothing (anti-aliasing) 27 | 28 | uint16_t x = random(tft.width()); // Position of centre of arc 29 | uint16_t y = random(tft.height()); 30 | 31 | uint8_t radius = random(20, tft.width()/4); // Outer arc radius 32 | uint8_t thickness = random(1, radius / 4); // Thickness 33 | uint8_t inner_radius = radius - thickness; // Calculate inner radius (can be 0 for circle segment) 34 | 35 | // 0 degrees is at 6 o'clock position 36 | // Arcs are drawn clockwise from start_angle to end_angle 37 | uint16_t start_angle = random(361); // Start angle must be in range 0 to 360 38 | uint16_t end_angle = random(361); // End angle must be in range 0 to 360 39 | 40 | bool arc_end = random(2); // true = round ends, false = square ends (arc_end parameter can be omitted, ends will then be square) 41 | 42 | tft.drawSmoothArc(x, y, radius, inner_radius, start_angle, end_angle, fg_color, bg_color, arc_end); 43 | 44 | count++; 45 | if (count < 30) delay(500); // After 15s draw as fast as possible! 46 | } 47 | -------------------------------------------------------------------------------- /examples/Smooth Graphics/Colour_Wheel/Colour_Wheel.ino: -------------------------------------------------------------------------------- 1 | // Arc drawing example - draw a colour wheel 2 | 3 | #include // Include the graphics library 4 | TFT_eSPI tft = TFT_eSPI(); // Create object "tft" 5 | 6 | uint16_t colors[12]; 7 | 8 | // ------------------------------------------------------------------------- 9 | // Setup 10 | // ------------------------------------------------------------------------- 11 | void setup(void) { 12 | Serial.begin(115200); 13 | tft.init(); 14 | tft.fillScreen(TFT_BLACK); 15 | 16 | // Create the outer ring colours 17 | for (uint8_t c = 0; c < 2; c++) { 18 | colors[c + 10] = tft.alphaBlend(128 + c * 127, TFT_RED, TFT_MAGENTA); 19 | colors[c + 8] = tft.alphaBlend(128 + c * 127, TFT_MAGENTA, TFT_BLUE); 20 | colors[c + 6] = tft.alphaBlend(128 + c * 127, TFT_BLUE, TFT_GREEN); 21 | colors[c + 4] = tft.alphaBlend(128 + c * 127, TFT_GREEN, TFT_YELLOW); 22 | colors[c + 2] = tft.alphaBlend(128 + c * 127, TFT_YELLOW, TFT_ORANGE); 23 | colors[c + 0] = tft.alphaBlend(128 + c * 127, TFT_ORANGE, TFT_RED); 24 | } 25 | } 26 | 27 | // ------------------------------------------------------------------------- 28 | // Main loop 29 | // ------------------------------------------------------------------------- 30 | void loop() { 31 | uint16_t rDelta = (tft.width() - 1) / 10; 32 | uint16_t x = tft.width() / 2; 33 | uint16_t y = tft.height() / 2; 34 | bool smooth = true; 35 | 36 | // Draw rings as a series of arcs, increasingly blend colour with white towards middle 37 | for (uint16_t i = 5; i > 0; i--) { 38 | for (uint16_t angle = 0; angle <= 330; angle += 30) { 39 | uint16_t radius = i * rDelta; 40 | uint16_t wheelColor = tft.alphaBlend((i * 255.0)/5.0, colors[angle / 30], TFT_WHITE); 41 | tft.drawArc(x, y, radius, radius - rDelta, angle, angle + 30, wheelColor, TFT_BLACK, smooth); 42 | } 43 | smooth = false; // Only outer ring is smooth 44 | } 45 | 46 | while (1) delay(100); 47 | } 48 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Issue template 3 | about: Guide to content 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Only raise issues for problems with the library and/or provided examples. Post questions, comments and useful tips etc in the "Discussions" section. 11 | 12 | To minimise effort to resolve issues the following should be provided as a minimum: 13 | 1. A description of the problem and the conditions that cause it to occur 14 | 2. IDE (e.g. Arduino or PlatformIO) 15 | 3. TFT_eSPI library version (try the latest, the problem may have been resolved!) from the Manage Libraries... menu 16 | 4. Board package version (e.g. 2.0.3) available from the Boards Manager... menu 17 | 5. Procesor, e.g RP2040, ESP32 S3 etc 18 | 6. TFT driver (e.g. ILI9341), a link to the vendors product web page is useful too. 19 | 7. Interface type (SPI or parallel) 20 | 21 | Plus further information as appropriate to the problem: 22 | 1. TFT to processor connections used 23 | 2. A zip file containing your setup file (just drag and drop in message window - do not paste in long files!) 24 | 3. A zip file containing a simple and complete example sketch that demonstrates the problem but needs no special hardware sensors or libraries. 25 | 4. Screen shot pictures showing the problem (just drag and drop in message window) 26 | 27 | The idea is to provide sufficient information so I can setup the exact same (or sufficiently similar) scenario to investigate and resolve the issue without having a tedious ping-pong of Q&A. 28 | 29 | DO NOT paste code directly into the issue. To correctly format code put three ticks ( ` character on key next to "1" key) at the start and end of short pasted code segments to avoid format/markup anomolies. [See here:](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code) 30 | 31 | Example output: 32 | 33 | ``` 34 | Serial.begin(115200); 35 | tft.init(); 36 | ``` 37 | -------------------------------------------------------------------------------- /User_Setups/Setup301_BW16_ST7735.h: -------------------------------------------------------------------------------- 1 | #include "itoa.h" 2 | #include 3 | 4 | 5 | // Setup for BW16 and ST7735 80 x 160 TFT 6 | #define USER_SETUP_ID 301 7 | // See SetupX_Template.h for all options available 8 | 9 | #define ST7735_DRIVER 10 | 11 | 12 | #define TFT_WIDTH 80 13 | #define TFT_HEIGHT 160 14 | 15 | 16 | #define ST7735_GREENTAB160x80 17 | 18 | // For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display 19 | // Try ONE option at a time to find the correct colour order for your display 20 | 21 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 22 | // #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 23 | 24 | // Pin Mappings for BW16 board 25 | #define TFT_MISO 11 26 | #define TFT_MOSI 12 27 | #define TFT_SCLK 10 28 | #define TFT_CS 9 // Chip select control pin 29 | #define TFT_DC 8 // Data Command control pin 30 | #define TFT_RST 6 // Reset pin (could connect to RST pin) 31 | 32 | 33 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 34 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 35 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 36 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 37 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 38 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 39 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 40 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 41 | 42 | #define SMOOTH_FONT 43 | 44 | 45 | #define SPI_FREQUENCY 20000000 46 | //#define SPI_FREQUENCY 27000000 // Actually sets it to 26.67MHz = 80/3 47 | 48 | -------------------------------------------------------------------------------- /examples/Generic/drawXBitmap/drawXBitmap.ino: -------------------------------------------------------------------------------- 1 | // Example sketch to demonstrate the drawing of X BitMap (XBM) 2 | // format image onto the display. 3 | 4 | // Information on the X BitMap (XBM) format can be found here: 5 | // https://en.wikipedia.org/wiki/X_BitMap 6 | 7 | // This example is part of the TFT_eSPI library: 8 | // https://github.com/Bodmer/TFT_eSPI 9 | 10 | // Created by Bodmer 23/04/18 11 | 12 | #include "xbm.h" // Sketch tab header for xbm images 13 | 14 | #include // Hardware-specific library 15 | 16 | TFT_eSPI tft = TFT_eSPI(); // Invoke library 17 | 18 | 19 | void setup() 20 | { 21 | tft.begin(); // Initialise the display 22 | tft.fillScreen(TFT_BLACK); // Black screen fill 23 | } 24 | 25 | void loop() 26 | { 27 | 28 | // Example 1 29 | // ========= 30 | // Random x and y coordinates 31 | int x = random(tft.width() - logoWidth); 32 | int y = random(tft.height() - logoHeight); 33 | 34 | // Draw bitmap with top left corner at x,y with foreground only color 35 | // Bits set to 1 plot as the defined color, bits set to 0 are not plotted 36 | // x y xbm xbm width xbm height color 37 | tft.drawXBitmap(x, y, logo, logoWidth, logoHeight, TFT_WHITE); 38 | 39 | delay(500); 40 | 41 | // Erase old one by drawing over with background colour 42 | tft.drawXBitmap(x, y, logo, logoWidth, logoHeight, TFT_BLACK); 43 | 44 | 45 | // Example 2 46 | // ========= 47 | // New random x and y coordinates 48 | x = random(tft.width() - logoWidth); 49 | y = random(tft.height() - logoHeight); 50 | 51 | // Draw bitmap with top left corner at x,y with foreground and background colors 52 | // Bits set to 1 plot as the defined fg color, bits set to 0 are plotted as bg color 53 | // x y xbm xbm width xbm height fg color bg color 54 | tft.drawXBitmap(x, y, logo, logoWidth, logoHeight, TFT_WHITE, TFT_RED); 55 | 56 | delay(500); 57 | 58 | // Erase old one by drawing over with background colour 59 | tft.drawXBitmap(x, y, logo, logoWidth, logoHeight, TFT_BLACK, TFT_BLACK); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /User_Setups/Setup2_ST7735.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 2 3 | 4 | #define ST7735_DRIVER 5 | 6 | 7 | #define TFT_WIDTH 128 8 | #define TFT_HEIGHT 160 9 | 10 | 11 | #define ST7735_REDTAB 12 | 13 | // For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display 14 | // Try ONE option at a time to find the correct colour order for your display 15 | 16 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 17 | // #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 18 | 19 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 20 | #define TFT_CS PIN_D8 // Chip select control pin D8 21 | #define TFT_DC PIN_D3 // Data Command control pin 22 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 23 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 24 | 25 | 26 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 27 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 28 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 29 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 30 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 31 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 32 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 33 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 34 | 35 | #define SMOOTH_FONT 36 | 37 | 38 | // #define SPI_FREQUENCY 20000000 39 | #define SPI_FREQUENCY 27000000 40 | // #define SPI_FREQUENCY 40000000 41 | 42 | #define SPI_TOUCH_FREQUENCY 2500000 43 | 44 | 45 | // #define SUPPORT_TRANSACTIONS 46 | -------------------------------------------------------------------------------- /User_Setups/Setup201_WT32_SC01.h: -------------------------------------------------------------------------------- 1 | // USER DEFINED SETTINGS 2 | // Set driver type, fonts to be loaded, pins used and SPI control method etc. 3 | // 4 | // See the User_Setup_Select.h file if you wish to be able to define multiple 5 | // setups and then easily select which setup file is used by the compiler. 6 | // 7 | // If this file is edited correctly then all the library example sketches should 8 | // run without the need to make any more changes for a particular hardware setup! 9 | // Note that some sketches are designed for a particular TFT pixel width/height 10 | #define USER_SETUP_ID 201 11 | 12 | // User defined setup 13 | #define ST7796_DRIVER 14 | 15 | #define TFT_WIDTH 480 16 | #define TFT_HEIGHT 320 17 | 18 | #define TFT_BACKLIGHT_ON HIGH 19 | 20 | #define USE_HSPI_PORT 21 | 22 | #define TFT_MISO 12 23 | #define TFT_MOSI 13 24 | #define TFT_SCLK 14 25 | #define TFT_CS 15 26 | #define TFT_DC 21 27 | #define TFT_RST 22 28 | #define TFT_BL 23 29 | 30 | 31 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 32 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 33 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 34 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 35 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 36 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 37 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 38 | 39 | #define SMOOTH_FONT 40 | 41 | // SPI frequency for TFT writes 42 | // #define SPI_FREQUENCY 10000000 43 | // #define SPI_FREQUENCY 20000000 44 | #define SPI_FREQUENCY 27000000 45 | // #define SPI_FREQUENCY 40000000 46 | // #define SPI_FREQUENCY 80000000 47 | 48 | // Optional reduced SPI frequency for reading TFT 49 | #define SPI_READ_FREQUENCY 20000000 50 | -------------------------------------------------------------------------------- /User_Setups/Setup7_ST7735_128x128.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 7 3 | 4 | #define ST7735_DRIVER 5 | 6 | 7 | #define TFT_WIDTH 128 8 | #define TFT_HEIGHT 128 9 | 10 | 11 | #define ST7735_GREENTAB128 // For 128 x 128 display 12 | 13 | // For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display 14 | // Try ONE option at a time to find the correct colour order for your display 15 | 16 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 17 | // #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 18 | 19 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 20 | #define TFT_CS PIN_D8 // Chip select control pin D8 21 | #define TFT_DC PIN_D3 // Data Command control pin 22 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 23 | //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V 24 | 25 | 26 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 27 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 28 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 29 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 30 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 31 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 32 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 33 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 34 | 35 | 36 | #define SMOOTH_FONT 37 | 38 | 39 | // #define SPI_FREQUENCY 20000000 40 | #define SPI_FREQUENCY 27000000 41 | 42 | #define SPI_TOUCH_FREQUENCY 2500000 43 | 44 | 45 | // #define SUPPORT_TRANSACTIONS 46 | -------------------------------------------------------------------------------- /User_Setups/Setup18_ST7789.h: -------------------------------------------------------------------------------- 1 | // See SetupX_Template.h for all options available 2 | #define USER_SETUP_ID 18 3 | 4 | #define ST7789_DRIVER 5 | 6 | // #define TFT_SDA_READ // This option is for ESP32 ONLY, tested with ST7789 display only 7 | 8 | // If colours are inverted (white shows as black) then uncomment one of the next 9 | // 2 lines try both options, one of the options should correct the inversion. 10 | // #define TFT_INVERSION_ON 11 | // #define TFT_INVERSION_OFF 12 | 13 | // For ST7789 ONLY, define the colour order IF the blue and red are swapped on your display 14 | // Try ONE option at a time to find the correct colour order for your display 15 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 16 | // #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 17 | 18 | 19 | // My ST7789 display has TCT_CS wired permananently low so the pin is not defined here 20 | 21 | // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation 22 | #define TFT_DC PIN_D3 // Data Command control pin 23 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) 24 | 25 | 26 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 27 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 28 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 29 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 30 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 31 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 32 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 33 | 34 | #define SMOOTH_FONT 35 | 36 | 37 | // #define SPI_FREQUENCY 20000000 38 | #define SPI_FREQUENCY 27000000 39 | // #define SPI_FREQUENCY 40000000 40 | // #define SPI_FREQUENCY 80000000 41 | 42 | #define SPI_TOUCH_FREQUENCY 2500000 43 | 44 | 45 | //#define SUPPORT_TRANSACTIONS 46 | -------------------------------------------------------------------------------- /TFT_Drivers/ST7796_Rotation.h: -------------------------------------------------------------------------------- 1 | 2 | // This is the command sequence that rotates the ST7796 driver coordinate frame 3 | 4 | rotation = m % 8; // Limit the range of values to 0-7 5 | 6 | writecommand(TFT_MADCTL); 7 | switch (rotation) { 8 | case 0: 9 | writedata(TFT_MAD_MX | TFT_MAD_COLOR_ORDER); 10 | _width = _init_width; 11 | _height = _init_height; 12 | #ifdef CGRAM_OFFSET 13 | if (_init_width == 222) 14 | { 15 | colstart = 49; 16 | rowstart = 0; 17 | } 18 | #endif 19 | break; 20 | case 1: 21 | writedata(TFT_MAD_MV | TFT_MAD_COLOR_ORDER); 22 | _width = _init_height; 23 | _height = _init_width; 24 | #ifdef CGRAM_OFFSET 25 | if (_init_width == 222) 26 | { 27 | colstart = 0; 28 | rowstart = 49; 29 | } 30 | #endif 31 | break; 32 | case 2: 33 | writedata(TFT_MAD_MY | TFT_MAD_COLOR_ORDER); 34 | _width = _init_width; 35 | _height = _init_height; 36 | #ifdef CGRAM_OFFSET 37 | if (_init_width == 222) 38 | { 39 | colstart = 49; 40 | rowstart = 0; 41 | } 42 | #endif 43 | break; 44 | case 3: 45 | writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER); 46 | _width = _init_height; 47 | _height = _init_width; 48 | #ifdef CGRAM_OFFSET 49 | if (_init_width == 222) 50 | { 51 | colstart = 0; 52 | rowstart = 49; 53 | } 54 | #endif 55 | break; 56 | // These next rotations are for bottom up BMP drawing 57 | case 4: 58 | writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER); 59 | _width = _init_width; 60 | _height = _init_height; 61 | break; 62 | case 5: 63 | writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_COLOR_ORDER); 64 | _width = _init_height; 65 | _height = _init_width; 66 | break; 67 | case 6: 68 | writedata(TFT_MAD_COLOR_ORDER); 69 | _width = _init_width; 70 | _height = _init_height; 71 | break; 72 | case 7: 73 | writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER); 74 | _width = _init_height; 75 | _height = _init_width; 76 | break; 77 | 78 | } 79 | -------------------------------------------------------------------------------- /User_Setups/Setup209_LilyGo_T_Dongle_S3.h: -------------------------------------------------------------------------------- 1 | // Config for LilyGo T-Dongle S3 w ESP32 and ST7735 80 x 160 display 2 | #define USER_SETUP_ID 209 3 | 4 | #define ST7735_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 80 7 | #define TFT_HEIGHT 160 8 | 9 | // #define ST7735_INITB 10 | // #define ST7735_GREENTAB 11 | // #define ST7735_GREENTAB2 12 | // #define ST7735_GREENTAB3 13 | // #define ST7735_GREENTAB128 // For 128 x 128 display 14 | #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) 15 | // #define ST7735_REDTAB 16 | //#define ST7735_BLACKTAB 17 | // #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset 18 | 19 | //#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 20 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 21 | 22 | //#define TFT_INVERSION_ON 23 | //#define TFT_INVERSION_OFF 24 | 25 | // Generic ESP32 setup 26 | #define TFT_MISO -1 27 | #define TFT_MOSI 3 28 | #define TFT_SCLK 5 29 | #define TFT_CS 4 30 | #define TFT_DC 2 31 | #define TFT_RST 1 // Connect reset to ensure display initialises 32 | 33 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 34 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 35 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 36 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 37 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 38 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 39 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 40 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 41 | 42 | #define SMOOTH_FONT 43 | 44 | 45 | #define SPI_FREQUENCY 27000000 46 | //#define SPI_FREQUENCY 40000000 47 | 48 | #define SPI_READ_FREQUENCY 20000000 49 | 50 | #define SPI_TOUCH_FREQUENCY 2500000 51 | 52 | // #define SUPPORT_TRANSACTIONS -------------------------------------------------------------------------------- /User_Setups/Setup207_LilyGo_T_HMI.h: -------------------------------------------------------------------------------- 1 | // ST7789 240 x 240 display with no chip select line 2 | #define USER_SETUP_ID 207 3 | 4 | #define ST7789_DRIVER // Configure all registers 5 | 6 | // #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 7 | 8 | #define TFT_WIDTH 240 9 | #define TFT_HEIGHT 320 10 | 11 | // #define CGRAM_OFFSET 12 | // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 13 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 14 | 15 | // #define TFT_INVERSION_ON 16 | #define TFT_INVERSION_OFF 17 | 18 | #define TFT_PARALLEL_8_BIT 19 | 20 | // The ESP32 and TFT the pins used for testing are: 21 | #define TFT_CS 6 // Chip select control pin (library pulls permanently low 22 | #define TFT_DC 7 // Data Command control pin 23 | #define TFT_RST -1 // Reset pin, toggles on startup 24 | 25 | #define TFT_WR 8 // Write strobe control pin 26 | #define TFT_RD -1 // Read strobe control pin 27 | 28 | #define TFT_D0 48 // Must use pins in the range 0-31 or alternatively 32-48 29 | #define TFT_D1 47 // so a single register write sets/clears all bits. 30 | #define TFT_D2 39 // Pins can be randomly assigned, this does not affect 31 | #define TFT_D3 40 // TFT screen update performance. 32 | #define TFT_D4 41 33 | #define TFT_D5 42 34 | #define TFT_D6 45 35 | #define TFT_D7 46 36 | 37 | #define TFT_BL 38 // LED back-light 38 | 39 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 40 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 41 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 42 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 43 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 44 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 45 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 46 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 47 | 48 | #define SMOOTH_FONT 49 | -------------------------------------------------------------------------------- /User_Setups/Setup47_ST7735.h: -------------------------------------------------------------------------------- 1 | // Config for two ST7735 128 x 128 displays for Animated_Eyes example 2 | #define USER_SETUP_ID 47 3 | 4 | #define ST7735_DRIVER // Configure all registers 5 | 6 | #define TFT_WIDTH 128 7 | #define TFT_HEIGHT 128 8 | 9 | // #define ST7735_INITB 10 | // #define ST7735_GREENTAB 11 | // #define ST7735_GREENTAB2 12 | #define ST7735_GREENTAB3 13 | // #define ST7735_GREENTAB128 // For 128 x 128 display 14 | // #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) 15 | // #define ST7735_REDTAB 16 | //#define ST7735_BLACKTAB 17 | // #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset 18 | 19 | //#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 20 | #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 21 | 22 | //#define TFT_INVERSION_ON 23 | //#define TFT_INVERSION_OFF 24 | 25 | // Generic ESP32 setup 26 | #define TFT_MISO 19 27 | #define TFT_MOSI 23 28 | #define TFT_SCLK 18 29 | //#define TFT_CS 21 // Not defined here, chip select is managed by sketch 30 | #define TFT_DC 2 31 | #define TFT_RST 4 // Connect reset to ensure display initialises 32 | 33 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 34 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 35 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 36 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 37 | #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 38 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 39 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 40 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 41 | 42 | #define SMOOTH_FONT 43 | 44 | 45 | #define SPI_FREQUENCY 27000000 46 | //#define SPI_FREQUENCY 40000000 47 | 48 | #define SPI_READ_FREQUENCY 20000000 49 | 50 | #define SPI_TOUCH_FREQUENCY 2500000 51 | 52 | // #define SUPPORT_TRANSACTIONS --------------------------------------------------------------------------------