mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-12 01:25:59 +00:00
44 lines
849 B
C++
44 lines
849 B
C++
/**
|
|
* @file
|
|
* @brief Wrapper for Arduino GPIO pins.
|
|
*/
|
|
#ifndef STA_CORE_ARDUINO_GPIO_PIN_HPP
|
|
#define STA_CORE_ARDUINO_GPIO_PIN_HPP
|
|
|
|
// Only enable module on Arduino platform w/ HAL GPIO module enabled
|
|
#include <sta/config.hpp>
|
|
|
|
#if defined(STA_PLATFORM_ARDUINO) || defined(DOXYGEN)
|
|
|
|
#include <sta/gpio_pin.hpp>
|
|
#include <cstdint>
|
|
|
|
namespace sta
|
|
{
|
|
class ArduinoGpioPin : public GpioPin
|
|
{
|
|
public:
|
|
/**
|
|
* @param port GPIO port
|
|
* @param pin Pin index
|
|
*/
|
|
ArduinoGpioPin(uint16_t pin);
|
|
|
|
void setState(GpioPinState state) override;
|
|
|
|
GpioPinState getState() override;
|
|
|
|
/**
|
|
* @brief Get pin index for pin.
|
|
*
|
|
* @return Pin index
|
|
*/
|
|
uint16_t getPin() const;
|
|
private:
|
|
uint16_t pin_; /**< GPIO pin */
|
|
};
|
|
} // namespace sta
|
|
|
|
#endif // STA_ARDUINO_GPIO_ENABLED
|
|
|
|
#endif // STA_CORE_ARDUINO_GPIO_PIN_HPP
|