gr5405_pwr.h
Go to the documentation of this file.
1 /**
2 *****************************************************************************************
3 *
4 * @file gr5405_pwr.h
5 *
6 * @brief GR5405 Platform Power Manager Module API
7 *
8 *****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup SYSTEM
40 * @{
41 */
42
43 /**
44 * @addtogroup PWR Power Manager
45 * @{
46 * @brief Definitions and prototypes for the Power Manager interface.
47 */
48
49
50 #ifndef __GR5405_PWR_H_
51 #define __GR5405_PWR_H_
52
53 #include <stdint.h>
54 #include <stdbool.h>
55 #include <stdio.h>
56
57 #include "system_gr5405.h"
58
59 /**
60 * @defgroup GR5405_PWR_TYPEDEF Typedefs
61 * @{
62 */
63
64 /**@brief PMU error code. */
65 #define PMR_MGMT_SUCCESS 0x0
66 #define PMR_MGMT_FAIL 0xFF
67 #define PWR_MGMT_BB_CHECK_FAIL 0xFE
68 #define PWR_MGMT_MODE_CHECK_FAIL 0xFD
69
70
71 /**@brief power manager setting parameter.
72 * Use pwr_mgmt_var_set to transfer the parameters in the structure to PMU,
73 * and then the pwr_mgmt_mode_set function will use the new parameters for
74 * power management.
75 * Note that this is an advanced API, the wrong setting of parameters may
76 * lead to abnormal power management, so please use it carefully.
77 */
78 typedef struct
79 {
80 uint32_t pwr_mgmt_app_timer_thrd; /**< App timer threshold. */
81 uint32_t pwr_mgmt_ble_core_thrd; /**< BLE timer threshold. */
82 uint32_t pwr_mgmt_rtc_timer_thrd; /**< RTC timer threshold. */
83 uint32_t pwr_mgmt_wdt_timer_thrd; /**< AON WDT threshold. */
84 } pwr_mgmt_var_box_t;
85
86 /**@brief power manager boot type. */
87 typedef enum
88 {
89 COLD_BOOT = 0, /**< Cold boot state. */
90 WARM_BOOT, /**< Warm boot state. */
91 } boot_mode_t;
92
93 /**@brief power manager model. */
94 typedef enum
95 {
96 PMR_MGMT_ACTIVE_MODE = 0x0, /**< Full speed state. */
97 PMR_MGMT_IDLE_MODE, /**< Idle state. */
98 PMR_MGMT_SLEEP_MODE, /**< Deep sleep state. */
99 } pwr_mgmt_mode_t;
100
101 /// Definition of the bits preventing the system from sleeping
102 enum app_prevent_sleep
103 {
104 /// Flag indicating that the wake up process is ongoing
105 PMR_WAKE_UP_ONGOING = 0x0001,
106 /// Flag indicating that an TX transfer is ongoing on Transport Layer
107 PMR_TL_TX_ONGOING = 0x0002,
108 /// Flag indicating that an RX transfer is ongoing on Transport Layer
109 PMR_TL_RX_ONGOING = 0x0004,
110 /// Flag indicating the IP is in sleep, to avoid running sleep algorithm while already entering sleep
111 PMR_DEEP_SLEEP = 0x0008,
112 /// Flag indicating that an encryption is ongoing
113 PMR_CRYPT_ONGOING = 0x0010,
114 /// Flag indicating that controller shall not sleep due to not CSB LPO_Allowed
115 PMR_CSB_NOT_LPO_ALLOWED = 0x0040,
116 /// Flag indicating the MWS/WLAN Event Generator is in operation
117 PMR_MWS_WLAN_EVENT_GENERATOR_ACTIVE = 0x0080,
118 /// Flag to indicate that platform does not support deep sleep
119 PMR_PLF_DEEP_SLEEP_DISABLED = 0x0100,
120 /// Flag to indicate that a baseband frame is ongoing
121 PMR_BB_FRAME_ONGOING = 0x0200,
122 /// Flag to indicate that BLE Hopping computation on-going
123 PMR_HOP_CALC_ONGOING = 0x0400,
124 /// Flag to indicate that BT is in active mode (ACL, SCO)
125 PMR_BT_ACTIVE_MODE = 0x0800,
126 /// Flag to indicate that BLE requires active mode
127 PMR_BLE_ACTIVE_MODE = 0x1000,
128 };
129
130 /**@brief power manager device work state. */
131 typedef enum
132 {
133 DEVICE_BUSY = 0x0, /**< Device busy state. */
134 DEVICE_IDLE, /**< Device idle state. */
135 } pwr_mgmt_dev_state_t;
136
137 /**@brief power manager app timer work state. */
138 typedef enum
139 {
140 EVENT_APP_TIMER_START = 0, /**< App-timer start state. */
141 EVENT_APP_TIMER_STOP, /**< App-timer stop state. */
142 } notify_timer_event_t;
143
144 /**@brief PMU Tracking*/
145 enum
146 {
147 TRC_PWR_WFE_MODE = 0, /**< WFE mode. */
148 TRC_PWR_DSLEEP_MODE, /**< Deep sleep mode. */
149 TRC_PWR_ACTIVE_MODE, /**< Active mode. */
150 TRC_PWR_BLE_RET_DSLEEP, /**< BLE return deep sleep. */
151 TRC_PWR_APP_TIMER_REFUSE, /**< App timer refuse. */
152 TRC_PWR_APP_TIMER_PASS, /**< App timer pass. */
153 TRC_PWR_BLE_TIMER_REFUSE, /**< BLE timer refuse. */
154 TRC_PWR_BLE_TIMER_PASS, /**< BLE timer pass. */
155 TRC_PWR_RTC_TIMER_REFUSE, /**< RTC timer refuse. */
156 TRC_PWR_RTC_TIMER_PASS, /**< RTC timer pass. */
157 TRC_PWR_RTC1_TIMER_REFUSE, /**< RTC timer refuse. */
158 TRC_PWR_RTC1_TIMER_PASS, /**< RTC timer pass. */
159 TRC_PWR_WDT_TIMER_REFUSE, /**< AON WDT timer refuse. */
160 TRC_PWR_WDT_TIMER_PASS, /**< AON WDT timer pass. */
161 };
162
163 /**@brief parameter configuration table. */
164 typedef struct
165 {
166 uint16_t pwr_dur; /**< Duration. */
167 uint16_t pwr_ext; /**< External wake-up. */
168 uint16_t pwr_osc; /**< OSC. */
169 uint8_t pwr_delay_hslot; /**< Delay half slot. */
170 uint16_t pwr_delay_hus; /**< Delay half us. */
171 uint16_t pwr_push_hus; /**< Push half us. */
172 } pwr_table_t;
173
174 /**@brief Trace function type. */
175 typedef void (*trace_func_t)(uint8_t);
176
177 /**@brief Peripheral function type. */
178 typedef void (*periph_func_t)(void);
179
180 /**@brief Before sleep function type. */
181 typedef void (*pwr_before_sleep_func_t)(void);
182
183 /**@brief Device check function type. */
184 typedef pwr_mgmt_dev_state_t (*pwr_dev_check_func_t)(void);
185
186 /**@brief mem check process type. */
187 typedef void (*mem_check_proc_t)(void);
188
189 /**@brief SRPG before function type. */
190 typedef uint8_t (*srpg_before_func_t)(void);
191
192 /**@brief pwr table. */
193 extern pwr_table_t pwr_table[];
194
195 /** @} */
196
197 /** @addtogroup GR5405_PWR_FUNCTIONS Functions
198 * @{ */
199 /**
200 *****************************************************************************************
201 * @brief This function allows ARM to enter deep sleep mode, but users should not use this
202 * function directly.
203 * Note that this function is only available in environments where non-RTOS is used,
204 * and that users can only execute it while in main.c.
205 * @retval : pwr_mgmt_mode_t
206 *****************************************************************************************
207 */
208 pwr_mgmt_mode_t pwr_mgmt_shutdown(void);
209
210 /**
211 ****************************************************************************************
212 * @brief Get the current boot mode.
213 * @retval : cold boot or warm boot.
214 ****************************************************************************************
215 */
216 boot_mode_t pwr_mgmt_get_wakeup_flag(void);
217
218 /**
219 ****************************************************************************************
220 * @brief Mark the mode of next boot, cold boot or warm boot.
221 * @param[in] boot_mode : cold boot or warm boot.
222 * @retval : void
223 ****************************************************************************************
224 */
225 void pwr_mgmt_set_wakeup_flag(boot_mode_t boot_mode);
226
227 /**
228 ****************************************************************************************
229 * @brief Set the specified sleep mode. When the setting is completed, the system will
230 * automatically enter the specified sleep mode through the strategy.
231 * @param[in] pm_mode : sleep level
232 * @retval : void
233 ****************************************************************************************
234 */
235 void pwr_mgmt_mode_set(pwr_mgmt_mode_t pm_mode);
236
237 /**
238 ****************************************************************************************
239 * @brief Get the specified sleep mode.
240 * @retval : pwr_mgmt_mode_t
241 ****************************************************************************************
242 */
243 pwr_mgmt_mode_t pwr_mgmt_mode_get(void);
244
245 /**
246 ****************************************************************************************
247 * @brief Get the power state of baseband.
248 * @retval : pwr_mgmt_mode_t
249 ****************************************************************************************
250 */
251 pwr_mgmt_mode_t pwr_mgmt_baseband_state_get(void);
252
253 /**
254 ****************************************************************************************
255 * @brief Sleep Policy Scheduling Function.
256 * Note that this function is only available in environments where non-RTOS is used,
257 and that users can only execute it while in main.c.
258 * @retval : void
259 ****************************************************************************************
260 */
261 void pwr_mgmt_schedule(void);
262
263 /**
264 ****************************************************************************************
265 * @brief Wake the BLE core via an external request.
266 * @retval : void
267 *
268 ****************************************************************************************
269 */
270 void pwr_mgmt_ble_wakeup(void);
271
272 /**
273 ****************************************************************************************
274 * @brief Check whether there are ble events in the queue, and if so, handle them immediately.
275 * @retval : void
276 ****************************************************************************************
277 */
278 void pwr_mgmt_check_ble_event(void);
279
280 /**
281 ****************************************************************************************
282 * @brief Execution of this function allows ARM to enter the WFE state and exit the WFE
283 * state when an event or interrupt occurs.
284 * @retval : void
285 ****************************************************************************************
286 */
287 void pwr_mgmt_wfe_sleep(void);
288
289 /**
290 ****************************************************************************************
291 * @brief Execution of this function allows ARM to enter the ultra sleep state and wakeup
292 * the chip when an event occurs.
293 * @param time_ms : Specifies the wake-up time during ultra sleep. If time_ms is equal to 0,
294 then sleep timer will not be enabled.
295 This parameter must be a number between min_value = 0 and max_value =
296 131071999. If time_ms bigger than 131071999, then 131071999 will be used.
297 * @retval : void
298 ****************************************************************************************
299 */
300 void pwr_mgmt_ultra_sleep(uint32_t time_ms);
301
302 /**
303 ****************************************************************************************
304 * @brief PMU Initialization Function.
305 * @param p_pwr_table : PMU parameter configuration table.
306 * @param sys_clk : the clock of system
307 * @return void
308 ****************************************************************************************
309 */
310 void pwr_mgmt_init( pwr_table_t *p_pwr_table, mcu_clock_type_t sys_clk);
311
312 /**
313 ****************************************************************************************
314 * @brief Peripheral Controller Initialization Register interface.
315 * @param p_periph_init : the pointer of device init function.
316 * @return void
317 ****************************************************************************************
318 */
319 void pwr_mgmt_dev_init(periph_func_t p_periph_init);
320
321 /**
322 ****************************************************************************************
323 * @brief Device config resume interface.
324 * @return void
325 ****************************************************************************************
326 */
327 void pwr_mgmt_dev_resume(void);
328
329 /**
330 ****************************************************************************************
331 * @brief Device config suspend interface.
332 * @return void
333 ****************************************************************************************
334 */
335 pwr_mgmt_dev_state_t pwr_mgmt_dev_suspend(void);
336
337 /**
338 ****************************************************************************************
339 * @brief Mem state control under deep sleep & work state.
340 * @param mem_sleep_state : control in deep sleep.
341 * @param mem_work_state : control in work state.
342 * @return void
343 ****************************************************************************************
344 */
345 void pwr_mgmt_mem_ctl_set(uint32_t mem_sleep_state, uint32_t mem_work_state);
346
347
348 /**
349 ****************************************************************************************
350 * @brief Set PMU callback function.
351 * @param dev_check_fun : Device check callback function.
352 * @param before_sleep_fun : Pre-execution callback function for deep sleep.
353 * @return void
354 ****************************************************************************************
355 */
356 void pwr_mgmt_set_callback(pwr_dev_check_func_t dev_check_fun, pwr_before_sleep_func_t before_sleep_fun);
357
358
359 /**
360 ****************************************************************************************
361 * @brief Save context function.
362 * @retval : void
363 ****************************************************************************************
364 */
365 void pwr_mgmt_save_context(void);
366
367 /**
368 ****************************************************************************************
369 * @brief Load context function.
370 * @retval : void
371 ****************************************************************************************
372 */
373 void pwr_mgmt_load_context(void);
374
375 /**
376 ****************************************************************************************
377 * @brief shutdown power in rtos mode
378 * @retval ::PMR_MGMT_SUCCESS: wakeup from shutdown mode.
379 * @retval ::PMR_MGMT_FAIL: some condition refuse system enter shutdown mode.
380 ****************************************************************************************
381 */
382 uint8_t pwr_mgmt_sleep(void);
383
384 /**
385 ****************************************************************************************
386 * @brief Trace function register.
387 * @param[in] status_trace_func: Trace function.
388 * @param[in] sched_trace_func: Trace function.
389 * @retval : void
390 ****************************************************************************************
391 */
392 void pwr_mgmt_register_trace_func(trace_func_t status_trace_func, trace_func_t sched_trace_func);
393
394 /** @} */
395
396 #endif
397 /** @} */
398 /** @} */
notify_timer_event_t
notify_timer_event_t
power manager app timer work state.
Definition: gr5405_pwr.h:139
pwr_before_sleep_func_t
void(* pwr_before_sleep_func_t)(void)
Before sleep function type.
Definition: gr5405_pwr.h:181
boot_mode_t
boot_mode_t
power manager boot type.
Definition: gr5405_pwr.h:88
pwr_table_t::pwr_osc
uint16_t pwr_osc
Definition: gr5405_pwr.h:168
srpg_before_func_t
uint8_t(* srpg_before_func_t)(void)
SRPG before function type.
Definition: gr5405_pwr.h:190
pwr_mgmt_baseband_state_get
pwr_mgmt_mode_t pwr_mgmt_baseband_state_get(void)
Get the power state of baseband.
pwr_mgmt_init
void pwr_mgmt_init(pwr_table_t *p_pwr_table, mcu_clock_type_t sys_clk)
PMU Initialization Function.
EVENT_APP_TIMER_STOP
@ EVENT_APP_TIMER_STOP
Definition: gr5405_pwr.h:141
TRC_PWR_WFE_MODE
@ TRC_PWR_WFE_MODE
Definition: gr5405_pwr.h:147
pwr_dev_check_func_t
pwr_mgmt_dev_state_t(* pwr_dev_check_func_t)(void)
Device check function type.
Definition: gr5405_pwr.h:184
TRC_PWR_RTC_TIMER_PASS
@ TRC_PWR_RTC_TIMER_PASS
Definition: gr5405_pwr.h:156
pwr_mgmt_dev_init
void pwr_mgmt_dev_init(periph_func_t p_periph_init)
Peripheral Controller Initialization Register interface.
PMR_MGMT_IDLE_MODE
@ PMR_MGMT_IDLE_MODE
Definition: gr5405_pwr.h:97
COLD_BOOT
@ COLD_BOOT
Definition: gr5405_pwr.h:89
TRC_PWR_WDT_TIMER_REFUSE
@ TRC_PWR_WDT_TIMER_REFUSE
Definition: gr5405_pwr.h:159
pwr_mgmt_mem_ctl_set
void pwr_mgmt_mem_ctl_set(uint32_t mem_sleep_state, uint32_t mem_work_state)
Mem state control under deep sleep & work state.
TRC_PWR_APP_TIMER_PASS
@ TRC_PWR_APP_TIMER_PASS
Definition: gr5405_pwr.h:152
TRC_PWR_ACTIVE_MODE
@ TRC_PWR_ACTIVE_MODE
Definition: gr5405_pwr.h:149
TRC_PWR_BLE_TIMER_PASS
@ TRC_PWR_BLE_TIMER_PASS
Definition: gr5405_pwr.h:154
pwr_table_t::pwr_ext
uint16_t pwr_ext
Definition: gr5405_pwr.h:167
TRC_PWR_RTC_TIMER_REFUSE
@ TRC_PWR_RTC_TIMER_REFUSE
Definition: gr5405_pwr.h:155
periph_func_t
void(* periph_func_t)(void)
Peripheral function type.
Definition: gr5405_pwr.h:178
pwr_mgmt_var_box_t
power manager setting parameter. Use pwr_mgmt_var_set to transfer the parameters in the structure to ...
Definition: gr5405_pwr.h:79
app_prevent_sleep
app_prevent_sleep
Definition of the bits preventing the system from sleeping.
Definition: gr5405_pwr.h:103
PMR_MGMT_SLEEP_MODE
@ PMR_MGMT_SLEEP_MODE
Definition: gr5405_pwr.h:98
pwr_table_t
parameter configuration table.
Definition: gr5405_pwr.h:165
pwr_mgmt_mode_get
pwr_mgmt_mode_t pwr_mgmt_mode_get(void)
Get the specified sleep mode.
pwr_table_t::pwr_delay_hus
uint16_t pwr_delay_hus
Definition: gr5405_pwr.h:170
pwr_mgmt_ble_wakeup
void pwr_mgmt_ble_wakeup(void)
Wake the BLE core via an external request.
pwr_table_t::pwr_delay_hslot
uint8_t pwr_delay_hslot
Definition: gr5405_pwr.h:169
pwr_mgmt_schedule
void pwr_mgmt_schedule(void)
Sleep Policy Scheduling Function. Note that this function is only available in environments where non...
pwr_mgmt_mode_set
void pwr_mgmt_mode_set(pwr_mgmt_mode_t pm_mode)
Set the specified sleep mode. When the setting is completed, the system will automatically enter the ...
trace_func_t
void(* trace_func_t)(uint8_t)
Trace function type.
Definition: gr5405_pwr.h:175
pwr_mgmt_set_wakeup_flag
void pwr_mgmt_set_wakeup_flag(boot_mode_t boot_mode)
Mark the mode of next boot, cold boot or warm boot.
pwr_mgmt_dev_resume
void pwr_mgmt_dev_resume(void)
Device config resume interface.
pwr_mgmt_save_context
void pwr_mgmt_save_context(void)
Save context function.
pwr_mgmt_var_box_t::pwr_mgmt_wdt_timer_thrd
uint32_t pwr_mgmt_wdt_timer_thrd
Definition: gr5405_pwr.h:83
PMR_BB_FRAME_ONGOING
@ PMR_BB_FRAME_ONGOING
Flag to indicate that a baseband frame is ongoing.
Definition: gr5405_pwr.h:121
pwr_mgmt_var_box_t::pwr_mgmt_rtc_timer_thrd
uint32_t pwr_mgmt_rtc_timer_thrd
Definition: gr5405_pwr.h:82
mem_check_proc_t
void(* mem_check_proc_t)(void)
mem check process type.
Definition: gr5405_pwr.h:187
PMR_BLE_ACTIVE_MODE
@ PMR_BLE_ACTIVE_MODE
Flag to indicate that BLE requires active mode.
Definition: gr5405_pwr.h:127
PMR_PLF_DEEP_SLEEP_DISABLED
@ PMR_PLF_DEEP_SLEEP_DISABLED
Flag to indicate that platform does not support deep sleep.
Definition: gr5405_pwr.h:119
pwr_mgmt_wfe_sleep
void pwr_mgmt_wfe_sleep(void)
Execution of this function allows ARM to enter the WFE state and exit the WFE state when an event or ...
PMR_CSB_NOT_LPO_ALLOWED
@ PMR_CSB_NOT_LPO_ALLOWED
Flag indicating that controller shall not sleep due to not CSB LPO_Allowed.
Definition: gr5405_pwr.h:115
TRC_PWR_DSLEEP_MODE
@ TRC_PWR_DSLEEP_MODE
Definition: gr5405_pwr.h:148
pwr_table
pwr_table_t pwr_table[]
pwr table.
PMR_HOP_CALC_ONGOING
@ PMR_HOP_CALC_ONGOING
Flag to indicate that BLE Hopping computation on-going.
Definition: gr5405_pwr.h:123
EVENT_APP_TIMER_START
@ EVENT_APP_TIMER_START
Definition: gr5405_pwr.h:140
pwr_mgmt_ultra_sleep
void pwr_mgmt_ultra_sleep(uint32_t time_ms)
Execution of this function allows ARM to enter the ultra sleep state and wakeup the chip when an even...
pwr_mgmt_load_context
void pwr_mgmt_load_context(void)
Load context function.
TRC_PWR_RTC1_TIMER_REFUSE
@ TRC_PWR_RTC1_TIMER_REFUSE
Definition: gr5405_pwr.h:157
WARM_BOOT
@ WARM_BOOT
Definition: gr5405_pwr.h:90
DEVICE_IDLE
@ DEVICE_IDLE
Definition: gr5405_pwr.h:134
pwr_mgmt_var_box_t::pwr_mgmt_ble_core_thrd
uint32_t pwr_mgmt_ble_core_thrd
Definition: gr5405_pwr.h:81
pwr_mgmt_sleep
uint8_t pwr_mgmt_sleep(void)
shutdown power in rtos mode
pwr_table_t::pwr_push_hus
uint16_t pwr_push_hus
Definition: gr5405_pwr.h:171
PMR_MGMT_ACTIVE_MODE
@ PMR_MGMT_ACTIVE_MODE
Definition: gr5405_pwr.h:96
pwr_mgmt_var_box_t::pwr_mgmt_app_timer_thrd
uint32_t pwr_mgmt_app_timer_thrd
Definition: gr5405_pwr.h:80
TRC_PWR_BLE_TIMER_REFUSE
@ TRC_PWR_BLE_TIMER_REFUSE
Definition: gr5405_pwr.h:153
PMR_MWS_WLAN_EVENT_GENERATOR_ACTIVE
@ PMR_MWS_WLAN_EVENT_GENERATOR_ACTIVE
Flag indicating the MWS/WLAN Event Generator is in operation.
Definition: gr5405_pwr.h:117
pwr_mgmt_get_wakeup_flag
boot_mode_t pwr_mgmt_get_wakeup_flag(void)
Get the current boot mode.
PMR_TL_TX_ONGOING
@ PMR_TL_TX_ONGOING
Flag indicating that an TX transfer is ongoing on Transport Layer.
Definition: gr5405_pwr.h:107
TRC_PWR_BLE_RET_DSLEEP
@ TRC_PWR_BLE_RET_DSLEEP
Definition: gr5405_pwr.h:150
pwr_mgmt_dev_suspend
pwr_mgmt_dev_state_t pwr_mgmt_dev_suspend(void)
Device config suspend interface.
pwr_mgmt_shutdown
pwr_mgmt_mode_t pwr_mgmt_shutdown(void)
This function allows ARM to enter deep sleep mode, but users should not use this function directly....
DEVICE_BUSY
@ DEVICE_BUSY
Definition: gr5405_pwr.h:133
PMR_DEEP_SLEEP
@ PMR_DEEP_SLEEP
Flag indicating the IP is in sleep, to avoid running sleep algorithm while already entering sleep.
Definition: gr5405_pwr.h:111
TRC_PWR_APP_TIMER_REFUSE
@ TRC_PWR_APP_TIMER_REFUSE
Definition: gr5405_pwr.h:151
pwr_mgmt_set_callback
void pwr_mgmt_set_callback(pwr_dev_check_func_t dev_check_fun, pwr_before_sleep_func_t before_sleep_fun)
Set PMU callback function.
pwr_mgmt_check_ble_event
void pwr_mgmt_check_ble_event(void)
Check whether there are ble events in the queue, and if so, handle them immediately.
pwr_table_t::pwr_dur
uint16_t pwr_dur
Definition: gr5405_pwr.h:166
pwr_mgmt_dev_state_t
pwr_mgmt_dev_state_t
power manager device work state.
Definition: gr5405_pwr.h:132
TRC_PWR_RTC1_TIMER_PASS
@ TRC_PWR_RTC1_TIMER_PASS
Definition: gr5405_pwr.h:158
pwr_mgmt_register_trace_func
void pwr_mgmt_register_trace_func(trace_func_t status_trace_func, trace_func_t sched_trace_func)
Trace function register.
pwr_mgmt_mode_t
pwr_mgmt_mode_t
power manager model.
Definition: gr5405_pwr.h:95
PMR_TL_RX_ONGOING
@ PMR_TL_RX_ONGOING
Flag indicating that an RX transfer is ongoing on Transport Layer.
Definition: gr5405_pwr.h:109
PMR_CRYPT_ONGOING
@ PMR_CRYPT_ONGOING
Flag indicating that an encryption is ongoing.
Definition: gr5405_pwr.h:113
PMR_BT_ACTIVE_MODE
@ PMR_BT_ACTIVE_MODE
Flag to indicate that BT is in active mode (ACL, SCO)
Definition: gr5405_pwr.h:125
TRC_PWR_WDT_TIMER_PASS
@ TRC_PWR_WDT_TIMER_PASS
Definition: gr5405_pwr.h:160
PMR_WAKE_UP_ONGOING
@ PMR_WAKE_UP_ONGOING
Flag indicating that the wake up process is ongoing.
Definition: gr5405_pwr.h:105