Using multiple displays with different driver ICs possible?

Description

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

ESP32 arduino platformio

What LVGL version are you using?

9.2.2

What do you want to achieve?

I am trying to understand how to use 2 different displays of different kinds with LVGL. One is ST7789 and the other is GC9A01 both using SPI. My hope was that they could coexist on the same SPI-bus with different chip-select (CS) pins. I can’t seem to find any info about this. I can only find info on using multiple displays of the same kind. I now have one or the other working using TFT_eSPI and editing the TFT_eSPI/User_Setup_Select.h but can’t figure out how to run them at the same time.

What have you tried so far?

Could I somehow have dual installs of the TFT_eSPI libary by renaming stuff and then do something like:

disp1 = lv_tft_espi_create(TFT_HOR_RES, TFT_VER_RES, draw_buf, sizeof(draw_buf));
disp2 = lv_tft_espi_create2(TFT_HOR_RES, TFT_VER_RES, draw_buf, sizeof(draw_buf));

Or should I ditch TFT_eSPI and use the internal lvgl drivers like this and make one for the GC9A01:

disp1 = lv_st7789_create(TFT_HOR_RES, TFT_VER_RES, draw_buf, sizeof(draw_buf));

Also from this post I found this which might help me in some way?

lv_disp_t * disp1 = lv_disp_drv_register(&disp_drv1); 
lv_disp_t * disp2 = lv_disp_drv_register(&disp_drv2); 
lv_disp_set_default(disp2);

Thanks in advance for any pointers.

Coexist on one bus reduce FPS … LVGL multidisplay is no big problem. Optimize this for speed is other Q, and use per core on multicore MCUs is high level of prog.

1 Like

Thank you very much for your input @Marian_M :pray:
Yes that is the question but size is only 240px x 240px x 2 screens and I thought it might give ok performace/fps for my application which might not need that much new data written to the screens. So I would really like to try this in this early prototyping stage of my project.

I am also contemplating a multi-mcu system instead but this might be a hassle on other parameters like internal data sharing, component cost and end user firmware upgrading.

I have found this . In this example they use one spi and one i2c and one parallel display. It is a bit advance to use as a starting point example and is also for ESP-IDF instead of arduino. But i will try to dig further into it.

Do you know of other available code examples of multiple SPI screens of different types? Or some other kind of documentation on this?

Thanks again :+1: