Ticks to wait until there's room in the queue; use portMAX_DELAY to never time out.
Return value
- 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) or set flag SPI_TRANS_DMA_BUFFER_ALIGN_MANUAL but tx or rx buffer not DMA-capable, or addr&len not align to cache line size - ESP_ERR_TIMEOUT if there was no room in the queue 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
Notes
Normally a device cannot start (queue) polling and interrupt transactions simultaneously.
Related Functions
Found 16 other functions taking a spi_device_t
argument:
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.
Send a SPI transaction, wait for it to complete, and return the result This function is the equivalent of calling spi_device_queue_trans() followed by spi_device_get_trans_result(). Do not use this when there is still a transaction separately queued (started) from spi_device_queue_trans() or polling_start/transmit that hasn't been finalized.
Allocate a device on a SPI bus This initializes the internal structures for a device, plus allocates a CS pin on the indicated SPI master peripheral and routes it to the indicated GPIO. All SPI master devices have three CS pins and can thus control up to three devices. There's no notable delay on chips other than ESP32.
Occupy the SPI bus for a device to do continuous transactions. Transactions to all other devices will be put off until ``spi_device_release_bus`` is called.
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 successfully completed. It will then return the description of the completed transaction so software can inspect the result and e.g. free the memory or reuse the buffers.
Poll until the polling transaction ends. This routine will not return until the transaction to the given device has successfully completed. The task is not blocked, but actively busy-spins for the transaction to be completed.