mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spi: remove hard-coded DMA chan in soc_caps.h
This commit is contained in:
parent
db3bf8b544
commit
d0415bd8f6
@ -53,7 +53,7 @@ static const char *SPI_TAG = "spi";
|
||||
SPI_CHECK(GPIO_IS_VALID_GPIO(pin_num), pin_name" not valid", ESP_ERR_INVALID_ARG); \
|
||||
}
|
||||
|
||||
#define MAIN_BUS_DEFAULT() { \
|
||||
#define SPI_MAIN_BUS_DEFAULT() { \
|
||||
.host_id = 0, \
|
||||
.bus_attr = { \
|
||||
.tx_dma_chan = 0, \
|
||||
@ -88,7 +88,7 @@ ATOMIC_VAR_INIT(false),
|
||||
};
|
||||
|
||||
static const char* spi_claiming_func[3] = {NULL, NULL, NULL};
|
||||
static spicommon_bus_context_t s_mainbus = MAIN_BUS_DEFAULT();
|
||||
static spicommon_bus_context_t s_mainbus = SPI_MAIN_BUS_DEFAULT();
|
||||
static spicommon_bus_context_t* bus_ctx[SOC_SPI_PERIPH_NUM] = {&s_mainbus};
|
||||
|
||||
#if !SOC_GDMA_SUPPORTED
|
||||
|
@ -10,20 +10,8 @@
|
||||
#define SOC_TWAI_SUPPORTED 1
|
||||
#define SOC_BT_SUPPORTED 1
|
||||
|
||||
// There are 3 DMA channels on ESP32-C3
|
||||
// Attention: These fixed DMA channels are temporarily workaround before we have a centralized DMA controller API to help alloc the channel dynamically
|
||||
// Remove them when GDMA driver API is ready
|
||||
#define SOC_GDMA_SPI2_DMA_CHANNEL (2)
|
||||
|
||||
//NOTE: The CHx number should be consistent with the selected DMA channel above
|
||||
#define SOC_GDMA_SPI2_INTR_SOURCE ETS_DMA_CH2_INTR_SOURCE
|
||||
//On C3, there is only 1 GPSPI controller (GPSPI2)
|
||||
#define SOC_GDMA_SPI3_DMA_CHANNEL SOC_GDMA_SPI2_DMA_CHANNEL
|
||||
|
||||
|
||||
#include "rmt_caps.h"
|
||||
|
||||
|
||||
/*-------------------------- DAC CAPS ----------------------------------------*/
|
||||
#define SOC_DAC_PERIPH_NUM 0
|
||||
|
||||
|
@ -63,7 +63,7 @@ const spi_signal_conn_t spi_periph_signal[SOC_SPI_PERIPH_NUM] = {
|
||||
.spihd_iomux_pin = FSPI_IOMUX_PIN_NUM_HD,
|
||||
.spics0_iomux_pin = FSPI_IOMUX_PIN_NUM_CS,
|
||||
.irq = ETS_SPI2_INTR_SOURCE,
|
||||
.irq_dma = SOC_GDMA_SPI2_INTR_SOURCE,
|
||||
.irq_dma = -1,
|
||||
.module = PERIPH_SPI2_MODULE,
|
||||
.hw = &GPSPI2,
|
||||
.func = FSPI_FUNC_NUM,
|
||||
|
@ -159,8 +159,6 @@
|
||||
|
||||
// Attention: These fixed DMA channels are temporarily workaround before we have a centralized DMA controller API to help alloc the channel dynamically
|
||||
// Remove them when GDMA driver API is ready
|
||||
#define SOC_GDMA_SPI2_DMA_CHANNEL (1)
|
||||
#define SOC_GDMA_SPI3_DMA_CHANNEL (2)
|
||||
#define SOC_GDMA_SHA_DMA_CHANNEL (3)
|
||||
#define SOC_GDMA_AES_DMA_CHANNEL (4)
|
||||
|
||||
|
@ -63,7 +63,7 @@ const spi_signal_conn_t spi_periph_signal[SOC_SPI_PERIPH_NUM] = {
|
||||
.spihd_iomux_pin = FSPI_IOMUX_PIN_NUM_HD,
|
||||
.spics0_iomux_pin = FSPI_IOMUX_PIN_NUM_CS,
|
||||
.irq = ETS_SPI2_INTR_SOURCE,
|
||||
.irq_dma = ETS_SPI2_DMA_INTR_SOURCE,
|
||||
.irq_dma = -1,
|
||||
.module = PERIPH_FSPI_MODULE,
|
||||
.hw = &GPSPI2,
|
||||
.func = FSPI_FUNC_NUM,
|
||||
@ -89,7 +89,7 @@ const spi_signal_conn_t spi_periph_signal[SOC_SPI_PERIPH_NUM] = {
|
||||
.spihd_iomux_pin = -1,
|
||||
.spics0_iomux_pin = -1,
|
||||
.irq = ETS_SPI3_INTR_SOURCE,
|
||||
.irq_dma = ETS_SPI3_DMA_INTR_SOURCE,
|
||||
.irq_dma = -1,
|
||||
.module = PERIPH_HSPI_MODULE,
|
||||
.hw = &GPSPI3,
|
||||
.func = -1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user