eive-obsw/test/gpio/GpioDummy.h
Robin Mueller e6ad0978de
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
run auto-formatter
2022-03-28 13:54:46 +02:00

28 lines
672 B
C++

#ifndef TEST_GPIODUMMY_H_
#define TEST_GPIODUMMY_H_
#include "fsfw_hal/common/gpio/GpioIF.h"
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
/**
* @brief Additional abstraction layer for handling GPIOs.
*
* @author J. Meier
*/
class Gpio {
public:
Gpio(gpioId_t gpioId, GpioIF* gpioIF) : gpioId(gpioId), gpioIF(gpioIF) {
if (gpioIF == nullptr) {
sif::error << "Gpio::Gpio: Invalid GpioIF" << std::endl;
}
}
ReturnValue_t pullHigh() { return gpioIF->pullHigh(gpioId); }
ReturnValue_t pullLow() { return gpioIF->pullLow(gpioId); }
private:
gpioId_t gpioId = gpio::NO_GPIO;
GpioIF* gpioIF = nullptr;
};
#endif /* TEST_GPIODUMMY_H_ */