| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "IGpioOutput.h" | ||
| 4 | #include "driver/gpio.h" | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @brief ESP32 implementation of GPIO output | ||
| 8 | * | ||
| 9 | * Simple GPIO output control for barrier motors and other actuators. | ||
| 10 | */ | ||
| 11 | class EspGpioOutput : public IGpioOutput { | ||
| 12 | public: | ||
| 13 | /** | ||
| 14 | * @brief Construct ESP32 GPIO output | ||
| 15 | * @param pin GPIO pin number | ||
| 16 | * @param initialLevel Initial output level (default: LOW) | ||
| 17 | */ | ||
| 18 | explicit EspGpioOutput(gpio_num_t pin, bool initialLevel = false); | ||
| 19 | ✗ | ~EspGpioOutput() override = default; | |
| 20 | |||
| 21 | // Prevent copying | ||
| 22 | EspGpioOutput(const EspGpioOutput&) = delete; | ||
| 23 | EspGpioOutput& operator=(const EspGpioOutput&) = delete; | ||
| 24 | |||
| 25 | void setLevel(bool high) override; | ||
| 26 | [[nodiscard]] bool getLevel() const override; | ||
| 27 | |||
| 28 | private: | ||
| 29 | gpio_num_t m_pin; | ||
| 30 | bool m_currentLevel; | ||
| 31 | }; | ||
| 32 |