{"id":16239600,"url":"https://github.com/nopnop2002/esp-idf-parallel-tft","last_synced_at":"2025-04-05T14:04:26.824Z","repository":{"id":40373413,"uuid":"328792453","full_name":"nopnop2002/esp-idf-parallel-tft","owner":"nopnop2002","description":"8bit parallel TFT \u0026 4-line resistance touch screen Driver for esp-idf using i2s paralell mode","archived":false,"fork":false,"pushed_at":"2025-02-13T22:03:03.000Z","size":667,"stargazers_count":115,"open_issues_count":4,"forks_count":30,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T13:05:29.382Z","etag":null,"topics":["esp-idf","esp32","hx8347","ili9225","ili9325","ili9327","ili9341","ili9342","ili9481","ili9486","ili9488","lgdp4532","parallel","r61505","r61509v","spfd5408","st7781","st7783","st7796","tft-shield"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nopnop2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-11T21:11:02.000Z","updated_at":"2025-03-07T02:02:54.000Z","dependencies_parsed_at":"2025-01-06T03:07:56.539Z","dependency_job_id":"1d79c91e-af7e-435b-9b6a-fe3979306a03","html_url":"https://github.com/nopnop2002/esp-idf-parallel-tft","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-parallel-tft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-parallel-tft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-parallel-tft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-parallel-tft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/esp-idf-parallel-tft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345850,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp-idf","esp32","hx8347","ili9225","ili9325","ili9327","ili9341","ili9342","ili9481","ili9486","ili9488","lgdp4532","parallel","r61505","r61509v","spfd5408","st7781","st7783","st7796","tft-shield"],"created_at":"2024-10-10T13:44:17.176Z","updated_at":"2025-04-05T14:04:26.798Z","avatar_url":"https://github.com/nopnop2002.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-idf-parallel-tft\n8 bit parallel TFT \u0026 4-line resistance touch screen Driver for esp-idf.   \nYou can use such a TFT-Shield with esp32.   \n\n![TFT-Shield](https://user-images.githubusercontent.com/6020549/104253960-10a71380-54b9-11eb-8789-a12c2c769ab4.JPG)\n\n# Support driver\n\n## Generic Shield   \n- ILI9225   \n- ILI9226(Same as ILI9225)   \n- ILI9320   \n- ILI9325   \n- ILI9341   \n- ILI9342   \n- ILI9481   \n- ILI9486   \n- ILI9488   \n- SPFD5408(Same as ILI9320)   \n- R61505U(Same as ILI9320)   \n- R61509V   \n- LGDP4532   \n- ST7775(Same as ILI9225)   \n- ST7781   \n- ST7783(Same as ST7781)   \n- ST7793(Same as R61509)   \n- ST7796(Same as ILI9486)   \n- HX8347A(*2)   \n- HX8347D(Almost the same as HX8347A)(*2)   \n- HX8347G(Same as HX8347D)(*2)   \n- HX8347I(Same as HX8347D)(*2)   \n\n## OPEN-SMART Products   \n- OPEN-SMART ILI9225 TFT-Shield(176x220)(*5)   \n- OPEN-SMART ILI9327 TFT-Shield(240x400)(*3)(*5)   \n- OPEN-SMART ILI9340 TFT-Shield(240x320)(*5)   \n- OPEN-SMART S6D1121 16Pin-Parallel(240x320)(*1)(*5)   \n- OPEN-SMART ST7775  16Pin-Parallel(176x220 Same as ILI9225)(*1)(*5)   \n- OPEN-SMART ST7783  16Pin-Parallel(240x320)(*1)(*5)   \n- OPEN-SMART R61509V 16Pin-Parallel(240x400)(*1)(*5)   \n- OPEN-SMART ILI9488 16Pin-Parallel(320x480 Color inversion)(*1)(*4)(*5)   \n\n(*1)   \nI2S parallel does not work.   \nI don't know why.   \nGPIO parallel or REGISTER I/O parallel works.   \n__LED pins connect to GND instead of 3.3V.__   \n\n(*2)   \nVery Slow.   \nMost drivers require three commands to display one Pixel.   \nThis driver require 9 commands to display one Pixel.   \nFor some reason, the color of 0xFFFF does not appear.   \n\n(*3)   \nIt has a GRAM offset.   \nSee below.   \n\n(*4)   \nNeed RGB inverstion.   \n\n(*5)   \n4-line resistance touch screen available.   \nSee below.   \n\n\nThese are all 2.4 inch, 320x240 TFTs.\n![TFT-SHIELD-2](https://user-images.githubusercontent.com/6020549/104244320-873a1600-54a5-11eb-93c0-9fad671fdfed.JPG)\n\n3.95 inches is almost twice as large as 2.4 inches.\n![TFT-SHIELD-3](https://user-images.githubusercontent.com/6020549/104244328-8903d980-54a5-11eb-8c9a-d26408e04f92.JPG)\n\nThese are OPEN-SMART 16Pin-Parallel Products.\n![OPEN-SMART-16Pin](https://user-images.githubusercontent.com/6020549/110071604-ad9e7280-7dbf-11eb-8e09-a9ebfacfd795.JPG)\n\nThese are OPEN-SMART TFT-Shield Products.\n![OPEN-SMART-Shield](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/e48327d2-4470-426b-88d5-92607208586f)\n\n\n# Software requirements\nESP-IDF V5.0 or later.   \nESP-IDF V4.4 release branch reached EOL in July 2024.   \n\n__Note for ESP-IDF V5.x__   \nESP-IDF V5.x gives this warning, but work.   \n```\n#warning \"legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively\"\n```\n\n\n# Installation\n\n```\ngit clone https://github.com/nopnop2002/esp-idf-parallel-tft\ncd esp-idf-parallel-tft/\nidf.py set-target {esp32/esp32s2/esp32s3}\nidf.py menuconfig\nidf.py flash\n```\n\n__Note for ESP32-S2__   \nThe tjpgd library is not present in ESP32-S2 ROM.   \nWith ESP-IDF Ver5, the JPEG decode library is now provided from the IDF Component Registry, and the JPEG decode library is now available for ESP32-S2.   \nHowever, since the SRAM is small, a large image cannot be displayed.   \nWith ESP-IDF Ver4.4, you cannot be displayed JPEG files because the IDF Component Registry cannot be used.   \nDue to the small SRAM capacity, there is a possibility that an error may occur when displaying PNG files.   \nYou can avoid this error by enabling PSRAM.\n\n# Configuration   \nYou have to set this config value with menuconfig.   \n- CONFIG_DRIVER   \n ![](https://img.shields.io/badge/_IMPORTANT-important)  \n The information provided by sellers on Ebay or AliExpress is largely incorrect.   \n You waste time if you don't choose the right driver.   \n There are many [variations](http://domoticx.com/arduino-shield-2-4-tft-lcd-touch/) of the 2.4 inch shield.   \n You can use [this](https://github.com/prenticedavid/MCUFRIEND_kbv/tree/master/examples/LCD_ID_readreg) to find out your driver.   \n This is for Arduino UNO.   \n Do not use this on the ESP32 as the GPIO on the ESP32 is not 5V tolerant.   \n __Never believe the seller's information.__   \n I'll say it again.   \n __Never believe the seller's information.__   \n- CONFIG_INTERFACE   \n Most drivers work using I2S parallel.   \n However, some drivers only work using GPIO parallels or REGISTER I/O parallels.   \n I2S parallel is the fastest when drawing to consecutive addresses.   \n However, REGISTER I/O parallel is the fastest when drawing to non-contiguous addresses.   \n When using REGISTER I/O parallel, GPIO from D0 to D7 is 1 to 31.(GPIO0 is boot mode pin)   \n I2S parallel is suitable for image-intensive applications.   \n REGISTER I/O parallel is suitable for character-intensive applications.   \n GPIO parallel is most slow.   \n- CONFIG_WIDTH   \n- CONFIG_HEIGHT   \n Specifies the resolution of the TFT.   \n- CONFIG_OFFSETX   \n- CONFIG_OFFSETY   \n You can specify the GRAM offset.   \n You must specify Y offset = 32 for OPEN-SMART-ILI9327.   \n- CONFIG_INVERSION   \n For some TFTs, the BGR may be inverted.   \n Specify if the colors are inverted.\n\n![config-menu](https://user-images.githubusercontent.com/6020549/104242485-94093a80-54a2-11eb-934b-90eda9fb7bbe.jpg)\n\n![config-app1](https://user-images.githubusercontent.com/6020549/106704254-27abd200-662f-11eb-8697-743e220c030d.jpg)\n\n![config-app2](https://user-images.githubusercontent.com/6020549/106686442-9d06ab00-660d-11eb-9a53-912e221278ce.jpg)\n\n![config-app4](https://user-images.githubusercontent.com/6020549/106704258-28dcff00-662f-11eb-8a75-2070c3fe746a.jpg)\n\n# Wiring  \n\n|TFT||ESP32|ESP32S2/S3||\n|:-:|:-:|:-:|:-:|:-:|\n|LDC_RST|--|GPIO32|GPIO14|*1|\n|LDC_CS|--|GPIO33|GPIO13|*1|\n|LDC_RS|--|GPIO15|GPIO12|*1|\n|LDC_WR|--|GPIO4|GPIO11|*1|\n|LDC_RD|--|GPIO2|GPIO10|*1|\n|LDC_D0|--|GPIO12|GPIO33|*1 *2|\n|LDC_D1|--|GPIO13|GPIO34|*1 *2|\n|LDC_D2|--|GPIO26|GPIO35|*1 *2|\n|LDC_D3|--|GPIO25|GPIO36|*1 *2|\n|LDC_D4|--|GPIO17|GPIO37|*1 *2|\n|LDC_D5|--|GPIO16|GPIO38|*1 *2|\n|LDC_D6|--|GPIO27|GPIO39|*1 *2|\n|LDC_D7|--|GPIO14|GPIO40|*1 *2|\n|5V|--|5V|5V|*3|\n|3.3V|--|3.3V|3.3V|*3|\n|GND|--|GND|GND||\n\n(*1)   \nYou can change any GPIO using menuconfig.   \n\n![config-app3](https://user-images.githubusercontent.com/6020549/106685441-be669780-660b-11eb-8e8e-790348e65921.jpg)\n\n(*2)   \nWhen using REGISTER I/O parallel, GPIO from D0 to D7 is 1 to 31.(GPIO0 is boot mode pin)   \n\n(*3)   \nWith a regulator (mostly AMS1117) is on the back, the supply voltage is 5V.   \nWith a regulator is NOT on the back, the supply voltage is 3.3V.   \n\n![Back](https://user-images.githubusercontent.com/6020549/104248029-1f3afe00-54ac-11eb-913d-0a832fb569b2.JPG)\n\n__Note__   \nMy R61509V has a regulator on the back.   \nNormally, a TFT with a regulator works at 5V, but my R61509V doesn't work unless I supply both 5V and 3.3V.   \n\n__Note__   \nESP32 development board cannot supply too much current.   \nIt is more stable when supplied from an external power source.   \nI used a USB-TTL conversion module as an external power source.   \n\n![ExternalPower](https://github.com/user-attachments/assets/db5d7e4f-4cd3-4df2-b404-755aa0519718)\n\n# Graphic support\n![Graphic1](https://user-images.githubusercontent.com/6020549/104248260-848eef00-54ac-11eb-9ab8-4b74a2a7713f.JPG)\n![Graphic2](https://user-images.githubusercontent.com/6020549/104248263-85c01c00-54ac-11eb-9d19-6886827cd29d.JPG)\n![Graphic3](https://user-images.githubusercontent.com/6020549/104248265-86f14900-54ac-11eb-937b-b2bd5ed4ce69.JPG)\n![Graphic4](https://user-images.githubusercontent.com/6020549/104248266-8789df80-54ac-11eb-89e6-bad34a3c035d.JPG)\n![Graphic5](https://user-images.githubusercontent.com/6020549/104248267-88227600-54ac-11eb-903f-3c64f4e7cb60.JPG)\n![Graphic6](https://user-images.githubusercontent.com/6020549/104248268-88bb0c80-54ac-11eb-827b-d886e0491664.JPG)\n![Graphic7](https://user-images.githubusercontent.com/6020549/104248273-8953a300-54ac-11eb-8ed1-ffc38e8d6a7c.JPG)\n![Graphic8](https://user-images.githubusercontent.com/6020549/104248276-89ec3980-54ac-11eb-8b0d-0bb90e33473e.JPG)\n\n# Fonts support\n![Font1](https://user-images.githubusercontent.com/6020549/104248202-6628f380-54ac-11eb-893d-08fdbfd5ee93.JPG)\nIt's possible to text rotation and invert.   \n![Font2](https://user-images.githubusercontent.com/6020549/104248205-675a2080-54ac-11eb-8268-c7b585061205.JPG)\n![Font3](https://user-images.githubusercontent.com/6020549/104248206-67f2b700-54ac-11eb-9b94-2cc37f0360e3.JPG)\n![Font4](https://user-images.githubusercontent.com/6020549/104248208-688b4d80-54ac-11eb-8b88-d87b5b084e71.JPG)\nYou can specify multiple fonts at the same time.   \n![Font5](https://user-images.githubusercontent.com/6020549/104248209-6923e400-54ac-11eb-8812-a438ca1be724.JPG)\n\n# Image support\nBMP file   \n![Image1](https://user-images.githubusercontent.com/6020549/104248104-3974dc00-54ac-11eb-9b97-56a062f13e5b.JPG)\nJPEG file   \n![Image2](https://user-images.githubusercontent.com/6020549/104248108-3aa60900-54ac-11eb-8545-3c8971a344a9.JPG)\nPNG file   \n![Image3](https://user-images.githubusercontent.com/6020549/104248110-3b3e9f80-54ac-11eb-9487-a0379f40fd35.JPG)\n\n# Using Wemos D1 ESP32   \nI bought this for $4.   \n![WeMos-R32-11](https://user-images.githubusercontent.com/6020549/107591015-09585e80-6c4d-11eb-9198-d882408d0d4a.JPG)\n\nTo attach the TFT-Shield, you need to do changed some pin assignments like this.   \nBecause GPIO34/35/36/39 are READ ONLY.   \n![WeMos-R32-1](https://user-images.githubusercontent.com/6020549/145746743-9c4a0e7c-5315-496f-8f66-129115044091.jpg)\n\n![WeMos-R32-12](https://user-images.githubusercontent.com/6020549/107591018-0c534f00-6c4d-11eb-81d1-22f141ea1044.JPG)\n\nWith this change, GPIO will look like this:   \n![WeMos-R32-2](https://user-images.githubusercontent.com/6020549/107591035-12e1c680-6c4d-11eb-9c67-5967c7b8a59f.jpg)\n\n![WeMos-R32-3](https://user-images.githubusercontent.com/6020549/107723948-ff565e80-6d25-11eb-89cc-74fcd2fa11f3.jpg)\n\n![WeMos-R32-4](https://user-images.githubusercontent.com/6020549/107725257-2e220400-6d29-11eb-808a-a440336780d6.jpg)\n\nIt's great because it doesn't require any wiring.   \n![WeMos-R32-13](https://user-images.githubusercontent.com/6020549/201453096-40b41987-30bf-4703-af59-3652b9bdbea3.JPG)\n\n\n__If you use OPEN-SMART TFT-Shield Products, you must use custom GPIO.__   \n![WeMos-R32-OpenSmart](https://user-images.githubusercontent.com/6020549/145744630-bce9eac3-3039-4cf6-952f-28c8ec277ec2.jpg)\n\n\n\n# Using TZT D1 ESP32-S3   \nI bought this for $5.   \n![tzt-d1-esp32s3](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/ba6772f1-c8b7-4e7d-9d0a-0fb8fb8cbea5)\n\nYou can attach the TFT-Shield without changing anything.   \nBut I2S parallel doesn't work. I don't know why.   \n![tzt-d1-esp32s3-Generic](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/ea622d34-ffa9-4de0-941f-98460e10f416)\n![tzt-d1-esp32s3-Open-Smart](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/8316345e-cef6-4768-afbc-f42be5b4bf70)\n\nIf you use TZT D1 ESP32-S3, you must use custom GPIO.  \n![config-esp32s3-generic](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/607bd6c5-537a-48c1-a4aa-76030bdad451)\n\n\n# JPEG Decoder   \nThe ESP-IDF component includes Tiny JPEG Decompressor.   \nThe document of Tiny JPEG Decompressor is [here](http://elm-chan.org/fsw/tjpgd/00index.html).   \nThis can reduce the image to 1/2 1/4 1/8.   \n\n# PNG Decoder   \nThe ESP-IDF component includes part of the miniz library, such as mz_crc32.   \nBut it doesn't support all of the miniz.   \nThe document of miniz library is [here](https://github.com/richgel999/miniz).   \n\nAnd I ported the pngle library from [here](https://github.com/kikuchan/pngle).   \nThis can reduce the image to any size.   \n\n# Font File   \nThis project uses the following as default fonts:   \n- font/ILGH16XB.FNT // 8x16Dot Gothic\n- font/ILGH24XB.FNT // 12x24Dot Gothic\n- font/ILGH32XB.FNT // 16x32Dot Gothic\n- font/ILMH16XB.FNT // 8x16Dot Mincyo\n- font/ILMH24XB.FNT // 12x24Dot Mincyo\n- font/ILMH32XB.FNT // 16x32Dot Mincyo\n\nFrom 0x00 to 0x7f, the characters image of Alphanumeric are stored.   \nFrom 0x80 to 0xff, the characters image of Japanese are stored.   \nChanging this file will change the font.\n\nYou can add your original fonts.   \nThe format of the font file is the FONTX format.   \nYour font file is put in font directory.   \nYour font file is uploaded to SPIFFS partition using meke flash.   \n\nPlease refer [this](http://elm-chan.org/docs/dosv/fontx_e.html) page about FONTX format.   \n\n# Font File Editor(FONTX Editor)   \n[There](http://elm-chan.org/fsw/fontxedit.zip) is a font file editor.   \nThis can be done on Windows 10.   \nDeveloper page is [here](http://elm-chan.org/fsw_e.html).   \n\n![fontx-editor-1](https://github.com/user-attachments/assets/76a8c96f-74c3-4583-a4f1-5664f0e81f3a)\n\n\n# Convert from BDF font to FONTX font   \nstep1)   \ndownload fontxedit.exe.   \n\nstep2)   \ndownload BDF font file from Internet.   \nI downloaded from [here](https://github.com/fcambus/spleen).   \nfontxedit.exe can __ONLY__ import Monospaced bitmap fonts file.   \nMonospaced bitmap fonts can also be downloaded [here](https://github.com/Tecate/bitmap-fonts).\n\nstep3)   \nimport the BDF font file into your fontxedit.exe.   \nthis tool can convert from BDF to FONTX.   \n![fontx-editor-2](https://github.com/user-attachments/assets/3353bf23-01f0-455d-8c9c-b56d55b4dc9c)\n\nstep4)   \nadjust font size.   \n![fontx-editor-3](https://github.com/user-attachments/assets/0a99fb0b-1725-472e-8310-ca57362ae6d1)\n\nstep5)   \ncheck font pattern.   \nwhen you have made any changes, press the apply button.   \n![fontx-editor-4](https://github.com/user-attachments/assets/44b8ed95-0c3e-4507-87fa-b94c3c2349de)\n\nstep6)   \nsave as .fnt file from your fontedit.exe.   \n![fontx-editor-5](https://github.com/user-attachments/assets/db5b62a8-3a61-49aa-8505-b906067f1111)\n\nstep7)   \nupload your font file to $HOME/esp-idf-ili9340/font directory.   \n\nstep8)   \nadd font to use   \n```\nFontxFile fx32L[2];\nInitFontx(fx32L,\"/spiffs/LATIN32B.FNT\",\"\"); // 16x32Dot LATIN\n```\nFont file that From 0x00 to 0x7f, the characters image of Standard ASCII are stored.   \n![AsciiCode-1](https://github.com/user-attachments/assets/9311b258-fecd-460f-a349-599b2a6c1fbc)\n\nFont file that From 0x80 to 0xff, the characters image of Japanese are stored.   \n![AsciiCode-2](https://github.com/user-attachments/assets/dc6c5733-9ad4-4e24-b65d-9b1905f99a45)\n\nFont file that From 0x80 to 0xff, the characters image of Latin are stored.   \n![AsciiCode-3](https://github.com/user-attachments/assets/32778605-48d2-4dd4-b268-985adc2bef02)\n\nu8g2 library contains many BDF fonts.   \nThis was converted from emoticons21.bdf.   \n![bdf-font-1](https://github.com/user-attachments/assets/62f6af3c-8bba-431c-90a3-1e9d2b77593f)\n\nThis was converted from Scroll-o-Sprites.bdf.   \n![bdf-font-2](https://github.com/user-attachments/assets/39016799-0ec6-443f-a369-d537fb6737e2)\n\n# Convert from TTF font to FONTX font  \nstep1)   \nDownload WFONTX64.exe from [here](https://github.com/nemuisan/WFONTX64/releases).\nDeveloper page is [here](https://github.com/nemuisan/WFONTX64).   \n\nstep2)   \nSelect ttf font.   \n![WFONTX64-1](https://github.com/user-attachments/assets/2193a3c4-021c-48e6-8486-2ce500bdac36)\n\nstep3)   \nEnter Height, Width, FontX2 name.   \nSpecify half of Height for Width.   \nSpecify your favorite font name in the FontX2 name field using up to 8 characters.   \n![WFONTX64-2](https://github.com/user-attachments/assets/c87a9ec9-8e28-4d34-8475-60b15a47fb22)\n\nstep4)   \nSpecify the file name to save.   \n![WFONTX64-3](https://github.com/user-attachments/assets/9715d4bf-e460-41a6-9a4b-38c0f10020f7)\n\nstep5)   \nSpecify the font style as required.   \n![WFONTX64-4](https://github.com/user-attachments/assets/0ff3072d-6a78-48ae-b855-60c692f8d771)\n\nstep6)   \nPress the RUN button to convert TTF fonts to FONTX format.   \n![WFONTX64-5](https://github.com/user-attachments/assets/d9797e3d-1fd6-4504-b161-c1280f1242c0)\n\nstep7)   \nupload your font file to $HOME/esp-idf-ili9340/font directory.   \n\nstep8)   \nadd font to use   \n```\n    FontxFile fx16G[2];\n    FontxFile fx24G[2];\n    FontxFile fx32G[2];\n    //InitFontx(fx16G,\"/spiffs/ILGH16XB.FNT\",\"\"); // 8x16Dot Gothic\n    //InitFontx(fx24G,\"/spiffs/ILGH24XB.FNT\",\"\"); // 12x24Dot Gothic\n    //InitFontx(fx32G,\"/spiffs/ILGH32XB.FNT\",\"\"); // 16x32Dot Gothic\n    InitFontx(fx16G,\"/spiffs/Gigi16.FNT\",\"\"); // 8x16Dot Gigi\n    InitFontx(fx24G,\"/spiffs/Gigi24.FNT\",\"\"); // 12x24Dot Gigi\n    InitFontx(fx32G,\"/spiffs/Gigi32.FNT\",\"\"); // 16x32Dot Gigi\n\n```\n\n![tft_font](https://github.com/user-attachments/assets/94e8073d-cc18-4c95-bfa4-ed14c9c30277)\n\n---\n\n# 4-line resistance touch screen   \nSome TFT has 4-line resistance touch screen.   \nThe 4-line resistor touch screen uses 4 pins.   \n- X(+):Digital Output\n- X(-):Digital Output/Analog Input\n- Y(+):Digital Output/Analog Input\n- Y(-):Digital Output\n\n\nWhen using GPIO Parallel Interface or REGISTER Parallel Interface, you can enable 4-line resistance touch screen using menuconfig.   \n\nESP-IDF cannot do both digital output and analog input simultaneously using a single gpio.   \nHence two GPIOs are required for simultaneous digital output and analog input.   \n(X-) and ESP32 are connected with two wires.   \n(Y+) and ESP32 are connected with two wires.   \n\n```\n(X-) ----+---- Gpio for Digital Output(Using GPIO number)\n         +---- Gpio for Analog Input(Using ADC1 Channel number)\n\n(Y+) ----+---- Gpio for Digital Output(Using GPIO number)\n         +---- Gpio for Analog Input(Using ADC1 Channel number)\n```\n\n### Configuration for touch screen\n\n![Image](https://github.com/user-attachments/assets/d49aad5d-93d4-4fba-8b3d-d52a83eb2996)\n\n### ADC Channel   \nWhen reading analog values, ESP-IDF can use ADC1 and ADC2.   \nThis project only supports ADC1 for reading analog values.   \nESP32 has 8 channels.   \nESP32S2/S3 has 10 channels.   \n\n|Channel|ESP32|ESP32S2/S3|\n|:-:|:-:|:-:|\n|#0|GPIO36|GPIO01|\n|#1|GPIO37|GPIO02|\n|#2|GPIO38|GPIO03|\n|#3|GPIO39|GPIO04|\n|#4|GPIO32|GPIO05|\n|#5|GPIO33|GPIO06|\n|#6|GPIO34(*1)|GPIO07|\n|#7|GPIO35(*1)|GPIO08|\n|#8||GPIO09|\n|#9||GPIO10|\n\n(*1) Input only.   \n\nWhen using ADC1_6(ADC1 Channel#6) and ADC1_7(ADC1 Channel#7), the following wiring is additionally required.   \n\n|TFT|ADC1|ESP32|ESP32S2/S3|\n|:-:|:-:|:-:|:-:|\n|(Y+)|Channel#6|GPIO34|GPIO07|\n|(X-)|Channel#7|GPIO35|GPIO08|\n\n### GPIO number    \nIt uses four GPIOs, but the GPIOs differ depending on the TFT model.   \n\n### Save calibration data to NVS   \nWrite calibration data to NVS.   \nRead calibration data from NVS when starting the firmware and use it.   \nIf you use the same TFT, you don't need to calibrate again.   \nTo clear the calibration data recorded in NVS, execute the following command.   \n```\nidf.py erase_flash\n```\n![Image](https://github.com/user-attachments/assets/67258144-fd76-492c-9b48-93188a899058)\n\n### Check if touch works properly   \nYou can check if touch screen works properly.   \n![Image](https://github.com/user-attachments/assets/cc89798f-bc69-4d04-a46c-ccacd2b28b9f)\n\nIf you touch it at this time, the touched coordinates will be displayed.   \nIf there is no touch for 10 seconds, it will end.   \n![Image](https://github.com/user-attachments/assets/8f439bd4-0a17-45f2-aeed-8292eb4f067c)\n\nMove the touch-pen vertically and horizontally to check the X and Y coordinates.   \nWhat you get here is the physical coordinates.   \nSee [here](https://github.com/nopnop2002/esp-idf-ili9340/issues/39) about physical coordinates.   \n![Image](https://github.com/user-attachments/assets/813c4435-a010-4f55-ad5f-1218724ce82a)\n\n\n### OPEN-SMART 16Pin-Parallel Products   \n|X(+)|X(-)|Y(+)|Y(-)|\n|:-:|:-:|:-:|:-:|\n|LCD_D6|LCD_RS|LCD_WR|LCD_D7|\n\n![Touch0](https://user-images.githubusercontent.com/6020549/145660530-1aeb060d-93f7-4dc8-b6ea-fd6250cc1c44.JPG)\n\n\n### OPEN-SMART TFT-Shield Products   \nThere is no marking about 4-line resistance touch screen.   \nBut 4-line resistance touch screen available.   \n\n|X(+)|X(-)|Y(+)|Y(-)|\n|:-:|:-:|:-:|:-:|\n|LCD_D6|LCD_RS|LCD_WR|LCD_D7|\n\n![Touch-OpenSmart-Sheild-1](https://user-images.githubusercontent.com/6020549/145698700-a1fb42a7-27d0-438b-aaa1-07e15c87eda7.JPG)\n\nWhen using ADC1_6(ADC1 Channel#6) and ADC1_7(ADC1 Channel#7), the following wiring is additionally required.   \n|TFT||ESP32|ESP32S2/S3|\n|:-:|:-:|:-:|:-:|\n|LCD_WR(Y+)||ADC1_6(GPIO34)|ADC1_6(GPIO07)|\n|LCD_RS(X-)||ADC1_7(GPIO35)|ADC1_7(GPIO08)|\n\n__4-line resistance touch screen cannot be used with the Wemos D1 ESP32.__   \n__Because the combination of GPIO and ADC does not match.__\n\n### ELEGOO TFT-Shield Products   \nThere is no marking about 4-line resistance touch screen.   \nBut 4-line resistance touch screen available.   \n\n|X(+)|X(-)|Y(+)|Y(-)|\n|:-:|:-:|:-:|:-:|\n|LCD_D0|LCD_RS|LCD_CS|LCD_D1|\n\n![Touch-Elegoo-1](https://user-images.githubusercontent.com/6020549/145734702-a7719de0-3d7e-4f70-aada-e6f1cdd0ca20.JPG)\n\nWhen using ADC1_6(ADC1 Channel#6) and ADC1_7(ADC1 Channel#7), the following wiring is additionally required.   \n|TFT||ESP32|ESP32S2/S3|\n|:-:|:-:|:-:|:-:|\n|LCD_CS(Y+)||ADC1_6(GPIO34)|ADC1_6(GPIO07)|\n|LCD_RS(X-)||ADC1_7(GPIO35)|ADC1_7(GPIO08)|\n\n__No additional wiring is required when using the Wemos D1 ESP32.__   \n__LCD_CS is assigned to ADC1_6 and LCD_RS is assigned to ADC1_7.__   \n\n### ILI9341 2.4inch TFT-Shield with Yellow Pin-header   \nThere is no marking about 4-line resistance touch screen.   \nBut 4-line resistance touch screen available.   \n\n|X(+)|X(-)|Y(+)|Y(-)|\n|:-:|:-:|:-:|:-:|\n|LCD_D0|LCD_RS|LCD_CS|LCD_D1|\n\n![Touch-ILI9341-1](https://user-images.githubusercontent.com/6020549/145734786-a717d42d-0ad8-441a-846c-e486e07c0839.JPG)\n\nWhen using ADC1_6(ADC1 Channel#6) and ADC1_7(ADC1 Channel#7), the following wiring is additionally required.   \n|TFT||ESP32|ESP32S2/S3|\n|:-:|:-:|:-:|:-:|\n|LCD_CS(Y+)||ADC1_6(GPIO34)|ADC1_6(GPIO07)|\n|LCD_RS(X-)||ADC1_7(GPIO35)|ADC1_7(GPIO08)|\n\n__No additional wiring is required when using the Wemos D1 ESP32.__   \n__LCD_CS is assigned to ADC1_6 and LCD_RS is assigned to ADC1_7.__   \n\n### ILI9486 3.5inch TFT-Shield   \nThere is no marking about 4-line resistance touch screen.   \nBut 4-line resistance touch screen available.   \n\n|X(+)|X(-)|Y(+)|Y(-)|\n|:-:|:-:|:-:|:-:|\n|LCD_D6|LCD_RS|LCD_WR|LCD_D7|\n\n![Touch-ILI9486-1](https://user-images.githubusercontent.com/6020549/146495127-f5013a91-fe23-467b-ae02-5dd3e58ccf45.JPG)\n\nWhen using ADC1_6(ADC1 Channel#6) and ADC1_7(ADC1 Channel#7), the following wiring is additionally required.   \n|TFT||ESP32|ESP32S2/S3|\n|:-:|:-:|:-:|:-:|\n|LCD_WR(Y+)||ADC1_6(GPIO34)|ADC1_6(GPIO07)|\n|LCD_RS(X-)||ADC1_7(GPIO35)|ADC1_7(GPIO08)|\n\n__4-line resistance touch screen cannot be used with the Wemos D1 ESP32.__   \n__Because the combination of GPIO and ADC does not match.__\n\n### Other TFT   \nI don't know which pin is X(+), X(-), Y(+), Y(-).   \nIf you find, please tell me.\n\n## Calibrating the touch screen   \nKeep touching the corner point.   \n![TouchCalib-1](https://user-images.githubusercontent.com/6020549/145699311-fce1049d-bb9b-460a-9724-bab62cdbf674.JPG)\n![TouchCalib-2](https://user-images.githubusercontent.com/6020549/145699316-98171b90-70c7-4359-b72e-ed2f1cd4bf13.JPG)\n\n## Draw with touch   \nIf there is no touch for 10 seconds, it will end.   \n![Touch-OpenSmat-16pin](https://user-images.githubusercontent.com/6020549/145699328-c065278a-39b9-4a11-b2f3-6ca5d54c6e3f.JPG)\n![Touch-OpenSmart-Shield-2](https://user-images.githubusercontent.com/6020549/145698848-77901c4a-bc64-4c14-8bec-7a7c63d073c5.JPG)\n![Touch-Elegoo-2](https://user-images.githubusercontent.com/6020549/145734726-68d2272b-1452-47a9-b934-647f7a741ad1.JPG)\n![Touch-ILI9341-2](https://user-images.githubusercontent.com/6020549/145734734-ad6fa02b-9ba7-48e3-83a6-224e3637c18a.JPG)\n![Touch-ILI9486-2](https://user-images.githubusercontent.com/6020549/146495160-94c9c2de-9ca3-4124-afb9-5109568ab60c.JPG)\n\n## Button with touch   \nYou can only enter up to 15 characters.   \nIf there is no touch for 10 seconds, it will end.   \n![Touch-Keyboard](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/76bab0dd-4262-40fe-a248-64a29602eada)\n\n## Move with touch   \nIf there is no touch for 10 seconds, it will end.   \n![Touch-Move-1](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/10eac755-d770-43c8-80ec-68ea59fcb49a)\n![Touch-Move-2](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/617abf8d-2cb6-46f2-9b80-2d9680aacac0)\n\n## Menu with Touch   \nIf there is no touch for 10 seconds, it will end.   \n![Touch-Menu-1](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/0852357a-fb20-441f-be65-288c9ec1e8e7)\n![Touch-Menu-2](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/50cc507d-95fa-4713-ac38-f944e3943873)\n\n## Select image with touch   \nIf there is no touch for 10 seconds, it will end.   \nI borrowed the icon from [here](https://www.flaticon.com/packs/social-media-343).   \n![Touch-Icon-1](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/f3b6de6c-f63c-4b4f-9323-e5fad03d0720)\n![Touch-Icon-2](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/29a4afdd-8ca3-4ce4-aa92-bf8edb84314d)\n\n## How dose it works   \nhttps://www.sparkfun.com/datasheets/LCD/HOW%20DOES%20IT%20WORK.pdf\n\n# How to use this component in your project   \nCreate idf_component.yml in the same directory as main.c.   \n```\nYourProject --+-- CMakeLists.txt\n              +-- main --+-- main.c\n                         +-- CMakeLists.txt\n                         +-- idf_component.yml\n```\n\nContents of idf_component.yml.\n```\ndependencies:\n  nopnop2002/parallel-tft:\n    path: components/tft_library/\n    git: https://github.com/nopnop2002/esp-idf-parallel-tft.git\n```\n\nWhen you build a projects esp-idf will automaticly fetch repository to managed_components dir and link with your code.   \n```\nYourProject --+-- CMakeLists.txt\n              +-- main --+-- main.c\n              |          +-- CMakeLists.txt\n              |          +-- idf_component.yml\n              +-- managed_components ----- nopnop2002__parallel-tft\n```\n\n\n# Application layer\n\n![LibraryLayer](https://user-images.githubusercontent.com/6020549/118599243-30916f80-b7ea-11eb-8766-5dd8fecd66aa.jpg)\n\n# Performance comparison using ILI9488(320x480)   \nI2S parallel is not always faster.   \nDepending on the application, REGISTER I/O parallel may be faster.   \nCompiling with the O2 option doesn't help much.   \nThe unit of the number is the required time in milliseconds.   \nA smaller value indicates faster speed.   \n|Test|GPIO parallel|REGISTER I/O parallel|I2S parallel|I2S parallel(O2)|\n|:-:|:-:|:-:|:-:|:-:|\n|AddressTest|820|280|40|30|\n|FillTest|3900|2370|1620|1590|\n|ColorBarTest|810|290|60|40|\n|ArrowTest|860|300|160|140|\n|LineTest|2060|860|3150|2900|\n|CircleTest|1950|830|2840|2610|\n|RoundRectTest|1970|820|2930|2690|\n|RectAngleTest|2810|1340|5180|4880|\n|TriangleTest|2960|1530|6090|5640|\n|DirectionTest|900|330|250|230|\n|HorizontalTest|1110|430|610|550|\n|VerticalTest|1110|430|610|550|\n|FillRectTest|1300|590|200|140|\n|ColorTest|1660|650|220|180|\n|BMPTest|7280|6500|6130|5790|\n|JPEGTest|1210|490|170|140|\n|PNGTest|1480|750|440|1010|\n\n![graph](https://github.com/nopnop2002/esp-idf-parallel-tft/assets/6020549/1f7ae5e8-f2e8-4e4f-8d90-7f2d2cf52ec5)\n\n# Performance comparison using ILI9341(240x320)\nSPI used [this](https://github.com/nopnop2002/esp-idf-ili9340).   \n\n|Test|SPI|GPIO parallel|REGISTER I/O parallel|I2S parallel|\n|:-:|:-:|:-:|:-:|:-:|\n|FillTest|1620|2700|1920|1560|\n|ColorBarTest|80|410|150|30|\n|ArrowTest|250|450|160|140|\n|LineTest|2770|1030|430|1570|\n|CircleTest|2470|970|410|1410|\n|RoundRectTest|2510|970|400|1430|\n|RectAngleTest|5990|2000|940|4050|\n|TriangleTest|6950|2110|990|4740|\n|DirectionTest|420|500|190|240|\n|HorizontalTest|1030|710|290|590|\n|VerticalTest|1010|710|290|590|\n|FillRectTest|170|710|340|120|\n|ColorTest|250|850|340|150|\n|BMPTest|7470|6880|6360|6120|\n|JPEGTest|2530|800|350|150|\n|PNGTest|2800|1070|610|420|\n\n\n\n# Reference about I2S driver\nhttps://github.com/espressif/esp-iot-solution/tree/master/components/bus\n\n- for esp32   \n i2s_lcd_esp32_driver.c   \n- for esp32s2   \n i2s_lcd_esp32s2_driver.c   \n- for esp32s3   \n 8080_lcd_esp32s3.c   \n- Common header   \n i2s_lcd_driver.h   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-parallel-tft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fesp-idf-parallel-tft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-parallel-tft/lists"}