|
uint16_t | HardwareSPI_O::transfer (uint16_t data, bool lastByte=false) override |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
uint16_t | HardwareSPI_O::transfer16 (uint16_t data, bool lastByte=false) override |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
uint32_t | HardwareSPI_O::transfer32 (uint32_t data, bool lastByte=false) override |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
bool | HardwareSPI_O::write (uint16_t data, bool lastByte=false) override |
| Sends data using SPI periphery. More...
|
|
bool | HardwareSPI_O::write16 (uint16_t data, bool lastByte=false) override |
| Sends data using SPI periphery. More...
|
|
bool | HardwareSPI_O::write32 (uint32_t data, bool lastByte=false) override |
| Sends data using SPI periphery. More...
|
|
uint16_t | HardwareSPI_O::receive (bool lastByte=false) override |
| Receives data from SPI periphery. More...
|
|
uint16_t | HardwareSPI_O::receive16 (bool lastByte=false) override |
| Receives data from SPI periphery. More...
|
|
uint32_t | HardwareSPI_O::receive32 (bool lastByte=false) override |
| Receives data from SPI periphery. More...
|
|
bool | HardwareSPI_O::transferBytes (const uint8_t *out, uint8_t *in, uint32_t size, bool lastByte=false) override |
| Transfers data using SPI periphery in blocking mode, it is sending and receiving data simultaneously. More...
|
|
bool | HardwareSPI_O::writeBytes (const uint8_t *data, uint32_t size, bool lastByte=false) override |
| Sends data using SPI periphery in blocking mode. More...
|
|
bool | HardwareSPI_O::receiveBytes (uint8_t *data, uint32_t size, bool lastByte=false) override |
| Receives data from SPI periphery in blocking mode. More...
|
|
bool | HardwareSPI_O::transfer (void *buf, uint16_t count, bool lastByte=false) override |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
Optimized methods for performance for data transaction.
uint16_t HardwareSPI_O::receive |
( |
bool |
lastByte = false | ) |
|
|
overridevirtual |
Receives data from SPI periphery.
During receiving zeros will be sent when mode is set to Master. It is recommended to use available() method to check, if any data are available in FIFO buffer, else this method will wait until timeout or until receiving data. To check, if timeout elapsed, use lastTransactionStatus() method.
- Parameters
-
lastByte | Set to true, if this will be last transfered byte before calling endTransaction(). It is important to set this parameter when CRC is enabled, because CRC calculation hardware have to be noticed, that it have to check or send CRC. |
- Note
- beginTransaction() have to be called before using this method one or multiple time, then endTransaction has to be called to disable SPI.
-
When you have changed bit order to MSBFIRST, not only bits, but also bytes will be swapped.
- Returns
- Returns received 8-bit (or when data size is set to 16, then 16-bit) data.
Reimplemented from HardwareSPI.
uint16_t HardwareSPI_O::receive16 |
( |
bool |
lastByte = false | ) |
|
|
overridevirtual |
Receives data from SPI periphery.
During receiving zeros will be sent when mode is set to Master. It is recommended to use available() method to check, if any data are available in FIFO buffer, else this method will wait until timeout or until receiving data. To check, if timeout elapsed, use lastTransactionStatus() method.
- Parameters
-
lastByte | Set to true, if this will be last transfered byte before calling endTransaction(). It is important to set this parameter when CRC is enabled, because CRC calculation hardware have to be noticed, that it have to check or send CRC. |
- Note
- beginTransaction() have to be called before using this method one or multiple time, then endTransaction has to be called to disable SPI.
-
When you have changed bit order to MSBFIRST, not only bits, but also bytes will be swapped.
- Returns
- Returns received 16-bit data.
Reimplemented from HardwareSPI.
uint32_t HardwareSPI_O::receive32 |
( |
bool |
lastByte = false | ) |
|
|
overridevirtual |
Receives data from SPI periphery.
During receiving zeros will be sent when mode is set to Master. It is recommended to use available() method to check, if any data are available in FIFO buffer, else this method will wait until timeout or until receiving data. To check, if timeout elapsed, use lastTransactionStatus() method.
- Parameters
-
lastByte | Set to true, if this will be last transfered byte before calling endTransaction(). It is important to set this parameter when CRC is enabled, because CRC calculation hardware have to be noticed, that it have to check or send CRC. |
- Note
- beginTransaction() have to be called before using this method one or multiple time, then endTransaction has to be called to disable SPI.
-
When you have changed bit order to MSBFIRST, not only bits, but also bytes will be swapped.
- Returns
- Returns received 32-bit data.
Reimplemented from HardwareSPI.
bool HardwareSPI_O::receiveBytes |
( |
uint8_t * |
data, |
|
|
uint32_t |
size, |
|
|
bool |
lastByte = false |
|
) |
| |
|
overridevirtual |
Receives data from SPI periphery in blocking mode.
During receiving zeros will be sent when mode is set to Master. It is recommended to use available() method to check, if any data are available in FIFO buffer, else this method will wait until timeout or until receiving data. To check, if timeout elapsed, use lastTransactionStatus() method.
- Parameters
-
data | Pointer to array, where will be stored received data. |
size | The size of data in bytes (8-bits). |
lastByte | Set to true, if this is last transaction method before calling endTransaction(). It is important to set this parameter when CRC is enabled, because CRC calculation hardware have to be noticed, that it have to check or send CRC. |
- Note
- beginTransaction() and endTransaction() don't have to be called before, HardwareSPI methods will be called instead, but if you call it before, modified code will be called.
-
When you have changed bit order to MSBFIRST, only bits will be swapped. Bytes will be sent from array begin also in MSBFIST mode.
- Returns
- Returns true when data has been received.
Reimplemented from HardwareSPI.