Function esp_idf_hal::sys::spi_device_polling_transmit
source · pub unsafe extern "C" fn spi_device_polling_transmit(
handle: *mut spi_device_t,
trans_desc: *mut spi_transaction_t,
) -> i32
Expand description
@brief Send a polling transaction, wait for it to complete, and return the result
This function is the equivalent of calling spi_device_polling_start() followed by spi_device_polling_end(). Do not use this when there is still a transaction that hasn’t been finalized.
@note This function is not thread safe when multiple tasks access the same SPI device. Normally a device cannot start (queue) polling and interrupt transactions simutanuously.
@param handle Device handle obtained using spi_host_add_dev @param trans_desc Description of transaction to execute @return - ESP_ERR_INVALID_ARG if parameter is invalid - ESP_ERR_TIMEOUT if the device cannot get control of the bus - ESP_ERR_NO_MEM if allocating DMA-capable temporary buffer failed - ESP_ERR_INVALID_STATE if previous transactions of same device are not finished - ESP_OK on success