I have designed and built my own multiple display PCB, which you can see in operation here.
The PCB uses an ESP32 WROOM, MCP port expander (simply to control the back lights) as I needed more IOs.
I am using Arduino IDE v 2, although I code using Visual Studio.
All of the displays are initialised at the same time and then they are individually controlled by enabling and disabling the chip selects when writing to the displays as follows:
Global Scope:
// VSPI Class (default).
Adafruit_ILI9341 tft = Adafruit_ILI9341(VSPI_CS0, VSPI_DC, VSPI_RST); // CS0 is a dummy pin
Setup as follows:
// Set all tft chip select outputs low to configure all displays the same using tft.begin.
digitalWrite(VSPI_CS1, LOW);
digitalWrite(VSPI_CS2, LOW);
digitalWrite(VSPI_CS3, LOW);
digitalWrite(VSPI_CS4, LOW);
digitalWrite(VSPI_CS5, LOW);
digitalWrite(VSPI_CS6, LOW);
digitalWrite(VSPI_CS7, LOW);
digitalWrite(VSPI_CS8, LOW);
delay(100);
// Send screen configuration.
tft.begin(40000000); // 40000000 27000000
tft.setRotation(3);
tft.setCursor(0, 0);
Hopefully as you will see from the YouTube video, it all works well.
However, I would like to expand my design and significantly improve the display graphics as I am now designing a Stock Market Ticker, so I turned to LVGL. However I am struggling to understand how I can keep to my initial PCB design. I have plans to expand my PCB design to other display types and display layouts so I would like to solve this before I design the PCBs
I thought I could simply create multiple screens using LVGL as follows:
Global Scope:
/*LVGL draw into this buffer, 1/10 screen size usually works well. The size is in bytes*/
#define DRAW_BUF_SIZE (SCREEN_WIDTH * SCREEN_HEIGHT / 10 * (LV_COLOR_DEPTH / 8))
uint32_t draw_buf1[DRAW_BUF_SIZE / 4];
uint32_t draw_buf2[DRAW_BUF_SIZE / 4];
Within Setup as follows:
// Initialise LVGL
lv_init();
lv_display_t* disp1;
lv_display_t* disp2;
disp1 = lv_display_create(SCREEN_WIDTH, SCREEN_HEIGHT);
lv_display_set_flush_cb(disp1, my_disp_flush);
lv_display_set_buffers(disp1, draw_buf1, NULL, sizeof(draw_buf1), LV_DISPLAY_RENDER_MODE_PARTIAL);
disp2 = lv_display_create(SCREEN_WIDTH, SCREEN_HEIGHT);
lv_display_set_flush_cb(disp2, my_disp_flush);
lv_display_set_buffers(disp2, draw_buf2, NULL, sizeof(draw_buf2), LV_DISPLAY_RENDER_MODE_PARTIAL);
However, after this, I do not understand how I can link each display and its corresponding chip select to the Adafruit tft definition. You cannot do this with the TFT_eSPI library as that only allows one chip select.
I was wondering if I should call the library multiple times as follows:
// VSPI Class (default).
Adafruit_ILI9341 tft1 = Adafruit_ILI9341(VSPI_CS1, VSPI_DC, VSPI_RST); // CS0 is a dummy pin
Adafruit_ILI9341 tft2 = Adafruit_ILI9341(VSPI_CS2, VSPI_DC, VSPI_RST); // CS0 is a dummy pin
Adafruit_ILI9341 tft3 = Adafruit_ILI9341(VSPI_CS3, VSPI_DC, VSPI_RST); // CS0 is a dummy pin
More than happy to send a coffee card to anyone who can help me figure this out