SPISettings Class Reference

#include <SPISettings.h>

Public Member Functions

 SPISettings ()
 
virtual ~SPISettings ()
 
 SPISettings (int speed, uint8_t byteOrder, uint8_t dataMode)
 constructor for SPISettings More...
 
uint8_t getDataMode ()
 
bool operator== (const SPISettings &other) const
 
void print (const char *s)
 

Friends

class SPIClass
 

Constructor & Destructor Documentation

◆ SPISettings() [1/2]

SPISettings::SPISettings ( )
inline

◆ ~SPISettings()

virtual SPISettings::~SPISettings ( )
inlinevirtual

◆ SPISettings() [2/2]

SPISettings::SPISettings ( int  speed,
uint8_t  byteOrder,
uint8_t  dataMode 
)
inline

constructor for SPISettings

Settings are applied to SPI::beginTransaction(SPISettings) and are valid until next beginTransaction()

Parameters
speedThe maximum speed of communication. For a SPI chip rated up to sys clock speed. For 20 MHz, use 20000000.
byteOrderMSBFIRST or LSBFIRST
dataMode: SPI_MODE0, SPI_MODE1, SPI_MODE2, or SPI_MODE3

byteOrder's are:

    MSBFIRST    Data is sent out starting with Bit31 and down to Bit0
    LSBFIRST    Data is sent out starting with the lowest BYTE, from MSB to LSB.
                0xABCDEFGH would be sent as 0xGHEFCDAB

Data modes are:

    Mode        Clock Polarity (CPOL)   Clock Phase (CPHA)
    SPI_MODE0       0                   0
    SPI_MODE1       0                   1
    SPI_MODE2       1                   0
    SPI_MODE3       1                   1

Member Function Documentation

◆ getDataMode()

uint8_t SPISettings::getDataMode ( )
inline

◆ operator==()

bool SPISettings::operator== ( const SPISettings other) const
inline

◆ print()

void SPISettings::print ( const char *  s)
inline

Friends And Related Function Documentation

◆ SPIClass

friend class SPIClass
friend

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