Function esp_idf_hal::sys::spi_device_polling_start
source · pub unsafe extern "C" fn spi_device_polling_start(
handle: *mut spi_device_t,
trans_desc: *mut spi_transaction_t,
ticks_to_wait: u32,
) -> i32
Expand description
@brief Immediately start a polling transaction.
@note Normally a device cannot start (queue) polling and interrupt transactions simutanuously. Moreover, a device cannot start a new polling transaction if another polling transaction is not finished.
@param handle Device handle obtained using spi_host_add_dev @param trans_desc Description of transaction to execute @param ticks_to_wait Ticks to wait until there’s room in the queue; currently only portMAX_DELAY is supported.
@return
- ESP_ERR_INVALID_ARG if parameter is invalid. This can happen if SPI_TRANS_CS_KEEP_ACTIVE flag is specified while
the bus was not acquired (spi_device_acquire_bus()
should be called first)
- ESP_ERR_TIMEOUT if the device cannot get control of the bus before ticks_to_wait
expired
- ESP_ERR_NO_MEM if allocating DMA-capable temporary buffer failed
- ESP_ERR_INVALID_STATE if previous transactions are not finished
- ESP_OK on success