25 : spi(spiModule), chipSelect(chipSelect), chipSelectMode(chipSelectMode), frequency(speedMhz),
37 return spi.
sendReceive(dataToSend, chipSelect, chipSelectMode, frequency, burst, mode);
virtual std::vector< uint8_t > sendReceive(std::vector< uint8_t > dataToWrite, SpiChipSelectPin *chipSelect=nullptr, ChipSelectMode chipSelectMode=ChipSelectMode::SpiActiveLow, double speed=6, SpiBurstMode burstMode=SpiBurstMode::NoBurst, SpiMode spiMode=SpiMode::Mode00)=0
Send/receive data out of this SPI port.
SpiMode
Defines the clock phase and polarity used for SPI communication.
Definition: SpiMode.h:10
SpiBurstMode
The SPI burst mode to use.
Definition: SpiBurstMode.h:7
An SPI port.
Definition: Spi.h:15
std::vector< uint8_t > sendReceive(std::vector< uint8_t > dataToSend, SpiBurstMode burst)
Starts an SPI send/receive transaction.
Definition: SpiDevice.h:36
virtual bool enabled()=0
Gets whether the port is enabled.
Clock is initially low; data is valid on the rising edge of the clock
CS is asserted low, the SPI transaction takes place, and then the signal is returned high...
SpiDevice(Spi &spiModule, SpiChipSelectPin *chipSelect, ChipSelectMode chipSelectMode=ChipSelectMode::SpiActiveLow, double speedMhz=1, SpiMode mode=SpiMode::Mode00)
Construct an SPI device attached to a particular module
Definition: SpiDevice.h:22
Definition: SpiChipSelectPin.h:7
Represents a peripheral on the SPI bus.
Definition: SpiDevice.h:12
virtual void makePushPullOutput()=0
Make the pin a push-pull output.
ChipSelectMode
Definition: ChipSelectMode.h:3