Files
ESP32-S3-Touch-LCD-5B/src/modules/display_init.h
T
julian eb9cbd985f
Firmware / build (push) Successful in 4m30s
Display quick fixes: instant screen switches, deferred NVS saves, dark OTA writes, version label
- screen switches use LV_SCR_LOAD_ANIM_NONE: full-screen fades were re-rendered
  and blended in software every frame and stuttered at 1024x600
- Tunables: NVS write 3 s after the last change or on leaving the Tuning screen
  (Tunables::flush()), not per tap - each flash write flickers the RGB panel
- OTA: backlight off while the image is written, with full-screen notices
  before and after; tunables flushed before any reboot
- firmware version shown bottom-right on every screen (lv_layer_top)
- docs: CLAUDE.md, wiki ota-updates, open-questions #13, log

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 23:00:28 +02:00

50 lines
1.5 KiB
C++

/*
* Display Initialization Module
*
* Handles hardware-specific initialization for the Waveshare ESP32-S3-Touch-LCD-5B:
* - Board initialization (LCD panel, touch controller)
* - LVGL initialization and configuration
* - SquareLine Studio UI loading
* - Backlight control to prevent white flash during startup
*/
#pragma once
#include <Arduino.h>
#include <esp_display_panel.hpp>
using namespace esp_panel::drivers;
using namespace esp_panel::board;
namespace DisplayInit {
/**
* @brief Display hardware objects returned by initialization
*/
struct DisplayObjects {
Board* board; // ESP32 Display Panel board object
Backlight* backlight; // Backlight controller
};
/**
* @brief Initialize the display hardware and LVGL
*
* This function performs the complete display initialization sequence:
* 1. Create and initialize the display board object
* 2. Configure framebuffers (if avoid-tearing mode is enabled)
* 3. Initialize backlight (off initially to prevent white flash)
* 4. Start the board
* 5. Initialize LVGL porting layer
* 6. Load SquareLine Studio UI
* 7. Turn on backlight after UI is ready
*
* @return DisplayObjects containing board and backlight pointers
* @note This function will halt in an infinite loop if board initialization fails
*/
DisplayObjects init();
/** Backlight on/off after init() (e.g. dark during OTA flash writes, which flicker the panel). */
void setBacklight(bool on);
} // namespace DisplayInit