mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
spi_slave: add api 'queue_trans_isr' and add a test case
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_err.h"
|
||||
#include "hal/spi_types.h"
|
||||
#include "driver/spi_slave.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -37,3 +38,24 @@ extern "C" {
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
esp_err_t spi_slave_queue_reset(spi_host_device_t host);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Queue a SPI transaction in ISR
|
||||
*
|
||||
* Similar as ``spi_slave_queue_trans``, but can and can only called within an ISR, then get the transaction results
|
||||
* through the transaction discriptor passed in ``spi_slave_interface_config_t::post_trans_cb``. if use this API, you
|
||||
* should trigger a transaction by normal ``spi_slave_queue_trans`` once and only once to start isr
|
||||
*
|
||||
* If you use both ``spi_slave_queue_trans`` and ``spi_slave_queue_trans_isr`` simultaneously to transfer valid data,
|
||||
* you should deal with concurrency issues on your self risk
|
||||
*
|
||||
* @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.
|
||||
* @return
|
||||
* - ESP_ERR_INVALID_ARG if parameter is invalid
|
||||
* - ESP_ERR_NO_MEM if trans_queue is full
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
esp_err_t spi_slave_queue_trans_isr(spi_host_device_t host, const spi_slave_transaction_t *trans_desc);
|
||||
|
Reference in New Issue
Block a user