Function esp_idf_svc::hal::sys::spi_device_get_trans_result
source · pub unsafe extern "C" fn spi_device_get_trans_result(
handle: *mut spi_device_t,
trans_desc: *mut *mut spi_transaction_t,
ticks_to_wait: u32,
) -> i32
Expand description
@brief Get the result of a SPI transaction queued earlier by spi_device_queue_trans
.
This routine will wait until a transaction to the given device succesfully completed. It will then return the description of the completed transaction so software can inspect the result and e.g. free the memory or re-use the buffers.
@param handle Device handle obtained using spi_host_add_dev
@param trans_desc Pointer to variable able to contain a pointer to the description of the transaction
that is executed. The descriptor should not be modified until the descriptor is returned by
spi_device_get_trans_result.
@param ticks_to_wait Ticks to wait until there’s a returned item; use portMAX_DELAY to never time
out.
@return
- ESP_ERR_INVALID_ARG if parameter is invalid
- ESP_ERR_NOT_SUPPORTED if flag SPI_DEVICE_NO_RETURN_RESULT
is set
- ESP_ERR_TIMEOUT if there was no completed transaction before ticks_to_wait expired
- ESP_OK on success