diff --git a/components/esp_coex/include/esp_coexist.h b/components/esp_coex/include/esp_coexist.h index f8eb69d5c7..9fda8c6d2f 100644 --- a/components/esp_coex/include/esp_coexist.h +++ b/components/esp_coex/include/esp_coexist.h @@ -167,7 +167,9 @@ esp_err_t esp_disable_extern_coex_gpio_pin(); * @brief Configure leader work mode, gpio pin correspondly and finally enable external coex, * demand not to call the legacy function of `esp_enable_extern_coex_gpio_pin` any more. * @param wire_type : to select the whole external coex gpio number. - * @param gpio_pin : gpio pin number to select. + * @param request : request gpio pin number to select. + * @param priority : priority gpio pin number to select. + * @param grant : grant gpio pin number to select. * @return : ESP_OK - success, other - failed */ esp_err_t esp_external_coex_leader_role_set_gpio_pin(external_coex_wire_t wire_type, uint32_t request, uint32_t priority, @@ -177,7 +179,9 @@ esp_err_t esp_external_coex_leader_role_set_gpio_pin(external_coex_wire_t wire_t * @brief Configure follower work mode, gpio pin correspondly and finally enable external coex, * demand not to call the legacy function of `esp_enable_extern_coex_gpio_pin` any more. * @param wire_type : to select the whole external coex gpio number. - * @param gpio_pin : gpio pin number to select. + * @param request : request gpio pin number to select. + * @param priority : priority gpio pin number to select. + * @param grant : grant gpio pin number to select. * @return : ESP_OK - success, other - failed */ esp_err_t esp_external_coex_follower_role_set_gpio_pin(external_coex_wire_t wire_type, uint32_t request, uint32_t priority, diff --git a/components/esp_coex/include/esp_coexist_internal.h b/components/esp_coex/include/esp_coexist_internal.h index d22f86d2f3..5d1fe2c5a5 100644 --- a/components/esp_coex/include/esp_coexist_internal.h +++ b/components/esp_coex/include/esp_coexist_internal.h @@ -308,10 +308,13 @@ esp_err_t esp_coex_adapter_register(coex_adapter_funcs_t *funcs); /** * @brief Set external coexistence advanced informations, like working mode. * + * @param out_pti1 This parameter no longer works, will be deprecated and later removed in future releases. + * @param out_pti2 This parameter no longer works, will be deprecated and later removed in future releases. + * * @return * - ESP_OK: succeed */ -esp_err_t esp_coex_external_params(esp_external_coex_advance_t coex_info); +esp_err_t esp_coex_external_params(esp_external_coex_advance_t coex_info, uint32_t out_pti1, uint32_t out_pti2); /** * @brief Set external coexistence pti level and enable it. @@ -333,6 +336,18 @@ esp_err_t esp_coex_external_set(esp_coex_pti_level_t level1, * - ESP_OK: succeed */ void esp_coex_external_stop(void); + +#if SOC_EXTERNAL_COEX_LEADER_TX_LINE +/** + * @brief Enable external coexist tx line + * + * @param en Enable external coex tx line + * + * @return + * - ESP_OK: succeed + */ +void esp_coex_external_set_txline(bool en); +#endif /*SOC_EXTERNAL_COEX_LEADER_TX_LINE*/ #endif /*External Coex*/ /** diff --git a/components/esp_coex/lib b/components/esp_coex/lib index 08e1c246c7..37698e17a4 160000 --- a/components/esp_coex/lib +++ b/components/esp_coex/lib @@ -1 +1 @@ -Subproject commit 08e1c246c74050565806289000f9d506bfb6ac01 +Subproject commit 37698e17a4c7fd2e0872317fc8befaac3bb10cb4 diff --git a/components/esp_coex/src/coexist.c b/components/esp_coex/src/coexist.c index 37eebd8bf7..354d6e6190 100644 --- a/components/esp_coex/src/coexist.c +++ b/components/esp_coex/src/coexist.c @@ -164,7 +164,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex } #if SOC_EXTERNAL_COEX_ADVANCE - esp_coex_external_params(g_external_coex_params); + esp_coex_external_params(g_external_coex_params, 0, 0); #endif if(EXTERNAL_COEX_LEADER_ROLE == g_external_coex_params.work_mode) { @@ -173,6 +173,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex #if SOC_EXTERNAL_COEX_LEADER_TX_LINE case EXTERN_COEX_WIRE_4: { + esp_coex_external_set_txline(true); gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.tx_line], PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.tx_line, GPIO_MODE_OUTPUT); REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT(gpio_pin.tx_line)); @@ -254,10 +255,11 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex return ESP_FAIL; } } -#endif /* SOC_EXTERNAL_COEX_ADVANCE */ +#else return ESP_ERR_INVALID_ARG; +#endif /* SOC_EXTERNAL_COEX_ADVANCE */ } - int ret = esp_coex_external_set(EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_HIGH); + esp_err_t ret = esp_coex_external_set(EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_HIGH); if (ESP_OK != ret) { return ESP_FAIL; } diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index a01f14dee5..82dd9020a4 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit a01f14dee52680123d016e7f8dc5a3c10aaf767d +Subproject commit 82dd9020a46f8603c60c33e5af87a80a256f4f8f diff --git a/examples/wifi/iperf/main/cmd_wifi.c b/examples/wifi/iperf/main/cmd_wifi.c index 9a876a22d5..b85010b337 100644 --- a/examples/wifi/iperf/main/cmd_wifi.c +++ b/examples/wifi/iperf/main/cmd_wifi.c @@ -172,21 +172,21 @@ void initialise_wifi(void) ESP_ERROR_CHECK(esp_wifi_start() ); #if CONFIG_EXTERNAL_COEX_ENABLE -#if SOC_EXTERNAL_COEX_ADVANCE - uint32_t request = 1; - uint32_t priority = 2; - uint32_t grant = 3; - ESP_ERROR_CHECK(esp_external_coex_leader_role_set_gpio_pin(EXTERN_COEX_WIRE_3, request, priority, grant)); -#else esp_external_coex_gpio_set_t gpio_pin; gpio_pin.request = 1; gpio_pin.priority = 2; gpio_pin.grant = 3; +#if SOC_EXTERNAL_COEX_LEADER_TX_LINE gpio_pin.tx_line = 4; +#endif + esp_external_coex_set_work_mode(EXTERNAL_COEX_LEADER_ROLE); +#if SOC_EXTERNAL_COEX_LEADER_TX_LINE ESP_ERROR_CHECK(esp_enable_extern_coex_gpio_pin(EXTERN_COEX_WIRE_4, gpio_pin)); -#endif -#endif +#else + ESP_ERROR_CHECK(esp_enable_extern_coex_gpio_pin(EXTERN_COEX_WIRE_3, gpio_pin)); +#endif /* SOC_EXTERNAL_COEX_LEADER_TX_LINE */ +#endif /* CONFIG_EXTERNAL_COEX_ENABLE */ #if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS #if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS