Handle SPI protocol.
More...
#include <SPI.h>
Construct an instance of the class.
- Returns
- N/A.
Initialize SPI.
- Parameters
-
[in] | mosiPin | Pin to use for MOSI SPI function. |
[in] | misoPin | Pin to use for MISO SPI function. |
[in] | clkPin | Pin to use for CLK SPI function. |
[in] | csPin | Pin to use for CS SPI function. |
- Returns
- N/A.
void SPI::setHost |
( |
spi_host_device_t |
host | ) |
|
Set the SPI host to use. Call this prior to init().
- Parameters
-
[in] | host | The SPI host to use. Either HSPI_HOST (default) or VSPI_HOST. |
void SPI::transfer |
( |
uint8_t * |
data, |
|
|
size_t |
dataLen |
|
) |
| |
Send and receive data through SPI. This is a blocking call.
- Parameters
-
[in] | data | A data buffer used to send and receive. |
[in] | dataLen | The number of bytes to transmit and receive. |
uint8_t SPI::transferByte |
( |
uint8_t |
value | ) |
|
Send and receive a single byte.
- Parameters
-
[in] | value | The byte to send. |
- Returns
- The byte value received.
The documentation for this class was generated from the following files: