From ac05d033b9cb8b77ab186783f8108f86e7cf8d05 Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 10 Jan 2023 10:28:41 +0800 Subject: [PATCH] gdma: correct the dma trigger of uart GDMA trigger actually is not assigned to UART controller, but for UHCI controller --- components/esp_hw_support/include/esp_private/gdma.h | 6 +++--- components/soc/esp32c2/include/soc/gdma_channel.h | 2 +- components/soc/esp32c3/include/soc/gdma_channel.h | 2 +- components/soc/esp32h2/include/soc/gdma_channel.h | 2 +- components/soc/esp32s3/include/soc/gdma_channel.h | 2 +- .../hci/controller_hci_uart_esp32c3_and_esp32s3/main/main.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/esp_hw_support/include/esp_private/gdma.h b/components/esp_hw_support/include/esp_private/gdma.h index f888cd5bc9..1e0bb51003 100644 --- a/components/esp_hw_support/include/esp_private/gdma.h +++ b/components/esp_hw_support/include/esp_private/gdma.h @@ -30,7 +30,7 @@ typedef struct gdma_channel_t *gdma_channel_handle_t; */ typedef enum { GDMA_TRIG_PERIPH_M2M, /*!< GDMA trigger peripheral: M2M */ - GDMA_TRIG_PERIPH_UART, /*!< GDMA trigger peripheral: UART */ + GDMA_TRIG_PERIPH_UHCI, /*!< GDMA trigger peripheral: UHCI */ GDMA_TRIG_PERIPH_SPI, /*!< GDMA trigger peripheral: SPI */ GDMA_TRIG_PERIPH_I2S, /*!< GDMA trigger peripheral: I2S */ GDMA_TRIG_PERIPH_AES, /*!< GDMA trigger peripheral: AES */ @@ -124,13 +124,13 @@ typedef struct { */ typedef struct { gdma_trigger_peripheral_t periph; /*!< Target peripheral which will trigger DMA operations */ - int instance_id; /*!< Peripheral instance ID. Supported IDs are listed in `soc/gdma_channel.h`, e.g. SOC_GDMA_TRIG_PERIPH_UART0 */ + int instance_id; /*!< Peripheral instance ID. Supported IDs are listed in `soc/gdma_channel.h`, e.g. SOC_GDMA_TRIG_PERIPH_UHCI0 */ } gdma_trigger_t; /** * @brief Helper macro to initialize GDMA trigger * @note value of `peri` must be selected from `gdma_trigger_peripheral_t` enum. - * e.g. GDMA_MAKE_TRIGGER(GDMA_TRIG_PERIPH_UART,0) + * e.g. GDMA_MAKE_TRIGGER(GDMA_TRIG_PERIPH_I2S,0) * */ #define GDMA_MAKE_TRIGGER(peri, id) \ diff --git a/components/soc/esp32c2/include/soc/gdma_channel.h b/components/soc/esp32c2/include/soc/gdma_channel.h index 1c84a35249..d45217826b 100644 --- a/components/soc/esp32c2/include/soc/gdma_channel.h +++ b/components/soc/esp32c2/include/soc/gdma_channel.h @@ -9,6 +9,6 @@ // The following macros have a format SOC_[periph][instance_id] to make it work with `GDMA_MAKE_TRIGGER` #define SOC_GDMA_TRIG_PERIPH_M2M0 (-1) #define SOC_GDMA_TRIG_PERIPH_SPI2 (0) -#define SOC_GDMA_TRIG_PERIPH_UART0 (2) +#define SOC_GDMA_TRIG_PERIPH_UHCI0 (2) #define SOC_GDMA_TRIG_PERIPH_SHA0 (7) #define SOC_GDMA_TRIG_PERIPH_ADC0 (8) diff --git a/components/soc/esp32c3/include/soc/gdma_channel.h b/components/soc/esp32c3/include/soc/gdma_channel.h index ca3f0f7951..5f0b818bd2 100644 --- a/components/soc/esp32c3/include/soc/gdma_channel.h +++ b/components/soc/esp32c3/include/soc/gdma_channel.h @@ -9,7 +9,7 @@ // The following macros have a format SOC_[periph][instance_id] to make it work with `GDMA_MAKE_TRIGGER` #define SOC_GDMA_TRIG_PERIPH_M2M0 (-1) #define SOC_GDMA_TRIG_PERIPH_SPI2 (0) -#define SOC_GDMA_TRIG_PERIPH_UART0 (2) +#define SOC_GDMA_TRIG_PERIPH_UHCI0 (2) #define SOC_GDMA_TRIG_PERIPH_I2S0 (3) #define SOC_GDMA_TRIG_PERIPH_AES0 (6) #define SOC_GDMA_TRIG_PERIPH_SHA0 (7) diff --git a/components/soc/esp32h2/include/soc/gdma_channel.h b/components/soc/esp32h2/include/soc/gdma_channel.h index ca3f0f7951..5f0b818bd2 100644 --- a/components/soc/esp32h2/include/soc/gdma_channel.h +++ b/components/soc/esp32h2/include/soc/gdma_channel.h @@ -9,7 +9,7 @@ // The following macros have a format SOC_[periph][instance_id] to make it work with `GDMA_MAKE_TRIGGER` #define SOC_GDMA_TRIG_PERIPH_M2M0 (-1) #define SOC_GDMA_TRIG_PERIPH_SPI2 (0) -#define SOC_GDMA_TRIG_PERIPH_UART0 (2) +#define SOC_GDMA_TRIG_PERIPH_UHCI0 (2) #define SOC_GDMA_TRIG_PERIPH_I2S0 (3) #define SOC_GDMA_TRIG_PERIPH_AES0 (6) #define SOC_GDMA_TRIG_PERIPH_SHA0 (7) diff --git a/components/soc/esp32s3/include/soc/gdma_channel.h b/components/soc/esp32s3/include/soc/gdma_channel.h index 373cf6cabd..6178c1f1ab 100644 --- a/components/soc/esp32s3/include/soc/gdma_channel.h +++ b/components/soc/esp32s3/include/soc/gdma_channel.h @@ -10,7 +10,7 @@ #define SOC_GDMA_TRIG_PERIPH_M2M0 (-1) #define SOC_GDMA_TRIG_PERIPH_SPI2 (0) #define SOC_GDMA_TRIG_PERIPH_SPI3 (1) -#define SOC_GDMA_TRIG_PERIPH_UART0 (2) +#define SOC_GDMA_TRIG_PERIPH_UHCI0 (2) #define SOC_GDMA_TRIG_PERIPH_I2S0 (3) #define SOC_GDMA_TRIG_PERIPH_I2S1 (4) #define SOC_GDMA_TRIG_PERIPH_LCD0 (5) diff --git a/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/main/main.c b/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/main/main.c index 0cacc7b4ca..8770990c8e 100644 --- a/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/main/main.c +++ b/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/main/main.c @@ -221,8 +221,8 @@ void uhci_uart_install(void) }; ESP_ERROR_CHECK(gdma_new_channel(&rx_channel_config, &s_rx_channel)); - gdma_connect(s_tx_channel, GDMA_MAKE_TRIGGER(GDMA_TRIG_PERIPH_UART, 0)); - gdma_connect(s_rx_channel, GDMA_MAKE_TRIGGER(GDMA_TRIG_PERIPH_UART, 0)); + gdma_connect(s_tx_channel, GDMA_MAKE_TRIGGER(GDMA_TRIG_PERIPH_UHCI, 0)); + gdma_connect(s_rx_channel, GDMA_MAKE_TRIGGER(GDMA_TRIG_PERIPH_UHCI, 0)); gdma_strategy_config_t strategy_config = { .auto_update_desc = false,