@@ -17,15 +17,14 @@ extern "C" {
17
17
18
18
extern unsigned char sys_pm_idle_exit_notify ;
19
19
20
-
21
20
/**
22
21
* @defgroup power_management_api Power Management
23
22
* @{
24
23
* @}
25
24
*/
26
25
27
26
/**
28
- * @brief Power Management states.
27
+ * @brief System power states.
29
28
*/
30
29
enum power_states {
31
30
SYS_POWER_STATE_AUTO = (-2 ),
@@ -56,6 +55,14 @@ enum power_states {
56
55
SYS_POWER_STATE_MAX
57
56
};
58
57
58
+ /**
59
+ * @brief System Power Management API
60
+ *
61
+ * @defgroup system_power_management_api System Power Management API
62
+ * @ingroup power_management_api
63
+ * @{
64
+ */
65
+
59
66
/**
60
67
* @brief Check if particular power state is a low power state.
61
68
*
@@ -114,18 +121,10 @@ static inline bool sys_pm_is_deep_sleep_state(enum power_states state)
114
121
}
115
122
}
116
123
117
- /**
118
- * @brief Power Management Hooks
119
- *
120
- * @defgroup power_management_hook_interface Power Management Hooks
121
- * @ingroup power_management_api
122
- * @{
123
- */
124
-
125
124
/**
126
125
* @brief Function to disable power management idle exit notification
127
126
*
128
- * sys_resume() would be called from the ISR of the event that caused
127
+ * The sys_resume() would be called from the ISR of the event that caused
129
128
* exit from kernel idling after PM operations. For some power operations,
130
129
* this notification may not be necessary. This function can be called in
131
130
* sys_suspend to disable the corresponding sys_resume notification.
@@ -136,6 +135,79 @@ static inline void sys_pm_idle_exit_notification_disable(void)
136
135
sys_pm_idle_exit_notify = 0 ;
137
136
}
138
137
138
+ /**
139
+ * @brief Force usage of given power state.
140
+ *
141
+ * This function overrides decision made by PM policy
142
+ * forcing usage of given power state in all subseqent
143
+ * suspend operations. Forcing the SYS_POWER_STATE_AUTO
144
+ * state restores normal operation.
145
+ *
146
+ * @param state Power state which should be used in all
147
+ * subsequent suspend operations or
148
+ * SYS_POWER_STATE_AUTO.
149
+ */
150
+ extern void sys_pm_force_power_state (enum power_states state );
151
+
152
+ #ifdef CONFIG_PM_CONTROL_OS_DEBUG
153
+ /**
154
+ * @brief Dump Low Power states related debug info
155
+ *
156
+ * Dump Low Power states debug info like LPS entry count and residencies.
157
+ */
158
+ extern void sys_pm_dump_debug_info (void );
159
+
160
+ #endif /* CONFIG_PM_CONTROL_OS_DEBUG */
161
+
162
+ #ifdef CONFIG_PM_CONTROL_STATE_LOCK
163
+ /**
164
+ * @brief Disable particular power state
165
+ *
166
+ * @details Disabled state cannot be selected by the Zephyr power
167
+ * management policies. Application defined policy should
168
+ * use the @ref sys_pm_ctrl_is_state_enabled function to
169
+ * check if given state could is enabled and could be used.
170
+ *
171
+ * @param [in] state Power state to be disabled.
172
+ */
173
+ extern void sys_pm_ctrl_disable_state (enum power_states state );
174
+
175
+ /**
176
+ * @brief Enable particular power state
177
+ *
178
+ * @details Enabled state can be selected by the Zephyr power
179
+ * management policies. Application defined policy should
180
+ * use the @ref sys_pm_ctrl_is_state_enabled function to
181
+ * check if given state could is enabled and could be used.
182
+ * By default all power states are enabled.
183
+ *
184
+ * @param [in] state Power state to be enabled.
185
+ */
186
+ extern void sys_pm_ctrl_enable_state (enum power_states state );
187
+
188
+ /**
189
+ * @brief Check if particular power state is enabled
190
+ *
191
+ * This function returns true if given power state is enabled.
192
+ *
193
+ * @param [in] state Power state.
194
+ */
195
+ extern bool sys_pm_ctrl_is_state_enabled (enum power_states state );
196
+
197
+ #endif /* CONFIG_PM_CONTROL_STATE_LOCK */
198
+
199
+ /**
200
+ * @}
201
+ */
202
+
203
+ /**
204
+ * @brief Power Management Hooks
205
+ *
206
+ * @defgroup power_management_hook_interface Power Management Hooks
207
+ * @ingroup power_management_api
208
+ * @{
209
+ */
210
+
139
211
/**
140
212
* @brief Hook function to notify exit from deep sleep
141
213
*
@@ -201,69 +273,6 @@ void sys_resume(void);
201
273
*/
202
274
extern enum power_states sys_suspend (s32_t ticks );
203
275
204
- /**
205
- * @brief Force usage of given power state.
206
- *
207
- * This function overrides decision made by PM policy
208
- * forcing usage of given power state in all subseqent
209
- * suspend operations.
210
- *
211
- * Forcing the SYS_POWER_STATE_AUTO power state restores
212
- * normal operation.
213
- *
214
- * @param state Power state which should be used in all
215
- * subsequent suspend operations or
216
- * SYS_POWER_STATE_AUTO.
217
- */
218
- extern void sys_pm_force_power_state (enum power_states state );
219
-
220
- #ifdef CONFIG_PM_CONTROL_OS_DEBUG
221
- /**
222
- * @brief Dump Low Power states related debug info
223
- *
224
- * Dump Low Power states debug info like LPS entry count and residencies.
225
- */
226
- extern void sys_pm_dump_debug_info (void );
227
-
228
- #endif /* CONFIG_PM_CONTROL_OS_DEBUG */
229
-
230
- #ifdef CONFIG_PM_CONTROL_STATE_LOCK
231
- /**
232
- * @brief Disable particular power state
233
- *
234
- * @details Disabled state cannot be selected by the Zephyr power
235
- * management policies. Application defined policy should
236
- * use the @ref sys_pm_ctrl_is_state_enabled function to
237
- * check if given state could is enabled and could be used.
238
- *
239
- * @param [in] state Power state to be disabled.
240
- */
241
- extern void sys_pm_ctrl_disable_state (enum power_states state );
242
-
243
- /**
244
- * @brief Enable particular power state
245
- *
246
- * @details Enabled state can be selected by the Zephyr power
247
- * management policies. Application defined policy should
248
- * use the @ref sys_pm_ctrl_is_state_enabled function to
249
- * check if given state could is enabled and could be used.
250
- * By default all power states are enabled.
251
- *
252
- * @param [in] state Power state to be enabled.
253
- */
254
- extern void sys_pm_ctrl_enable_state (enum power_states state );
255
-
256
- /**
257
- * @brief Check if particular power state is enabled
258
- *
259
- * This function returns true if given power state is enabled.
260
- *
261
- * @param [in] state Power state.
262
- */
263
- extern bool sys_pm_ctrl_is_state_enabled (enum power_states state );
264
-
265
- #endif /* CONFIG_PM_CONTROL_STATE_LOCK */
266
-
267
276
/**
268
277
* @}
269
278
*/
0 commit comments