fsfw-hal/common/gpio/GpioCookie.h

42 lines
957 B
C
Raw Normal View History

2021-06-05 14:42:20 +02:00
#ifndef COMMON_GPIO_GPIOCOOKIE_H_
#define COMMON_GPIO_GPIOCOOKIE_H_
2021-03-23 15:41:49 +01:00
#include "GpioIF.h"
#include "gpioDefinitions.h"
2021-06-05 14:42:20 +02:00
2021-03-23 15:41:49 +01:00
#include <fsfw/devicehandlers/CookieIF.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
/**
* @brief Cookie for the GpioIF. Allows the GpioIF to determine which
* GPIOs to initialize and whether they should be configured as in- or
* output.
* @details One GpioCookie can hold multiple GPIO configurations. To add a new
* GPIO configuration to a GpioCookie use the GpioCookie::addGpio
* function.
*
* @author J. Meier
*/
class GpioCookie: public CookieIF {
public:
GpioCookie();
virtual ~GpioCookie();
2021-04-01 15:48:30 +02:00
ReturnValue_t addGpio(gpioId_t gpioId, GpioBase* gpioConfig);
2021-03-23 15:41:49 +01:00
/**
* @brief Get map with registered GPIOs.
*/
GpioMap getGpioMap() const;
private:
/**
* Returns a copy of the internal GPIO map.
*/
GpioMap gpioMap;
};
2021-06-05 14:42:20 +02:00
#endif /* COMMON_GPIO_GPIOCOOKIE_H_ */