pub unsafe extern "C" fn spi_slave_queue_trans(
host: spi_host_device_t,
trans_desc: *const spi_slave_transaction_t,
ticks_to_wait: TickType_t,
) -> esp_err_t
Expand description
@brief Queue a SPI transaction for execution
@note On esp32, if trans length not WORD aligned, the rx buffer last word memory will still overwritten by DMA HW
Queues a SPI transaction to be executed by this slave device. (The transaction queue size was specified when the slave device was initialised via spi_slave_initialize.) This function may block if the queue is full (depending on the ticks_to_wait parameter). No SPI operation is directly initiated by this function, the next queued transaction will happen when the master initiates a SPI transaction by pulling down CS and sending out clock signals.
This function hands over ownership of the buffers in trans_desc
to the SPI slave driver; the application is
not to access this memory until spi_slave_queue_trans
is called to hand ownership back to the application.
@param host SPI peripheral that is acting as a slave
@param trans_desc Description of transaction to execute. Not const because we may want to write status back
into the transaction description.
@param ticks_to_wait Ticks to wait until there’s room in the queue; use portMAX_DELAY to
never time out.
@return
- ESP_ERR_INVALID_ARG if parameter is invalid
- ESP_ERR_NO_MEM if set flag SPI_SLAVE_TRANS_DMA_BUFFER_ALIGN_AUTO
but there is no free memory
- ESP_ERR_INVALID_STATE if sync data between Cache and memory failed
- ESP_OK on success