47 lines
1.3 KiB
C++
47 lines
1.3 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();
|
|
|
|
} // namespace DisplayInit
|