mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spi_master: added a device flag "SPI_DEVICE_NO_RETURN_RESULT"
Add this flag to select if returning done transaction descriptors from ISR. You should get the finished transaction descriptor by the callback "post_cb" if you using this flag, if not, same as the past. Close https://github.com/espressif/esp-idf/pull/9141
This commit is contained in:
parent
45ad46eb27
commit
677a0c438d
@ -43,7 +43,7 @@ extern "C"
|
|||||||
*/
|
*/
|
||||||
#define SPI_DEVICE_NO_DUMMY (1<<6)
|
#define SPI_DEVICE_NO_DUMMY (1<<6)
|
||||||
#define SPI_DEVICE_DDRCLK (1<<7)
|
#define SPI_DEVICE_DDRCLK (1<<7)
|
||||||
|
#define SPI_DEVICE_NO_RETURN_RESULT (1<<8) ///< Don't return the descriptor to the host on completion (use post_cb to notify instead)
|
||||||
|
|
||||||
typedef struct spi_transaction_t spi_transaction_t;
|
typedef struct spi_transaction_t spi_transaction_t;
|
||||||
typedef void(*transaction_cb_t)(spi_transaction_t *trans);
|
typedef void(*transaction_cb_t)(spi_transaction_t *trans);
|
||||||
|
@ -612,9 +612,13 @@ static void SPI_MASTER_ISR_ATTR spi_intr(void *arg)
|
|||||||
|
|
||||||
//cur_cs is changed to DEV_NUM_MAX here
|
//cur_cs is changed to DEV_NUM_MAX here
|
||||||
spi_post_trans(host);
|
spi_post_trans(host);
|
||||||
// spi_bus_lock_bg_pause(bus_attr->lock);
|
|
||||||
|
if (!(host->device[cs]->cfg.flags & SPI_DEVICE_NO_RETURN_RESULT)) {
|
||||||
//Return transaction descriptor.
|
//Return transaction descriptor.
|
||||||
xQueueSendFromISR(host->device[cs]->ret_queue, &host->cur_trans_buf, &do_yield);
|
xQueueSendFromISR(host->device[cs]->ret_queue, &host->cur_trans_buf, &do_yield);
|
||||||
|
}
|
||||||
|
|
||||||
|
// spi_bus_lock_bg_pause(bus_attr->lock);
|
||||||
#ifdef CONFIG_PM_ENABLE
|
#ifdef CONFIG_PM_ENABLE
|
||||||
//Release APB frequency lock
|
//Release APB frequency lock
|
||||||
esp_pm_lock_release(bus_attr->pm_lock);
|
esp_pm_lock_release(bus_attr->pm_lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user