Added easier GPIO pin API

This commit is contained in:
dario
2024-04-18 00:01:14 +02:00
parent 7cc6108a40
commit 67e7d88a5b
2 changed files with 38 additions and 0 deletions

20
src/gpio_pin.cpp Normal file
View 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