SSD1306 esp_lcd controller based driver vs i2c interface

clodman84
Posts: 3
Joined: Sat Jun 08, 2024 6:21 pm

SSD1306 esp_lcd controller based driver vs i2c interface

Postby clodman84 » Sat Oct 19, 2024 11:02 pm

The docs for the lcd periphal states the following.

In esp_lcd, an LCD panel is represented by esp_lcd_panel_handle_t, which plays the role of an abstract frame buffer, regardless of the frame memory is allocated inside ESP chip or in external LCD controller. Based on the location of the frame buffer and the hardware connection interface, the LCD panel drivers are mainly grouped into the following categories:

Controller based LCD driver involves multiple steps to get a panel handle, like bus allocation, IO device registration and controller driver install. The frame buffer is located in the controller's internal GRAM (Graphical RAM). ESP-IDF provides only a limited number of LCD controller drivers out of the box (e.g., ST7789, SSD1306), More Controller Based LCD Drivers are maintained in the Espressif Component Registry.

I am new to driving displays within esp-idf and I have a few examples running, but I wanted fool around with the idf to get a better understanding of what was going on. I noticed that there is a function (https://docs.espressif.com/projects/esp ... l_handle_t) for initialising the ssd1306 using the controller based driver. The examples I have seen so far have used the i2c interface driver instead of this. Is there any benefit of one over the other.

If I use the controller based driver, the framebuffer will be present on the GDRAM of the ssd1306, which the esp is connected to via a i2c. Won't this be slower than having the framebuffer in memory?

Maybe I am misunderstanding what is meant by a framebuffer. According to this https://www.stealthylabs.com/blog/2020/ ... uffer.html resource online, programs write to the framebuffer first and when its time to show something on the screen, it writes it to the GDRAM of the display. So in this case would I be writing to the GDRAM of the esp everytime I write to the framebuffer?

MicroController
Posts: 1724
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: SSD1306 esp_lcd controller based driver vs i2c interface

Postby MicroController » Sun Oct 20, 2024 1:43 pm

clodman84 wrote:
Sat Oct 19, 2024 11:02 pm
So in this case would I be writing to the GDRAM of the esp everytime I write to the framebuffer?
No, that would hardly work at all. The SSD1306 uses one bit per pixel, so to change one pixel you need to read, modify, and write the byte it resides in.
Plus, a full frame is only 1kB, so no problem in keeping a framebuffer in RAM.

Who is online

Users browsing this forum: pmi2410 and 113 guests