ESP32 ST7789 port

I will try to add support for that driver into the lv_port_esp32 repository, i will try to do that this weekend.

I edited posts for including urls.
Question about your future port - Is original code can be under @copiright?

lbthomsen/esp-idf-littlevgl and littlevgl/lv_port_esp32 are both MTI licensed.

Hi @app-z,

Just added support for the ST7789 into lv_port_esp32, can you test it and let me know if you find any issues?



This item menu is disappeared in last commit. I open issue on GitHub


Just found out that you were using make menuconfig, can you use idf,py menuconfig? until we solve the issue.

That item wasn’t added by us. because the custom items are added at the end of the menu list.

Were you using the esp iot solutions repo?

Didn’t have many time for find out issue. I just checkout in empty folder and run #make configure
As I mentioned before, behind commits giving me that option. Not shure when issue is starting.
Thanks for adding support ST7789. I think it’s minor issue can be resolved easy. Maybe I did something wrong

Solved by @danjulio in !

At first as I mentioned necessary set mode=2 for SPI
Secondly , color is wrong in your port. I am also somehow fixing make (not the build locally. I can make merge request but it doesn’t scene because current version do not work properly


I got my display yesterday but didn’t tested it, do you have the display datasheet? I couldn’t find it, the color format sent to the display might be different to the color format it expects.

Thanks for letting me know about the mode change on the SPI mode.

Thanks for testing :slight_smile:


I kinda found a solution. Need set gamma in initial display. I tested you code with one of the piece of code from git repo with I sent here. I can point you it. So busy it week :confused:

Sure, let me know what piece of code i need to update and i can test it with my display. I will also take a look at the other code examples you sent earlier.

I updated git issue. Please see GitHub

1 Like


Just to let you know that i have updated the lv_port_esp32 repo to handle the issues you reported!
I had to change the initialization for the ST7789 display because the display was flipped, and I just noticed on your picture that your display is also flipped, now it is working as expected :).

Please let me know if you find any other issues

You were right and the colors was not properly done, now it’s fixed:

Working like charm :grinning:

1 Like

It was a tricky bug to hunt, but it was fun to do so, nice to see it’s working for you aswell.

Are those buttons for capacitive touch sensing?

Yes. It’s my implementation of touch matrix. Recently get PCB from jlcpcb factory. Now I wiring the amplifier for ADC and DAC. You can see empty place for that right on photo

1 Like

Sounds very interesting, please keep me posted when the final GUI is done, I haven’t had the chance to use lvgl at work.

I am not able to compile ST7789 port
IDF version - ESP-IDF v5.0-beta1-641-gc321739074

esp/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_spi_conf.h:68:22: error: ‘HSPI_HOST’ undeclared (first use in this function); did you mean ‘SPI3_HOST’?
| ^~~~~~~~~