19.6.4.5.3 Function spi_read()

Reads last received SPI character.

enum status_code spi_read( struct spi_module *const module, uint16_t * rx_data)

This function will return the last SPI character shifted into the receive register by the spi_write function.

Note: The spi_is_ready_to_read function should be called before calling this function.
Note: Receiver must be enabled in the configuration.
Table 19-31. Parameters
Data directionParameter nameDescription

[in]

module

Pointer to the software instance struct

[out]

rx_data

Pointer to store the received data

Returns

Status of the read operation.

Table 19-32. Return Values
Return valueDescription

STATUS_OK

If data was read

STATUS_ERR_IO

If no data is available

STATUS_ERR_OVERFLOW

If the data is overflown