/* * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include "esp_private/sleep_clock.h" bool clock_domain_pd_allowed(void) { const uint32_t created_modules = sleep_retention_get_created_modules(); const uint32_t mask = (const uint32_t) ( SLEEP_RETENTION_MODULE_CLOCK_SYSTEM #if CONFIG_MAC_BB_PD || CONFIG_BT_LE_SLEEP_ENABLE || CONFIG_IEEE802154_SLEEP_ENABLE | SLEEP_RETENTION_MODULE_CLOCK_MODEM #endif ); return ((created_modules & mask) == mask); } #if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP || CONFIG_MAC_BB_PD || CONFIG_BT_LE_SLEEP_ENABLE || CONFIG_IEEE802154_SLEEP_ENABLE ESP_SYSTEM_INIT_FN(sleep_clock_startup_init, SECONDARY, BIT(0), 106) { #if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP sleep_clock_system_retention_init(); #endif #if CONFIG_MAC_BB_PD || CONFIG_BT_LE_SLEEP_ENABLE || CONFIG_IEEE802154_SLEEP_ENABLE sleep_clock_modem_retention_init(); #endif return ESP_OK; } #endif