53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
#ifndef BSP_Q7S_GPIO_GPIOIF_H_
|
|
#define BSP_Q7S_GPIO_GPIOIF_H_
|
|
|
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
|
#include <fsfw/devicehandlers/CookieIF.h>
|
|
|
|
typedef uint16_t gpioId_t;
|
|
|
|
/**
|
|
* @brief This class defines the interface for objects requiring the control
|
|
* over GPIOs.
|
|
* @author J. Meier
|
|
*/
|
|
class GpioIF : public HasReturnvaluesIF{
|
|
public:
|
|
|
|
virtual ~GpioIF() {};
|
|
|
|
/**
|
|
* @brief Called by the GPIO using object.
|
|
* @param cookie Cookie specifying informations of the GPIOs required
|
|
* by a object.
|
|
*/
|
|
virtual ReturnValue_t initialize(CookieIF * cookie) = 0;
|
|
|
|
/**
|
|
* @brief By implementing this function a child must provide the
|
|
* functionality to pull a certain GPIO to high logic level.
|
|
*
|
|
* @param gpioId A unique number which specifies the GPIO to drive.
|
|
*/
|
|
virtual ReturnValue_t pullHigh(gpioId_t gpioId) = 0;
|
|
|
|
/**
|
|
* @brief By implementing this function a child must provide the
|
|
* functionality to pull a certain GPIO to low logic level.
|
|
*
|
|
* @param gpioId A unique number which specifies the GPIO to drive.
|
|
*/
|
|
virtual ReturnValue_t pullLow(gpioId_t gpioId) = 0;
|
|
|
|
/**
|
|
* @brief This function requires a child to implement the functionaliy to read the state of
|
|
* an ouput or input gpio.
|
|
*
|
|
* @param gpioId A unique number which specifies the GPIO to read.
|
|
* @param gpioState State of GPIO will be written to this pointer.
|
|
*/
|
|
virtual ReturnValue_t readGpio(gpioId_t gpioId, int* gpioState) = 0;
|
|
};
|
|
|
|
#endif /* BSP_Q7S_GPIO_GPIOIF_H_ */
|