1
6
7
8
9
15
16
17
18
19
20
21
22
23
24
25
28
35
36
42
43
44
49
50
51
55
56
57
60
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
85
86
87
91
92
93
97
98
99
100
101
102
103
104
105
106
107
108
109
112
113
114
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
154
155
156
157
/* ... */
#pragma once
/* ... */
#include "soc/rtc.h"
#include "esp_pm.h"
#include "esp_timer.h"
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ... */
typedef enum {
PM_MODE_LIGHT_SLEEP,
PM_MODE_APB_MIN,
PM_MODE_APB_MAX,
PM_MODE_CPU_MAX,
PM_MODE_COUNT
}{ ... } pm_mode_t;
/* ... */
pm_mode_t esp_pm_impl_get_mode(esp_pm_lock_type_t type, int arg);
/* ... */
int esp_pm_impl_get_cpu_freq(pm_mode_t mode);
/* ... */
typedef int64_t pm_time_t;
/* ... */
typedef enum {
MODE_LOCK,
MODE_UNLOCK
}{ ... } pm_mode_switch_t;
/* ... */
void esp_pm_impl_switch_mode(pm_mode_t mode, pm_mode_switch_t lock_or_unlock, pm_time_t now);
/* ... */
void esp_pm_impl_init(void);
/* ... */
void esp_pm_impl_idle_hook(void);
/* ... */
void esp_pm_impl_isr_hook(void);
/* ... */
void esp_pm_impl_dump_stats(FILE* out);
/* ... */
void esp_pm_impl_waiti(void);
/* ... */
typedef bool (* skip_light_sleep_cb_t)(void);
/* ... */
esp_err_t esp_pm_register_skip_light_sleep_callback(skip_light_sleep_cb_t cb);
/* ... */
esp_err_t esp_pm_unregister_skip_light_sleep_callback(skip_light_sleep_cb_t cb);
#ifdef CONFIG_PM_PROFILING
#define WITH_PROFILING
#endif
#ifdef WITH_PROFILING
static inline pm_time_t IRAM_ATTR pm_get_time(void)
{
return esp_timer_get_time();
}{...}
/* ... */#endif
#ifdef __cplusplus
}{...}
#endif