/** * @file * @brief GPIO pin interface definitions. */ #ifndef STA_CORE_GPIO_PIN_HPP #define STA_CORE_GPIO_PIN_HPP namespace sta { /** * @defgroup sta_core_gpio GPIO * @ingroup sta_core * @brief GPIO pins. * @{ */ /** * @brief GPIO pin state. */ enum class GpioPinState { GPIO_LOW, GPIO_HIGH }; /** * @brief Interface for GPIO pins. */ class GpioPin { public: /** * @brief Set pin output state. * * @param state Output state */ virtual void setState(GpioPinState state) = 0; /** * @brief Set the GPIO pin to high. * */ void setHigh(); /** * @brief Set the GPIO pin to low. * */ void setLow(); /** * @brief Set the GPIO pin to the opposite of the current state. * */ void toggle(); /** * @brief Get pin input state. * * @param state Input state */ virtual GpioPinState getState() = 0; }; /** @} */ } // namespace sta #endif // STA_CORE_GPIO_PIN_HPP