19.6.4.7.2 Function spi_read_buffer_job()

Asynchronous buffer read.

enum status_code spi_read_buffer_job( struct spi_module *const module, uint8_t * rx_data, uint16_t length, uint16_t dummy)

Sets up the driver to read from the SPI to a given buffer. If registered and enabled, a callback function will be called when the read 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-47. Parameters
Data directionParameter nameDescription

[in]

module

Pointer to SPI software instance struct

[out]

rx_data

Pointer to data buffer to receive

[in]

length

Data buffer length

[in]

dummy

Dummy character to send when reading in master mode

Returns

Status of the operation.

Table 19-48. 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