Graphical user interfaces on embedded systems have become ubiquitous, powering applications from smart-home panels to industrial human-machine interfaces (HMIs). Yet the dominant open-source GUI libraries — LVGL, TouchGFX, and Qt for MCUs — demand memory resources that exceed what low-cost microcontrollers such as the ESP32-WROOM-32 can comfortably provide, especially when no external PSRAM is available. This paper presents DisplayUI, a purpose-built, header-only C++ GUI framework designed for the ESP32-2432S028R "Cheap Yellow Display" (CYD) and similar resource-constrained platforms. DisplayUI implements a complete set of interactive widgets, a multi-state touch engine, a page-based visibility manager, and a per-element dirty-rectangle renderer — all within approximately 1800 lines of code and consuming less than 40 KB of flash and under 10 KB of RAM at runtime. We detail the architectural decisions that enable this efficiency: elimination of a full-frame buffer, direct SPI rendering with incremental updates, integer arithmetic throughout, and compile-time polymorphism via templates. A comparative evaluation against LVGL, TFTₑSPI, U8g2, and AdafruitGFX demonstrates that DisplayUI achieves competitive rendering throughput while requiring 5–50× less memory. The complete source code is released under the MIT license.
Lucas Lima Freitag Freitag (Sun,) studied this question.