1
6
7
8
9
10
11
12
13
14
15
16
17
22
27
28
32
33
34
35
36
37
38
39
42
60
61
70
71
72
79
80
81
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
217
218
219
222
223
224
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
253
254
255
256
257
258
/* ... */
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "esp_err.h"
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ... */
typedef struct {
int max_freq_mhz;
int min_freq_mhz;
bool light_sleep_enable;
}{ ... } esp_pm_config_t;
/* ... */
typedef esp_pm_config_t esp_pm_config_esp32_t __attribute__((deprecated("please use esp_pm_config_t instead")));
typedef esp_pm_config_t esp_pm_config_esp32s2_t __attribute__((deprecated("please use esp_pm_config_t instead")));
typedef esp_pm_config_t esp_pm_config_esp32s3_t __attribute__((deprecated("please use esp_pm_config_t instead")));
typedef esp_pm_config_t esp_pm_config_esp32c3_t __attribute__((deprecated("please use esp_pm_config_t instead")));
typedef esp_pm_config_t esp_pm_config_esp32c2_t __attribute__((deprecated("please use esp_pm_config_t instead")));
typedef esp_pm_config_t esp_pm_config_esp32c6_t __attribute__((deprecated("please use esp_pm_config_t instead")));
/* ... */
typedef enum {
/* ... */
ESP_PM_CPU_FREQ_MAX,
/* ... */
ESP_PM_APB_FREQ_MAX,
/* ... */
ESP_PM_NO_LIGHT_SLEEP,
ESP_PM_LOCK_MAX,
}{ ... } esp_pm_lock_type_t;
/* ... */
esp_err_t esp_pm_configure(const void* config);
/* ... */
esp_err_t esp_pm_get_configuration(void* config);
/* ... */
typedef struct esp_pm_lock* esp_pm_lock_handle_t;
/* ... */
esp_err_t esp_pm_lock_create(esp_pm_lock_type_t lock_type, int arg,
const char* name, esp_pm_lock_handle_t* out_handle);
/* ... */
esp_err_t esp_pm_lock_acquire(esp_pm_lock_handle_t handle);
/* ... */
esp_err_t esp_pm_lock_release(esp_pm_lock_handle_t handle);
/* ... */
esp_err_t esp_pm_lock_delete(esp_pm_lock_handle_t handle);
/* ... */
esp_err_t esp_pm_dump_locks(FILE* stream);
#if CONFIG_PM_LIGHT_SLEEP_CALLBACKS
/* ... */
typedef esp_err_t (*esp_pm_light_sleep_cb_t)(int64_t sleep_time_us, void *arg);
typedef struct {
/* ... */
esp_pm_light_sleep_cb_t enter_cb;
esp_pm_light_sleep_cb_t exit_cb;
/* ... */
void *enter_cb_user_arg;
void *exit_cb_user_arg;
/* ... */
uint32_t enter_cb_prior;
uint32_t exit_cb_prior;
}{...} esp_pm_sleep_cbs_register_config_t;
/* ... */
esp_err_t esp_pm_light_sleep_register_cbs(esp_pm_sleep_cbs_register_config_t *cbs_conf);
/* ... */
esp_err_t esp_pm_light_sleep_unregister_cbs(esp_pm_sleep_cbs_register_config_t *cbs_conf);/* ... */
#endif
#ifdef __cplusplus
}{...}
#endif