Files
Elias Ahokas 4cc2702286 add post
2025-11-10 19:39:54 +02:00

1.6 KiB

title, date, tags, author, showToc, TocOpen, draft, hidemeta, comments, description, canonicalURL, disableShare, disableHLJS, hideSummary, searchHidden, ShowReadingTime, ShowBreadCrumbs, ShowPostNavLinks, ShowWordCount, ShowRssButtonInSectionTermList, UseHugoToc, cover
title date tags author showToc TocOpen draft hidemeta comments description canonicalURL disableShare disableHLJS hideSummary searchHidden ShowReadingTime ShowBreadCrumbs ShowPostNavLinks ShowWordCount ShowRssButtonInSectionTermList UseHugoToc cover
Esp32 OLED Counter Display 2025-11-10T19:10:33+02:00
Elias Ahokas true false false false false Desc Text. https://canonical.url/to/page false false false false true true true true true true
image alt caption relative hidden
false true

Project working

Integrating LVGL embedded graphics library with SSD1306 OLED display on ESP32.

Source code

Project goal

Get LVGL working on a 128x64 monochrome OLED display connected to ESP32 with I2C. Quick googling resulted only in outdated libraries. This implementation uses the latest libraries to ensure future proofing.

Main challenge

LVGL outputs pixels in a linear framebuffer format but the display uses page addressing where the screen is divided into 8 horizontal pages of 128x8 pixels. Required implementing a custom flush callback to convert between these formats.

Implementation

  • Custom I2C driver for SSD1306 using ESP-IDF's master driver API
  • Multi-threaded FreeRTOS architecture separating rendering, display updates and application logic
  • Pixel format conversion algorithm for transforming LVGL's I1 framebuffer to SSD1306 page format
  • Queue based page transmission system for non blocking I2C operations
  • Semaphore protected flush pipeline ensuring thread safe rendering