1 /*
2  * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 #include <stdint.h>
9 #include "sdkconfig.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /**
16  * @file sleep_retention.h
17  *
18  * This file contains declarations of memory retention related functions in light sleeo mode.
19  */
20 
21 #if SOC_PM_SUPPORT_CPU_PD
22 
23 /**
24  * @brief Whether to allow the cpu power domain to be powered off.
25  *
26  * In light sleep mode, only when the system can provide enough memory
27  * for cpu retention, the cpu power domain can be powered off.
28  */
29 bool cpu_domain_pd_allowed(void);
30 
31 #endif
32 
33 #if SOC_PM_SUPPORT_CPU_PD || SOC_PM_SUPPORT_TAGMEM_PD
34 
35 /**
36  * @brief Enable memory retention of some modules.
37  *
38  * In light sleep mode, before the system goes to sleep, enable the memory
39  * retention of modules such as CPU and I/D-cache tag memory.
40  */
41 void sleep_enable_memory_retention(void);
42 
43 /**
44  * @brief Disable memory retention of some modules.
45  *
46  * In light sleep mode, after the system exits sleep, disable the memory
47  * retention of moudles such as CPU and I/D-cache tag memory.
48  */
49 void sleep_disable_memory_retention(void);
50 
51 #endif // SOC_PM_SUPPORT_CPU_PD || SOC_PM_SUPPORT_TAGMEM_PD
52 
53 #ifdef __cplusplus
54 }
55 #endif
56