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

59
include/RelayController.h Normal file
View File

@@ -0,0 +1,59 @@
/**
* @file RelayController.h
* @brief Relay control for switching between 2-rail and 3-rail track configurations
*
* Controls a relay module to switch track wiring between:
* - 2-rail mode: Standard DC/DCC operation
* - 3-rail mode: Center rail + outer rails configuration
*
* @author Locomotive Test Bench Project
* @date 2025
*/
#ifndef RELAY_CONTROLLER_H
#define RELAY_CONTROLLER_H
#include <Arduino.h>
// Pin definition for relay control
#define RELAY_PIN 4 ///< Relay control pin (active HIGH)
/**
* @class RelayController
* @brief Controls relay for track configuration switching
*
* Simple relay control for switching between 2-rail and 3-rail modes.
* Relay energized = 3-rail mode
* Relay de-energized = 2-rail mode
*/
class RelayController {
public:
/**
* @brief Constructor
*/
RelayController();
/**
* @brief Initialize relay controller hardware
*
* Configures GPIO pin and sets to default 2-rail mode.
*/
void begin();
/**
* @brief Set rail mode
* @param is3Rail true = 3-rail mode, false = 2-rail mode
*/
void setRailMode(bool is3Rail);
/**
* @brief Get current rail mode
* @return true if 3-rail mode, false if 2-rail mode
*/
bool is3RailMode() { return is3Rail; }
private:
bool is3Rail; ///< Current rail mode state
};
#endif // RELAY_CONTROLLER_H