mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-03 09:31:53 +00:00
20 lines
369 B
C++
20 lines
369 B
C++
#include <sta/hal/gpio_pin.hpp>
|
|
|
|
#ifdef STA_HAL_GPIO_ENABLE
|
|
|
|
|
|
namespace sta
|
|
{
|
|
HalGpioPin::HalGpioPin(GPIO_TypeDef * port, uint16_t pin)
|
|
: port_{port}, pin_{pin}
|
|
{}
|
|
|
|
void HalGpioPin::setState(GpioPinState state)
|
|
{
|
|
HAL_GPIO_WritePin(port_, pin_, (state == GpioPinState::LOW) ? GPIO_PIN_RESET : GPIO_PIN_SET);
|
|
}
|
|
} // namespace sta
|
|
|
|
|
|
#endif // STA_HAL_GPIO_ENABLE
|