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.

Note: If address matching is enabled for the slave, the first character received and placed in the RX buffer will be the address.
Table 19-49. Parameters
Data directionParameter nameDescription

[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.

Table 19-50. Return Values
Return valueDescription

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