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.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to the software instance struct |
[out] |
rx_data |
Pointer to store the received data |
Returns
Status of the read operation.
Return value | Description |
---|---|
STATUS_OK |
If data was read |
STATUS_ERR_IO |
If no data is available |
STATUS_ERR_OVERFLOW |
If the data is overflown |