2021-06-04 16:01:38 +02:00
|
|
|
#include "SpiCookie.h"
|
|
|
|
|
2021-06-04 16:34:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, uint32_t spiSpeed,
|
2021-06-04 17:13:14 +02:00
|
|
|
spi::SpiModes spiMode, uint16_t chipSelectGpioPin, GPIO_TypeDef* chipSelectGpioPort,
|
|
|
|
size_t maxRecvSize):
|
2021-06-04 16:34:38 +02:00
|
|
|
deviceAddress(deviceAddress), spiIdx(spiIdx), spiSpeed(spiSpeed), spiMode(spiMode),
|
2021-06-04 17:13:14 +02:00
|
|
|
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;
|
2021-06-04 16:01:38 +02:00
|
|
|
}
|