how to setup/configure TFT_eSPI with esp-idf ? #2138
Replies: 3 comments 4 replies
-
Okay, I went through and set all the parameters (as best as I understood) in menuconfig to match those in the file User_Setups/Setup25_TTGO_T_Display.h `// Setup for the TTGO T Display // See SetupX_Template.h for all options available #define ST7789_DRIVER #define TFT_WIDTH 135 #define CGRAM_OFFSET // Library will add offsets required //#define TFT_MISO -1 #define TFT_MOSI 19 #define TOUCH_CS -1 #define TFT_BL 4 // Display backlight control pin #define TFT_BACKLIGHT_ON HIGH // HIGH or LOW are options #define LOAD_GLCD #define SMOOTH_FONT //#define SPI_FREQUENCY 27000000 #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V` This seems a bit hackish (to have to redefine everything in menuconfig), so hopefully there is a better way to setup the configuration for esp-idf. |
Beta Was this translation helpful? Give feedback.
-
The support was added by a user. Have a look at #1770 |
Beta Was this translation helpful? Give feedback.
-
Thanks for finding that. I understand what happened. My assesment is that is your code is super dead-simple to use.... just uncomment the specific board you're using, and everything is taken care of re: pins, settings, etc... The user doesn't really need to think through / lookup any of those settings. With the addition of this KConfig file, the user can now set the options from menuconfig. However, this overrides whatever settings are set in User_Setup_Select.h. My understanding now is that if you install the TFT_eSPI as a component in esp-idf... it will automatically create the menuconfig options from the KConfig file... and a user IS FORCED TO SET all of those settings themselves in the sdkconfig file.... (e.g. by using menuconfig). As in, I had to lookup that the T-Display board was board #25, and then find the appropriate settings in the .h files, and then enter them into manually into menuconfig... This takes away from the "seamlessness" of the TFT_eSPI library, but exposes the user to more direct control - I suppose it is a tradeoff- but at the moment undocumented. My only suggestion would be to indicate to users that to use TFT_eSPI as a component of esp-idf, they can either:
also- thanks again for building such an easy-to-use library! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi- I have a basic question about how to use it with esp-idf.
TL;DR: Are we supposed to set the TFT settings in menuconfig/sdkconfig or in the User Setup Select file or both?
BACKGROUND
I'm using a LilyGo T-Display. When I was using Arduino IDE, I was able to make the library work by changing the following file:
~/Documents/Arduino/libraries/TFT_eSPI/User_Setup_Select.h
- uncommented
#include <User_Setups/Setup25_TTGO_T_Display.h>
- commented all other
#include <User_Setup*>
filesI'm now trying to use TFT_eSPI with esp-idf.
I git cloned this TFT_eSPI directory into my esp-idf project component directory (~/ESPprojects/hello_world/components/)
I edited ~/ESPprojects/hello_world/components/TFT_eSPI/User_Setup_Select.h as above.
Then, I ran idf.py reconfigure....
When I run idf.py build, I receive a bunch of errors about things not being defined in TFT_config.h:
I noticed there is a KConfig file, which sets up menuconfig items.... and a bunch of menuconfig items appeared:

These options are also listed in sdkconifg file.
I have a feeling these menuconfig settings are conflicting/overwriting the setting in User_Setup_select.h.
If we're using esp-idf, how should we set the settings for use with our display?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions