|
virtual uint16_t | HardwareSPI::transfer (uint16_t data, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual uint16_t | HardwareSPI::transfer16 (uint16_t data, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual uint32_t | HardwareSPI::transfer32 (uint32_t data, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual bool | HardwareSPI::transfer (void *buf, uint16_t count, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual bool | HardwareSPI::write (uint16_t data, bool lastByte=false) |
| Sends data using SPI periphery. More...
|
|
virtual bool | HardwareSPI::write16 (uint16_t data, bool lastByte=false) |
| Sends data using SPI periphery. More...
|
|
virtual bool | HardwareSPI::write32 (uint32_t data, bool lastByte=false) |
| Sends data using SPI periphery. More...
|
|
virtual uint16_t | HardwareSPI::receive (bool lastByte=false) |
| Receives data from SPI periphery. More...
|
|
virtual uint16_t | HardwareSPI::receive16 (bool lastByte=false) |
| Receives data from SPI periphery. More...
|
|
virtual uint32_t | HardwareSPI::receive32 (bool lastByte=false) |
| Receives data from SPI periphery. More...
|
|
virtual bool | HardwareSPI::writeBytes (const uint8_t *data, uint32_t size, bool lastByte=false) |
| Sends data using SPI periphery in blocking mode. More...
|
|
virtual bool | HardwareSPI::writeBytesNonBlocking (const uint8_t *data, uint32_t size, bool lastByte=false) |
| Sends data using SPI periphery using DMA or IT (interrupt) mode. More...
|
|
virtual bool | HardwareSPI::transferBytes (const uint8_t *out, uint8_t *in, uint32_t size, bool lastByte=false) |
| Transfers data using SPI periphery in blocking mode, it is sending and receiving data simultaneously. More...
|
|
virtual bool | HardwareSPI::transferBytesNonBlocking (const uint8_t *out, uint8_t *in, uint32_t size, bool lastByte=false) |
| Transfers data using SPI periphery using DMA or IT (interrupt) mode, it is sending and receiving data simultaneously. More...
|
|
virtual bool | HardwareSPI::receiveBytes (uint8_t *data, uint32_t size, bool lastByte=false) |
| Receives data from SPI periphery in blocking mode. More...
|
|
virtual bool | HardwareSPI::receiveBytesNonBlocking (uint8_t *data, uint32_t size, bool lastByte=false) |
| Receives data from SPI periphery in non-blocking mode using DMA or IT (interrupt) mode. More...
|
|
Methods for data transaction.
uint16_t HardwareSPI::receive |
( |
bool |
lastByte = false | ) |
|
|
virtual |
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
-
- Note
- 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 in HardwareSPI_O.
uint16_t HardwareSPI::receive16 |
( |
bool |
lastByte = false | ) |
|
|
virtual |
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
-
- Note
- When you have changed bit order to MSBFIRST, not only bits, but also bytes will be swapped.
- Returns
- Returns received 16-bit data.
Reimplemented in HardwareSPI_O.
uint32_t HardwareSPI::receive32 |
( |
bool |
lastByte = false | ) |
|
|
virtual |
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
-
- Note
- When you have changed bit order to MSBFIRST, not only bits, but also bytes will be swapped.
- Returns
- Returns received 32-bit data.
Reimplemented in HardwareSPI_O.
bool HardwareSPI::receiveBytes |
( |
uint8_t * |
data, |
|
|
uint32_t |
size, |
|
|
bool |
lastByte = false |
|
) |
| |
|
virtual |
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 | Unused in HardwareSPI. |
- Note
- 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 in HardwareSPI_O.
bool HardwareSPI::receiveBytesNonBlocking |
( |
uint8_t * |
data, |
|
|
uint32_t |
size, |
|
|
bool |
lastByte = false |
|
) |
| |
|
virtual |
Receives data from SPI periphery in non-blocking mode using DMA or IT (interrupt) 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 | Unused in HardwareSPI. |
- Note
- When you have changed bit order to MSBFIRST, only bits will be swapped. Bytes will be sent from array begin also in MSBFIST mode.
- Warning
- Data have to be available on same pointer until they are received.
- Returns
- Returns true when data has been received.