Ajout prise en charge ESP-Display

This commit is contained in:
Serge NOEL
2025-12-01 13:53:54 +01:00
parent bcd88909b7
commit ae375b8fe2
26 changed files with 3945 additions and 1017 deletions

View File

@@ -2,7 +2,7 @@
* @file Config.h
* @brief Configuration management for the Locomotive Test Bench
*
* This module handles persistent storage of WiFi and system settings
* This module handles persistent storage of system settings
* using ESP32's Preferences library (NVS - Non-Volatile Storage).
*
* @author Locomotive Test Bench Project
@@ -15,20 +15,6 @@
#include <Arduino.h>
#include <Preferences.h>
/**
* @struct WiFiConfig
* @brief WiFi configuration parameters
*
* Stores both Access Point and Client mode settings.
*/
struct WiFiConfig {
String ssid; ///< WiFi network SSID (Client mode)
String password; ///< WiFi network password (Client mode)
bool isAPMode; ///< True = AP mode, False = Client mode
String apSSID; ///< Access Point SSID
String apPassword; ///< Access Point password (min 8 characters)
};
/**
* @struct SystemConfig
* @brief System operation configuration
@@ -37,6 +23,8 @@ struct WiFiConfig {
*/
struct SystemConfig {
bool isDCCMode; ///< True = DCC digital, False = DC analog
bool is3Rail; ///< True = 3-rail mode, False = 2-rail mode
bool powerOn; ///< True = power enabled, False = power off
uint16_t dccAddress; ///< DCC locomotive address (1-10239)
uint8_t speed; ///< Speed setting (0-100%)
uint8_t direction; ///< Direction: 0 = reverse, 1 = forward
@@ -71,7 +59,7 @@ public:
/**
* @brief Save current configuration to NVS
*
* Writes all WiFi and system settings to persistent storage.
* Writes all system settings to persistent storage.
* Should be called after any configuration changes.
*/
void save();
@@ -92,11 +80,12 @@ public:
*/
void reset();
WiFiConfig wifi; ///< WiFi configuration settings
SystemConfig system; ///< System operation settings
private:
Preferences preferences; ///< ESP32 NVS preferences object
};
#endif // CONFIG_H
#endif