mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-06 18:37:34 +00:00
Added easier GPIO pin API
This commit is contained in:
20
src/gpio_pin.cpp
Normal file
20
src/gpio_pin.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <sta/gpio_pin.hpp>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
void GpioPin::setHigh()
|
||||
{
|
||||
setState(GpioPinState::GPIO_HIGH);
|
||||
}
|
||||
|
||||
void GpioPin::setLow()
|
||||
{
|
||||
setState(GpioPinState::GPIO_LOW);
|
||||
}
|
||||
|
||||
void GpioPin::toggle()
|
||||
{
|
||||
setState(getState() == GpioPinState::GPIO_HIGH ? GpioPinState::GPIO_LOW : GpioPinState::GPIO_HIGH);
|
||||
}
|
||||
} // namespace sta
|
Reference in New Issue
Block a user