#include <SPI.h>
Public Member Functions | |
void | begin () override |
begin(): Initializes the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high. More... | |
void | end () override |
end() More... | |
void | beginTransaction (SPISettings mySettings) override |
beginTransaction() More... | |
void | endTransaction () override |
endTransaction() More... | |
unsigned char | transfer (unsigned char val) override |
transfer() More... | |
uint8_t | read8 () |
read8() read a byte from SPI without setting up registers More... | |
unsigned short | transfer16 (unsigned short val) override |
transfer16() More... | |
void | transfer (uint8_t *buffer, size_t numberBytes) override |
transfer(uint8_t *buffer, size_t numberBytes) More... | |
Public Attributes | |
SPISettings | SPIDefaultSettings |
Default settings used by the SPI bus until reset by beginTransaction(SPISettings) More... | |
Member Function Documentation
◆ begin()
|
overridevirtual |
◆ beginTransaction()
|
overridevirtual |
Initializes the SPI bus using the defined SPISettings
this methode does not initiate a transaction. So it can be used to setup the SPI after SPI.begin()
Implements SPIBase.
◆ end()
|
inlineoverridevirtual |
◆ endTransaction()
|
inlineoverridevirtual |
Method for compatibility with Arduino API. Provides NOP
endTransaction(): Stop using the SPI bus. Normally this is called after de-asserting the chip select, to allow other libraries to use the SPI bus.
Implements SPIBase.
◆ read8()
uint8_t SPIClass::read8 | ( | ) |
read8() read a byte from SPI without setting up registers
- Return values
-
uint8_t received used for performance tuning when doing continuous reads this method does not reset the registers , so make sure that a regular transfer(data) call was performed Note: this method is not found on the Arduino API USE WITH CARE !!
◆ transfer() [1/2]
|
inlineoverridevirtual |
- Parameters
-
val byte to send
- Return values
-
unsigned char byte received
calls private method transfer32(byte) to send/recv one uint32_t input/output casted to rightdta type
SPI transfer is based on a simultaneous send and receive: the received data is returned in receivedVal (or receivedVal16).
receivedVal = SPI.transfer(val) : single byte receivedVal16 = SPI.transfer16(val16) : single short
Implements SPIBase.
◆ transfer() [2/2]
|
overridevirtual |
transfer(uint8_t *buffer, size_t numberBytes)
- Parameters
-
buffer in/out numberBytes length of buffer
SPI transfer is based on a simultaneous send and receive: The buffered transfers does split up the conversation internaly into 64 byte blocks. The received data is stored in the buffer passed by reference. (the data past in is replaced with the data received).
SPI.transfer(buffer, size) : memory buffer of length size
Implements SPIBase.
◆ transfer16()
|
inlineoverridevirtual |
- Parameters
-
val Value to send
- Return values
-
unsigned short value received
calls private method transfer32(byte) to send/recv one uint32_t input/output casted to rightdta type
SPI transfer is based on a simultaneous send and receive: the received data is returned in receivedVal (or receivedVal16).
receivedVal = SPI.transfer(val) : single byte receivedVal16 = SPI.transfer16(val16) : single short
Implements SPIBase.
Member Data Documentation
◆ SPIDefaultSettings
|
inherited |
Default settings used by the SPI bus until reset by beginTransaction(SPISettings)
Note: not included in std Arduino lib
The documentation for this class was generated from the following file: