19.6.4.7.3 Function spi_transceive_buffer_job()
Asynchronous buffer write and read.
enum status_code spi_transceive_buffer_job( struct spi_module *const module, uint8_t * tx_data, uint8_t * rx_data, uint16_t length)
Sets up the driver to write and read to and from given buffers. If registered and enabled, a callback function will be called when the transfer is finished.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to SPI software instance struct |
[in] |
tx_data |
Pointer to data buffer to send |
[out] |
rx_data |
Pointer to data buffer to receive |
[in] |
length |
Data buffer length |
Returns
Status of the operation.
Return value | Description |
---|---|
STATUS_OK |
If the operation completed successfully |
STATUS_ERR_BUSY |
If the SPI was already busy with a read operation |
STATUS_ERR_DENIED |
If the receiver is not enabled |
STATUS_ERR_INVALID_ARG |
If requested read length was zero |