fsfw-hal/stm32h7/spi/SpiCookie.h

36 lines
957 B
C++

#ifndef FSFW_HAL_STM32H7_SPI_SPICOOKIE_H_
#define FSFW_HAL_STM32H7_SPI_SPICOOKIE_H_
#include "spiDefinitions.h"
#include "fsfw/devicehandlers/CookieIF.h"
#include "stm32h743xx.h"
class SpiCookie: public CookieIF {
public:
SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, uint32_t spiSpeed, spi::SpiModes spiMode,
uint16_t chipSelectGpioPin, GPIO_TypeDef* chipSelectGpioPort, size_t maxRecvSize);
uint16_t getChipSelectGpioPin() const;
GPIO_TypeDef* getChipSelectGpioPort();
address_t getDeviceAddress() const;
spi::SpiBus getSpiIdx() const;
spi::SpiModes getSpiMode() const;
uint32_t getSpiSpeed() const;
size_t getMaxRecvSize() const;
private:
address_t deviceAddress;
spi::SpiBus spiIdx;
uint32_t spiSpeed;
spi::SpiModes spiMode;
uint16_t chipSelectGpioPin;
GPIO_TypeDef* chipSelectGpioPort;
const size_t maxRecvSize;
};
#endif /* FSFW_HAL_STM32H7_SPI_SPICOOKIE_H_ */