Replies: 4 comments 2 replies
-
@cgulick |
Beta Was this translation helpful? Give feedback.
-
No I don't. I decided to use tft_ESPI from Bodmer. I am converting the
tft_ESPI to be used only from esp-idf. I may even convert the lib to
straight C so I can use it with other MCU's like MCU Xpresso
and others. But I definitely want to strip out the Arduino specific code.
…On Sat, Jan 29, 2022 at 8:02 AM javiser ***@***.***> wrote:
Do you know of any good example about this usage with esp-idf?
—
Reply to this email directly, view it on GitHub
<#185 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDLVJM5HYA4NIJBL3TLMPTUYQFSTANCNFSM5LRIVENQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Chris Gulick
503-753-8494
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply @cgulick . In the end I figured it out how to use the lib in my platformio esp-idf project:
Just in case you are interested, this how the first part of my file looks like (sorry, I didn't create a repository for this project yet): #ifndef _INCLUDE_DISPLAY_H
#define _INCLUDE_DISPLAY_H
#include <lgfx/v1_init.hpp>
#define LGFX_USE_V1
class LGFX_ST7789 : public lgfx::LGFX_Device
{
lgfx::Panel_ST7789 _panel_instance;
lgfx::Bus_SPI _bus_instance;
lgfx::Light_PWM _light_instance;
public:
LGFX_ST7789(void)
{
{
auto cfg = _bus_instance.config();
//cfg.spi_host = VSPI_HOST; // I needed to comment this out because of my ESP32C3
cfg.spi_mode = 3; // My display wants mode 3, for whatever reason
cfg.freq_write = 40000000;
cfg.freq_read = 16000000;
cfg.spi_3wire = false; // I needed to change this too
cfg.use_lock = true;
cfg.dma_channel = 0; // No DMA support for ESP32C3 yet
cfg.pin_sclk = 0;
cfg.pin_mosi = 7;
cfg.pin_miso = -1;
cfg.pin_dc = 8;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
} I don't know what's the real difference between this library and TFT_eSPI, but for what I have seen so far, this one supports esp-idf and the other doesn't (at least it is not stated in their repo). |
Beta Was this translation helpful? Give feedback.
-
Thank you,
This is helpful to me. I wanted to use this lib because I wanted to use
esp-idf. I may revisit this and see if I can build it using esp-idf. I
designed a system using the ESP32-S3 and it has a 3.5" lcd
and wanted a graphics lib to use. The ESP32-S3 is still too new for Arduino
support so I can't use tft_espi. I don't like Arduino anyway, I prefer the
esp-idf. esp-idf in PIO is not at esp-idf4.4 yet so I
need to use the VScode extension for espidf or use command line espidf or
the eclipse IDE (I currently use the eclipse ide with espidf 4.4). This
allows me to compile for all variants of esp32.
…On Sun, Jan 30, 2022 at 4:38 AM javiser ***@***.***> wrote:
Thanks for the reply @cgulick <https://github.com/cgulick> . In the end I
figured it out how to use the lib in my platformio esp-idf project:
- I installed the library directly from platformio and added the
dependency in the platformio.inifile
- I changed the project files from C to C++. That was the harder part,
as this LovyanGFX library needs C++
- I defined my own LGFX class for my display in a hpp file of my own,
as explained here
<https://github.com/lovyan03/LovyanGFX/blob/master/examples/HowToUse/2_user_setting/2_user_setting.ino>
(thanks google translator for the invaluable help). Since I have a ESP32C3
I had to take special attention to some valuables (DMA, SPI host...)
- And after that I can just create an instance lcd of this class in my
program and call lcd.init() and all other functions for the examples
to make it work. And the performance is quite good! I had been playing with
another ST7789 library in the past and the difference is HUGE.
Just in case you are interested, this how the first part of my file looks
like (sorry, I didn't create a repository for this project yet):
#ifndef _INCLUDE_DISPLAY_H
#define _INCLUDE_DISPLAY_H
#include <lgfx/v1_init.hpp>
#define LGFX_USE_V1
class LGFX_ST7789 : public lgfx::LGFX_Device
{
lgfx::Panel_ST7789 _panel_instance;
lgfx::Bus_SPI _bus_instance;
lgfx::Light_PWM _light_instance;
public:
LGFX_ST7789(void)
{
{
auto cfg = _bus_instance.config();
//cfg.spi_host = VSPI_HOST; // I needed to comment this out because of my ESP32C3
cfg.spi_mode = 3; // My display wants mode 3, for whatever reason
cfg.freq_write = 40000000;
cfg.freq_read = 16000000;
cfg.spi_3wire = false; // I needed to change this too
cfg.use_lock = true;
cfg.dma_channel = 0; // No DMA support for ESP32C3 yet
cfg.pin_sclk = 0;
cfg.pin_mosi = 7;
cfg.pin_miso = -1;
cfg.pin_dc = 8;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}
I don't know what's the real difference between this library and TFT_eSPI,
but for what I have seen so far, this one supports esp-idf and the other
doesn't (at least it is not stated in their repo).
—
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDLVJOB25EDEGFALM7VXVDUYUWLHANCNFSM5LRIVENQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Chris Gulick
503-753-8494
|
Beta Was this translation helpful? Give feedback.
-
Is your lib tied to the arduino system or can it be built in esp-idf V4.4 using CMake. For instance in the esp-idf 4.4 eclipse IDE via Espressif website.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions