Serial Peripheral Interface (SPI) master for high-speed data transfer.
More...
|
| MYRIOTA_HARDWARE_API int | SPIInit (uint32_t BaudRate) |
| | Initialise SPI master.
|
| |
| MYRIOTA_HARDWARE_API void | SPIDeinit (void) |
| | Deinitialise SPI master.
|
| |
| MYRIOTA_HARDWARE_API int | SPIWrite (const uint8_t *Tx, size_t Length) |
| | Write to an SPI device synchronously.
|
| |
| MYRIOTA_HARDWARE_API int | SPITransfer (const uint8_t *Tx, uint8_t *Rx, size_t Length) |
| | SPI data transfer.
|
| |
Serial Peripheral Interface (SPI) master for high-speed data transfer.
◆ SPIBaudrate
SPI baudrate.
| Enumerator |
|---|
| SPI_BAUDRATE_DEFAULT | 1 MHz.
|
| SPI_BAUDRATE_MAX | 24 MHz.
|
◆ SPIInit()
| MYRIOTA_HARDWARE_API int SPIInit |
( |
uint32_t |
BaudRate | ) |
|
Initialise SPI master.
- Parameters
-
| BaudRate | The SPI baudrate. |
- Returns
- 0 if initialisation succeeds, -1 if initialisation fails.
◆ SPIDeinit()
| MYRIOTA_HARDWARE_API void SPIDeinit |
( |
void |
| ) |
|
Deinitialise SPI master.
Disables SPI communications and releases associated hardware resources.
◆ SPIWrite()
| MYRIOTA_HARDWARE_API int SPIWrite |
( |
const uint8_t * |
Tx, |
|
|
size_t |
Length |
|
) |
| |
Write to an SPI device synchronously.
- Parameters
-
| Tx[in] | Pointer to the data to be transmitted. |
| Length | Length of the data to be transmitted. |
- Returns
- 0 if write succeeds, -1 if write fails.
◆ SPITransfer()
| MYRIOTA_HARDWARE_API int SPITransfer |
( |
const uint8_t * |
Tx, |
|
|
uint8_t * |
Rx, |
|
|
size_t |
Length |
|
) |
| |
SPI data transfer.
- Parameters
-
| Tx[in] | Pointer to the data to be transmitted. |
| Rx[out] | Pointer to the buffer to store the received data. |
| Length | Length of the data to be transferred. |
- Returns
- 0 if transfer succeeds, -1 if transfer fails.