forked from espressif/esp-idf
feat(ieee802154): register power_down/power_up callback for esp32c6
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "esp_pm.h"
|
||||
#include "esp_private/esp_clk.h"
|
||||
#include "esp_private/sleep_retention.h"
|
||||
#include "esp_private/sleep_modem.h"
|
||||
static bool s_rf_closed = false;
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
#define IEEE802154_LINK_OWNER ENTRY(3)
|
||||
@@ -613,6 +614,12 @@ void ieee802154_enable(void)
|
||||
void ieee802154_disable(void)
|
||||
{
|
||||
modem_clock_module_disable(ieee802154_periph.module);
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
esp_pm_unregister_mac_bb_module_prepare_callback(mac_bb_power_down_prepare,
|
||||
mac_bb_power_up_prepare);
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
ieee802154_set_state(IEEE802154_STATE_DISABLE);
|
||||
}
|
||||
|
||||
@@ -788,6 +795,12 @@ static esp_err_t ieee802154_sleep_init(void)
|
||||
err = sleep_retention_entries_create(ieee802154_mac_regs_retention, ARRAY_SIZE(ieee802154_mac_regs_retention), REGDMA_LINK_PRI_7, SLEEP_RETENTION_MODULE_802154_MAC);
|
||||
ESP_RETURN_ON_ERROR(err, IEEE802154_TAG, "failed to allocate memory for ieee802154 mac retention");
|
||||
ESP_LOGI(IEEE802154_TAG, "ieee802154 mac sleep retention initialization");
|
||||
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
esp_pm_register_mac_bb_module_prepare_callback(mac_bb_power_down_prepare,
|
||||
mac_bb_power_up_prepare);
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
@@ -45,8 +45,15 @@ examples/openthread/ot_rcp:
|
||||
reason: only test on esp32c6
|
||||
<<: *openthread_dependencies
|
||||
|
||||
# To add support for the ESP32-C6 in TZ-302
|
||||
examples/openthread/ot_sleepy_device:
|
||||
examples/openthread/ot_sleepy_device/deep_sleep:
|
||||
enable:
|
||||
- if: IDF_TARGET in ["esp32h2"]
|
||||
disable_test:
|
||||
- if: IDF_TARGET == "esp32h2"
|
||||
temporary: true
|
||||
reason: Unsupport
|
||||
|
||||
examples/openthread/ot_sleepy_device/light_sleep:
|
||||
enable:
|
||||
- if: IDF_TARGET in ["esp32h2", "esp32c6"]
|
||||
<<: [*openthread_dependencies, *openthread_sleep_dependencies]
|
||||
|
@@ -1,6 +1,5 @@
|
||||
| Supported Targets | ESP32-H2 |
|
||||
| ----------------- | -------- |
|
||||
|
||||
| Supported Targets | ESP32-C6 | ESP32-H2 |
|
||||
| ----------------- | -------- | -------- |
|
||||
# OpenThread Sleepy Device Example
|
||||
|
||||
The example demonstrates the Thread Sleepy End Device (SED), the device will enter [Light Sleep mode](https://docs.espressif.com/projects/esp-idf/en/latest/esp32h2/api-reference/system/sleep_modes.html#sleep-modes) during idle state.
|
||||
|
@@ -3,4 +3,4 @@ CONFIG_IDF_TARGET_ESP32C6=y
|
||||
CONFIG_OPENTHREAD_NETWORK_CHANNEL=12
|
||||
CONFIG_OPENTHREAD_NETWORK_MASTERKEY="aabbccddeeff00112233445566778899"
|
||||
CONFIG_ESP_SLEEP_DEBUG=y
|
||||
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
|
||||
CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y
|
||||
|
@@ -0,0 +1,7 @@
|
||||
CONFIG_IDF_TARGET="esp32c6"
|
||||
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_PHY_MAC_BB_PD=y
|
||||
# end of Sleep Config
|
@@ -0,0 +1 @@
|
||||
CONFIG_IDF_TARGET="esp32h2"
|
@@ -558,6 +558,10 @@ def test_TCP_NAT64(Init_interface:bool, dut: Tuple[IdfDut, IdfDut, IdfDut]) -> N
|
||||
@pytest.mark.openthread_sleep
|
||||
@pytest.mark.parametrize(
|
||||
'config, count, app_path, target', [
|
||||
('cli_h2|sleepy_c6', 2,
|
||||
f'{os.path.join(os.path.dirname(__file__), "ot_cli")}'
|
||||
f'|{os.path.join(os.path.dirname(__file__), "ot_sleepy_device")}',
|
||||
'esp32h2|esp32c6'),
|
||||
('cli_c6|sleepy_h2', 2,
|
||||
f'{os.path.join(os.path.dirname(__file__), "ot_cli")}'
|
||||
f'|{os.path.join(os.path.dirname(__file__), "ot_sleepy_device")}',
|
||||
|
Reference in New Issue
Block a user