mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-09-28 21:17:33 +00:00
Add getter for HAL GPIO pin data
This commit is contained in:
@@ -26,6 +26,10 @@ namespace sta
|
||||
|
||||
void setState(GpioPinState state) override;
|
||||
|
||||
GPIO_TypeDef * getPort() const;
|
||||
uint16_t getPin() const;
|
||||
uint8_t getIndex() const;
|
||||
|
||||
private:
|
||||
GPIO_TypeDef * port_; /**< GPIO port */
|
||||
uint16_t pin_; /**< GPIO pin */
|
||||
|
@@ -17,6 +17,21 @@ namespace sta
|
||||
{
|
||||
HAL_GPIO_WritePin(port_, pin_, (state == GpioPinState::LOW) ? GPIO_PIN_RESET : GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
GPIO_TypeDef * HalGpioPin::getPort() const
|
||||
{
|
||||
return port_;
|
||||
}
|
||||
|
||||
uint16_t HalGpioPin::getPin() const
|
||||
{
|
||||
return pin_;
|
||||
}
|
||||
|
||||
uint8_t HalGpioPin::getIndex() const
|
||||
{
|
||||
return GPIO_GET_INDEX(port_);
|
||||
}
|
||||
} // namespace sta
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user