Ssd1306 for lv_port_esp32 available?

I started to use LittlevGL on the ESP32 platform (using ESP-IDF with lv_port_esp32 as a submodule).

Is there a driver for lv_port_esp32 for the SSD1306 using I2C / TWI available?

Before starting to port a driver by myself I want to check whether there’s already a driver I can use?

I’ve a running code for the SSD1306 available which I can use. In one of the threads I found a discussion on the new API (branch new_api), but I’m not sure whether to use the new_api or not? Waht’s the difference?

Regards
Andreas

As far as I know, the important features from new_api exist in 6.0+ and the branch was abandoned.

Not yet, but I do have a display based on that controller laying around, so if you want we can work on adding it to the lv_port_esp32 repo, you “only” need to implement the init function and the flush function.

Regards

Yes, that’s the case.

I implemented a first version for the SSD1306 driver, it’s included in this fork and branch here

In the updated Kconfig choose:

  • Predefined display: none
  • Predefined pins: none
  • Display controller: SSD1306
  • Protocoll: I2C
  • Landscape, width 128, height 64
  • GPIO for SDA and SCL

For DISP_BUF_SIZE use with the above values for height and width.

#define DISP_BUF_SIZE (CONFIG_LVGL_DISPLAY_WIDTH*CONFIG_LVGL_DISPLAY_HEIGHT)

and

static lv_color_t buf1[DISP_BUF_SIZE];
lv_disp_buf_init(&disp_buf, buf1, NULL, DISP_BUF_SIZE);

Reducing DISP_BUF_SIZE (e.g. /8) gives a performance decrease. I use ssd1306_set_px_cb to set the pixel. The buffer buf1 can then be send efficiently to the SSD1306.

Todo’s are

  1. Cleanup Kconfig using predefined display settings and/or the WEMOS LOLIN Board
  2. Check that SPI is not initialized
  3. Code cleanup (included files, Kconfig defines, …)

It would be good if you could test with your board, too.

Regards
Andreas

Hi Andreas,

Great, I think I have one of those displays laying around so I will test it this weekend.

Yes we can add the WEMOS LOLIN Board as predefined board, are you working with it? If so, can you upload a picture to update the README.

As far as I know this is the first monochrome display on the lv_port_esp32 repo :smiley:

Regards,
Carlos

Hi Carlos,

yes, I’m working with that board. Please find a (draft) screenshot in README.md. I’ll replace this in the next days with a more representative screenshot. See the link to my fork above, use branch ssd1306_add…

We should work on Kconfig. The predefined configuration is not working at least for me. If for example setting “M5Stack” everything is fine, but not because all relevant configuration is created. The #if CONFIG_LVGL_TFT_DISPLAY_CONTROLLER == TFT_CONTROLLER_ILI9341 is true because TFT_CONTROLLER_ILI9341 is 0 and so it’s always true. For other predefined configuration always ILI9341 is used.
When selecting not a predefined board but choose the display controller manually, it’s fine.

Do you want me to open a seperate ticket?

I can work on Kconfig - I thing the best way is to introduce some “helper” symbols. Using “select” is not working for me yet (see Kconfig stackoverflow. If we find a better solution later we can clean up in the future.

Regards
Andreas

Hi @an-erd,

I’ve been busy with work tasks but today I will be able to test your repo :smiley:

Are you refering to the predefined configuration on your repo for the SSD1306 display?

Yes, let’s open a new ticket for it, thanks.

From what I understand on your question the following symbols are not being generated?

CONFIG_BOARD_A
CONFIG_BOARD_B
CONFIG_FEATURE_A
CONFIG_FEATURE_B

I didn’t checked that before, will check it today.

Regards

@an-erd I’ve opened a new issue to list all the menuconfig improvements https://github.com/littlevgl/lv_port_esp32/issues/93 , can we place there all the improvement ideas? what do you think?