fsfw-hal/stm32h7/spi/SpiCookie.cpp

40 lines
965 B
C++

#include "SpiCookie.h"
SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, uint32_t spiSpeed,
spi::SpiModes spiMode, uint16_t chipSelectGpioPin, GPIO_TypeDef* chipSelectGpioPort,
size_t maxRecvSize):
deviceAddress(deviceAddress), spiIdx(spiIdx), spiSpeed(spiSpeed), spiMode(spiMode),
chipSelectGpioPin(chipSelectGpioPin), chipSelectGpioPort(chipSelectGpioPort),
maxRecvSize(maxRecvSize) {
}
uint16_t SpiCookie::getChipSelectGpioPin() const {
return chipSelectGpioPin;
}
GPIO_TypeDef* SpiCookie::getChipSelectGpioPort() {
return chipSelectGpioPort;
}
address_t SpiCookie::getDeviceAddress() const {
return deviceAddress;
}
spi::SpiBus SpiCookie::getSpiIdx() const {
return spiIdx;
}
spi::SpiModes SpiCookie::getSpiMode() const {
return spiMode;
}
uint32_t SpiCookie::getSpiSpeed() const {
return spiSpeed;
}
size_t SpiCookie::getMaxRecvSize() const {
return maxRecvSize;
}