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.
| Data direction | Parameter name | Description |
|---|---|---|
|
[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.
| 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 |
