Files
obsw/bsp_z7/objects/communication/GpioCookie.h
2023-10-26 07:10:20 +02:00

20 lines
771 B
C++

#pragma once
#include <fsfw/devicehandlers/CookieIF.h>
#include <stddef.h>
class GpioCookie : public CookieIF {
/**
* @brief A Cookie containing the Pin and bit offset mask
*
* @param bitOffsetMask Since we can only address each word (32-bit), but a GPIO is represented by a single bit for efficiency-reasons, we need a mask to AND-out all bits we do not want to write to. All bits should zero except the one of the GPIO- If there are multiple GPIOs to set at the same time, this should also be possible, as long as there is no validation fo rthe bitmask
*
*/
public:
GpioCookie(uint32_t pinAddress, uint32_t bitOffsetMask);
virtual ~GpioCookie();
const uint32_t pin;
const uint32_t bitOffsetMask;
int socket;
};