Treehopper C++ API
Spi Class Referenceabstract

An SPI port.

#include <Spi.h>

Inheritance diagram for Spi:
HardwareSpi

Public Member Functions

virtual bool enabled ()=0
 Gets whether the port is enabled. More...
 
virtual void enabled (bool)=0
 Sets whether the port is enabled. More...
 
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. More...
 

Member Function Documentation

◆ enabled() [1/2]

virtual bool enabled ( )
pure virtual

Implemented in HardwareSpi.

◆ enabled() [2/2]

virtual void enabled ( bool  )
pure virtual

Implemented in HardwareSpi.

◆ sendReceive()

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 
)
pure virtual
Parameters
[in]dataToWritevector of input data
[in]chipSelectpin to use as chip-select, or nullptr. Defaults to nullptr.
[in]chipSelectModeThe ChipSelectMode to use if chipSelect != nullptr. Defaults to ChipSelectMode::SpiActiveLow.
[in]speedThe speed, in MHz, to clock the data at. Defaults to 6.
[in]burstModeThe burst mode to use. Defaults to BurstMode::NoBurst.
[in]spiModeThe SPI mode to use. Defaults to SpiMode::Mode00.
Returns
A std::vector<uint8_t> of the received data

The documentation for this class was generated from the following file: