From a068681b31ae7d3b13dfc9cd0b62c423e59717f5 Mon Sep 17 00:00:00 2001 From: Henrik Stickann <4376396-Mithradir@users.noreply.gitlab.com> Date: Sat, 9 Apr 2022 21:47:23 +0200 Subject: [PATCH] Add GPIO pin interface --- include/sta/gpio_pin.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/sta/gpio_pin.hpp diff --git a/include/sta/gpio_pin.hpp b/include/sta/gpio_pin.hpp new file mode 100644 index 0000000..a0cac2e --- /dev/null +++ b/include/sta/gpio_pin.hpp @@ -0,0 +1,32 @@ +#ifndef STA_GPIO_PIN_HPP +#define STA_GPIO_PIN_HPP + + +namespace sta +{ + /** + * @brief GPIO pin state + */ + enum class GpioPinState + { + LOW, + HIGH + }; + + /** + * @brief Interface for GPIO pins. + */ + class GpioPin + { + public: + /** + * @brief Set pin output state. + * + * @param state Output state + */ + virtual void setState(GpioPinState state) = 0; + }; +} // namespace sta + + +#endif // STA_GPIO_PIN_HPP