Trying to get a minimal example running. Should I use lv_st7789_create? (LilyGo T-Display-S3 - ESP32S3 - st7789)


Following my last post, I have made a bunch of progress. I have created code for communicating with my display, and now I’m trying to create a minimal LVGL example.

What MCU/Processor/Board and compiler are you using?

A LilyGo T-Display-S3, which combines an ESP32S3 with an st7789.
I’m using PlatformIO with the Arduino framework and LVGL 9.

What do you want to achieve?

A minimal example. I just want to set the display to a nice color or print a letter.

What have you tried so far?

This gist shows the code I have so far:
ESP32 st7789 minimal example (

display.h and display.cpp contain my code for communicating with the display.
Now I’m trying to create an LVGL example in main.cpp. I’m very much confused about what to do here. A bunch of examples seem to make use of a lv_disp_drv_t, which I don’t understand. Are there many ways to do the same thing, or is there one ideal way?

Following Generic MIPI DCS compatible LCD Controller driver — LVGL documentation, I’m trying to use lv_st7789_create.

I’m following many examples I have seen that create a flush_cb = [](lv_display_t *disp, const lv_area_t *area, uint8_t *pix_map);, but that doesn’t match the signature of the send_color argument expected by lv_st7789_create.

So, I don’t know how to implement send_cmd_cb and send_color_cb.

What am I missing to display my first example on the screen?

Also, is my setup to handle the ticks good? I have seen mentions of a LV_TICK_CUSTOM that can be defined. It sounds like that could be used to avoid handling time manually.

After further investigation, I feel like lv_st7789_create is lower level than the lv_display_create interface, where you supply a flush_cb.

I.e., a flush_cb function could make use of the functionality I have already implemented for sending an image to the display. The send_color_cb function, however, seems require sending lower level commands instead. My set_bitmap function for sending an image makes use of esp functionality, so using the lv_st7789_create function seems like a step back, if I have to re-implement this functionality my self.