feat(15.4): support setting 15.4 txrx pti when coex is enabled

This commit is contained in:
Xu Si Yu
2024-12-12 20:29:34 +08:00
parent 2f62363cc6
commit 5280268e65
17 changed files with 267 additions and 21 deletions

View File

@@ -35,5 +35,6 @@ idf_component_register(
INCLUDE_DIRS "${include}"
PRIV_INCLUDE_DIRS "${private_include}"
LDFRAGMENTS linker.lf
PRIV_REQUIRES esp_phy driver esp_timer esp_coex soc hal
REQUIRES esp_coex
PRIV_REQUIRES esp_phy driver esp_timer soc hal
)

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -22,20 +22,39 @@ uint8_t ieee802154_channel_to_freq(uint8_t channel)
}
#if !CONFIG_IEEE802154_TEST && (CONFIG_ESP_COEX_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE)
esp_ieee802154_coex_config_t s_coex_config = {
.idle = IEEE802154_IDLE,
.txrx = IEEE802154_LOW,
.txrx_at = IEEE802154_MIDDLE,
};
void ieee802154_set_coex_config(esp_ieee802154_coex_config_t config)
{
s_coex_config.idle = config.idle;
s_coex_config.txrx = config.txrx;
s_coex_config.txrx_at = config.txrx_at;
}
esp_ieee802154_coex_config_t ieee802154_get_coex_config(void)
{
return s_coex_config;
}
void ieee802154_set_txrx_pti(ieee802154_txrx_scene_t txrx_scene)
{
switch (txrx_scene) {
case IEEE802154_SCENE_IDLE:
esp_coex_ieee802154_txrx_pti_set(IEEE802154_IDLE);
esp_coex_ieee802154_txrx_pti_set(s_coex_config.idle);
break;
case IEEE802154_SCENE_TX:
case IEEE802154_SCENE_RX:
esp_coex_ieee802154_txrx_pti_set(IEEE802154_LOW);
esp_coex_ieee802154_txrx_pti_set(s_coex_config.txrx);
break;
case IEEE802154_SCENE_TX_AT:
case IEEE802154_SCENE_RX_AT:
esp_coex_ieee802154_txrx_pti_set(IEEE802154_MIDDLE);
esp_coex_ieee802154_txrx_pti_set(s_coex_config.txrx_at);
break;
default:
assert(false);

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -471,3 +471,15 @@ void esp_ieee802154_record_print(void)
ieee802154_record_print();
}
#endif // CONFIG_IEEE802154_RECORD
#if !CONFIG_IEEE802154_TEST && (CONFIG_ESP_COEX_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE)
void esp_ieee802154_set_coex_config(esp_ieee802154_coex_config_t config)
{
ieee802154_set_coex_config(config);
}
esp_ieee802154_coex_config_t esp_ieee802154_get_coex_config(void)
{
return ieee802154_get_coex_config();
}
#endif

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -12,6 +12,10 @@
#include "esp_err.h"
#include "esp_ieee802154_types.h"
#if !CONFIG_IEEE802154_TEST && (CONFIG_ESP_COEX_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE)
#include "esp_coex_i154.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -699,6 +703,27 @@ void esp_ieee802154_rx_buffer_statistic_print(void);
*/
void esp_ieee802154_record_print(void);
#endif // CONFIG_IEEE802154_RECORD
#if !CONFIG_IEEE802154_TEST && (CONFIG_ESP_COEX_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE)
/**
* @brief Set the IEEE802.15.4 coexist config.
*
* @param[in] config The config of IEEE802.15.4 coexist.
*
*/
void esp_ieee802154_set_coex_config(esp_ieee802154_coex_config_t config);
/**
* @brief Get the IEEE802.15.4 coexist config.
*
* @return
* - The config of IEEE802.15.4 coexist.
*
*/
esp_ieee802154_coex_config_t esp_ieee802154_get_coex_config(void);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -368,6 +368,26 @@ void ieee802154_etm_set_event_task(uint32_t channel, uint32_t event, uint32_t ta
*/
void ieee802154_etm_channel_clear(uint32_t channel);
#if !CONFIG_IEEE802154_TEST && (CONFIG_ESP_COEX_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE)
/**
* @brief Set the IEEE802.15.4 coexist config.
*
* @param[in] config The config of IEEE802.15.4 coexist.
*
*/
void ieee802154_set_coex_config(esp_ieee802154_coex_config_t config);
/**
* @brief Get the IEEE802.15.4 coexist config.
*
* @return
* - The config of IEEE802.15.4 coexist.
*
*/
esp_ieee802154_coex_config_t ieee802154_get_coex_config(void);
#endif
#ifdef __cplusplus
}
#endif