gr55xx_hal_pwr.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gr55xx_hal_pwr.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of PWR HAL library.
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 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup HAL_DRIVER HAL Driver
43 * @{
44 */
45
46 /** @defgroup HAL_PWR PWR
47 * @brief PWR HAL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_PWR_H__
53 #define __GR55xx_HAL_PWR_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_ll_pwr.h"
61 #include "gr55xx_hal_def.h"
62
63 /* Exported types ------------------------------------------------------------*/
64
65 /** @addtogroup HAL_PWR_CALLBACK_STRUCTURES Callback Structures
66 * @{
67 */
68
69 /** @defgroup HAL_PWR_SLEEP_ELAPSED_HANDLER HAL PWR sleep elapsed handler define
70 * @{
71 */
72
73 /**
74 * @brief PWR Sleep Timer Elapsed callback
75 */
76
77 typedef void (*pwr_slp_elapsed_handler_t)(void);
78
79 /** @} */
80
81
82 /** @defgroup HAL_PWR_CALLBACK_HANDLER PWR callback handle
83 * @{
84 */
85
86 /**
87 * @brief PWR callback handle Structure definition
88 */
89 typedef struct _hal_pwr_handler
90 {
91 pwr_slp_elapsed_handler_t pwr_slp_elapsed_hander; /**< PWR sleep timer elapsed callback */
92 } hal_pwr_handler_t;
93
94 /** @} */
95
96 /** @} */
97
98 /**
99 * @defgroup HAL_PWR_MACRO Defines
100 * @{
101 */
102
103 /* Exported constants --------------------------------------------------------*/
104 /** @defgroup PWR_Exported_Constants PWR Exported Constants
105 * @{
106 */
107
108 /** @defgroup PWR_WakeUp_Pins PWR WakeUp Pins
109 * @{
110 */
111 #define PWR_EXTWKUP_PIN0 LL_PWR_EXTWKUP_PIN0 /**< External wakeup pin 0 */
112 #define PWR_EXTWKUP_PIN1 LL_PWR_EXTWKUP_PIN1 /**< External wakeup pin 1 */
113 #define PWR_EXTWKUP_PIN2 LL_PWR_EXTWKUP_PIN2 /**< External wakeup pin 2 */
114 #define PWR_EXTWKUP_PIN3 LL_PWR_EXTWKUP_PIN3 /**< External wakeup pin 3 */
115 #define PWR_EXTWKUP_PIN4 LL_PWR_EXTWKUP_PIN4 /**< External wakeup pin 4 */
116 #define PWR_EXTWKUP_PIN5 LL_PWR_EXTWKUP_PIN5 /**< External wakeup pin 5 */
117 #define PWR_EXTWKUP_PIN6 LL_PWR_EXTWKUP_PIN6 /**< External wakeup pin 6 */
118 #define PWR_EXTWKUP_PIN7 LL_PWR_EXTWKUP_PIN7 /**< External wakeup pin 7 */
119 #define PWR_EXTWKUP_PIN_ALL LL_PWR_EXTWKUP_PIN_ALL /**< External wakeup pin 0 ~ 7 */
120 /** @} */
121
122 /** @defgroup PWR_WakeUp_Conditions PWR Wakeup Condition
123 * @{
124 */
125 #define PWR_WKUP_COND_EXT LL_PWR_WKUP_COND_EXT /**< External wakeup: AON_GPIO */
126 #define PWR_WKUP_COND_TIMER LL_PWR_WKUP_COND_TIMER /**< AON Timer wakeup */
127 #define PWR_WKUP_COND_BLE LL_PWR_WKUP_COND_BLE /**< BLE wakeup */
128 #define PWR_WKUP_COND_CALENDAR LL_PWR_WKUP_COND_CALENDAR /**< Calendar wakeup */
129 #define PWR_WKUP_COND_BOD_FEDGE LL_PWR_WKUP_COND_BOD_FEDGE /**< PMU Bod falling edge wakeup */
130 #define PWR_WKUP_COND_MSIO_COMP LL_PWR_WKUP_COND_MSIO_COMP /**< Msio comparator wakeup */
131 #define PWR_WKUP_COND_ALL LL_PWR_WKUP_COND_ALL /**< All wakeup sources mask */
132
133 /** @} */
134
135 /** @defgroup PWR_External_WakeUp_Type PWR External Wakeup Type
136 * @{
137 */
138 #define PWR_EXTWKUP_TYPE_LOW LL_PWR_EXTWKUP_TYPE_LOW /**< Low level wakeup */
139 #define PWR_EXTWKUP_TYPE_HIGH LL_PWR_EXTWKUP_TYPE_HIGH /**< High level wakeup */
140 #define PWR_EXTWKUP_TYPE_RISING LL_PWR_EXTWKUP_TYPE_RISING /**< Rising edge wakeup */
141 #define PWR_EXTWKUP_TYPE_FALLING LL_PWR_EXTWKUP_TYPE_FALLING /**< Falling edge wakeup */
142 /** @} */
143
144 /** @defgroup PWR_Sleep_Timer_Mode PWR Sleep Timer Mode
145 * @{
146 */
147 #define PWR_SLP_TIMER_MODE_NORMAL 0x0U /**< Start counting after sleeping and disabled when waked up */
148 #define PWR_SLP_TIMER_MODE_SINGLE 0x1U /**< Single mode(keep counting until finished) */
149 #define PWR_SLP_TIMER_MODE_RELOAD 0x2U /**< Auto reload */
150 #define PWR_SLP_TIMER_MODE_DISABLE 0x3U /**< Disabled (used for reset mode) */
151 /** @} */
152
153 /** @defgroup PWR_Timer_Type PWR Timer Type
154 * @note Only available on GR5515_C and later versions.
155 * @{
156 */
157 #define PWR_TIMER_TYPE_CAL_TIMER LL_PWR_TIMER_READ_SEL_CAL_TIMER /**< Calendar timer */
158 #define PWR_TIMER_TYPE_AON_WDT LL_PWR_TIMER_READ_SEL_AON_WDT /**< AON watchdog timer */
159 #define PWR_TIMER_TYPE_SLP_TIMER LL_PWR_TIMER_READ_SEL_SLP_TIMER /**< Sleep timer */
160 #define PWR_TIMER_TYPE_CAL_ALARM LL_PWR_TIMER_READ_SEL_CAL_ALARM /**< Calendar timer */
161 /** @} */
162
163
164 /** @defgroup PWR_Memory_Power_State Memory Power State
165 * @{
166 */
167 #define PWR_MEM_POWER_OFF LL_PWR_MEM_POWER_OFF /**< Power off */
168 #define PWR_MEM_POWER_FULL LL_PWR_MEM_POWER_FULL /**< Full power */
169 #define PWR_MEM_POWER_RETENTION LL_PWR_MEM_POWER_RETENTION /**< Power retention, low valtage mode */
170 /** @} */
171
172 /** @defgroup PWR_Communication_Power_State Communication Power State
173 * @{
174 */
175 #define PWR_COMM_TIMER_POWER_DOWN 0x0U /**< Power down communication timer */
176 #define PWR_COMM_TIMER_POWER_UP 0x1U /**< Power on communication timer */
177 #define PWR_COMM_CORE_POWER_DOWN 0x0U /**< Power down communication core */
178 #define PWR_COMM_CORE_POWER_UP 0x1U /**< Power on communication core */
179 /** @} */
180
181 /** @defgroup PWR_Communication_Mode Communication Mode
182 * @{
183 */
184 #define PWR_COMM_TIMER_MODE_RESET 0x0U /**< Communication timer in reset mode */
185 #define PWR_COMM_TIMER_MODE_RUNNING 0x1U /**< Communication timer in running mode */
186 #define PWR_COMM_CORE_MODE_RESET 0x0U /**< Communication core in reset mode */
187 #define PWR_COMM_CORE_MODE_RUNNING 0x1U /**< Communication core in running mode */
188 /** @} */
189
190 /** @defgroup PWR_Timeout_definition PWR Timeout definition
191 * @{
192 */
193 #define HAL_PWR_TIMEOUT_DEFAULT_VALUE ((uint32_t)0x000FFFFF) /**< 0xFFFFF counts */
194 /** @} */
195
196 /** @} */
197
198 /* Exported macro ------------------------------------------------------------*/
199 /* Private macros ------------------------------------------------------------*/
200 /** @addtogroup PWR_Private_Macros PWR Private Macros
201 * @{
202 */
203
204 /**
205 * @brief Check if PWR wakeup condition is valid.
206 * @param __COND__ PWR wakeup condition.
207 * @retval SET (__COND__ is valid) or RESET (__COND__ is invalid)
208 */
209 #define IS_PWR_WAKEUP_CONDITION(__COND__) ((((__COND__) & PWR_WKUP_COND_ALL) != 0x00U) &&\
210 (((__COND__) & ~PWR_WKUP_COND_ALL) == 0x00U))
211
212 /**
213 * @brief Check if PWR external wakeup pin is valid.
214 * @param __PIN__ PWR external wakeup pin.
215 * @retval SET (__PIN__ is valid) or RESET (__PIN__ is invalid)
216 */
217 #define IS_PWR_EXT_WAKEUP_PIN(__PIN__) ((((__PIN__) & PWR_EXTWKUP_PIN_ALL) != 0x00U) &&\
218 (((__PIN__) & ~PWR_EXTWKUP_PIN_ALL) == 0x00U))
219
220 /**
221 * @brief Check if PWR sleep timer mode is valid.
222 * @param __MODE__ PWR sleep timer mode.
223 * @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid)
224 */
225 #define IS_PWR_SLP_TIMER_MODE(__MODE__) (((__MODE__) == PWR_SLP_TIMER_MODE_NORMAL) || \
226 ((__MODE__) == PWR_SLP_TIMER_MODE_SINGLE) || \
227 ((__MODE__) == PWR_SLP_TIMER_MODE_RELOAD) || \
228 ((__MODE__) == PWR_SLP_TIMER_MODE_DISABLE))
229
230 /**
231 * @brief Check if PWR external wakeup type is valid.
232 * @param __TYPE__ PWR external wakeup type.
233 * @retval SET (__TYPE__ is valid) or RESET (__TYPE__ is invalid)
234 */
235 #define IS_PWR_EXTWKUP_TYPE(__TYPE__) (((__TYPE__) == PWR_EXTWKUP_TYPE_LOW) || \
236 ((__TYPE__) == PWR_EXTWKUP_TYPE_HIGH) || \
237 ((__TYPE__) == PWR_EXTWKUP_TYPE_RISING) || \
238 ((__TYPE__) == PWR_EXTWKUP_TYPE_FALLING))
239
240 /**
241 * @brief Check if PWR memory block is valid.
242 * @param __BLOCK__ PWR memory block.
243 * @retval SET (__BLOCK__ is valid) or RESET (__BLOCK__ is invalid)
244 */
245 #define IS_PWR_MEM_BLOCK(__BLOCK__) ((((__BLOCK__) & PWR_MEM_ALL) != 0x00U) &&\
246 (((__BLOCK__) & ~PWR_MEM_ALL) == 0x00U))
247
248 /**
249 * @brief Check if PWR memory power state is valid.
250 * @param __STATE__ PWR memory power state.
251 * @retval SET (__STATE__ is valid) or RESET (__STATE__ is invalid)
252 */
253 #define IS_PWR_MEM_POWER_STAT(__STATE__) (((__STATE__) == PWR_MEM_POWER_OFF) || \
254 ((__STATE__) == PWR_MEM_POWER_FULL) || \
255 ((__STATE__) == PWR_MEM_POWER_RETENTION))
256
257 /**
258 * @brief Check if PWR BLE communication timer power state is valid.
259 * @param __STATE__ PWR BLE communication timer power state.
260 * @retval SET (__STATE__ is valid) or RESET (__STATE__ is invalid)
261 */
262 #define IS_PWR_COMM_TIMER_POWER_STAT(__STATE__) (((__STATE__) == PWR_COMM_TIMER_POWER_DOWN) || \
263 ((__STATE__) == PWR_COMM_TIMER_POWER_UP))
264
265 /**
266 * @brief Check if PWR BLE communication core power state is valid.
267 * @param __STATE__ PWR BLE communication core power state.
268 * @retval SET (__STATE__ is valid) or RESET (__STATE__ is invalid)
269 */
270 #define IS_PWR_COMM_CORE_POWER_STAT(__STATE__) (((__STATE__) == PWR_COMM_CORE_POWER_DOWN) || \
271 ((__STATE__) == PWR_COMM_CORE_POWER_UP))
272
273 /**
274 * @brief Check if PWR BLE communication timer mode is valid.
275 * @param __MODE__ PWR BLE communication timer mode.
276 * @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid)
277 */
278 #define IS_PWR_COMM_TIMER_MODE(__MODE__) (((__MODE__) == PWR_COMM_TIMER_MODE_RESET) || \
279 ((__MODE__) == PWR_COMM_TIMER_MODE_RUNNING))
280
281 /**
282 * @brief Check if PWR BLE communication core mode is valid.
283 * @param __MODE__ PWR BLE communication core mode.
284 * @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid)
285 */
286 #define IS_PWR_COMM_CORE_MODE(__MODE__) (((__MODE__) == PWR_COMM_CORE_MODE_RESET) || \
287 ((__MODE__) == PWR_COMM_CORE_MODE_RUNNING))
288
289 /**
290 * @brief Check if PWR sleep timer type is valid.
291 * @param __TYPE__ PWR sleep timer type.
292 * @retval SET (__TYPE__ is valid) or RESET (__TYPE__ is invalid)
293 */
294 #define IS_PWR_PWR_TIMER_TYPE(__TYPE__) (((__TYPE__) == PWR_TIMER_TYPE_CAL_TIMER) || \
295 ((__TYPE__) == PWR_TIMER_TYPE_AON_WDT) || \
296 ((__TYPE__) == PWR_TIMER_TYPE_SLP_TIMER) || \
297 ((__TYPE__) == PWR_TIMER_TYPE_CAL_ALARM))
298
299 /** @} */
300
301 /** @} */
302
303 /* Exported functions --------------------------------------------------------*/
304 /** @addtogroup HAL_PWR_DRIVER_FUNCTIONS Functions
305 * @{
306 */
307
308 /** @addtogroup PWR_Exported_Functions_Group1 Low Power mode configuration functions
309 * @{
310 */
311
312 /**
313 ****************************************************************************************
314 * @brief Set the DeepSleep WakeUp Condition
315 * @param[in] condition: This parameter can be a combination of the following values:
316 * @arg @ref PWR_WKUP_COND_EXT
317 * @arg @ref PWR_WKUP_COND_TIMER
318 * @arg @ref PWR_WKUP_COND_BLE
319 * @arg @ref PWR_WKUP_COND_CALENDAR
320 * @arg @ref PWR_WKUP_COND_BOD_FEDGE
321 * @arg @ref PWR_WKUP_COND_MSIO_COMP
322 * @arg @ref PWR_WKUP_COND_ALL
323 * @note When @ref PWR_WKUP_COND_EXT is set, use @ref hal_pwr_config_ext_wakeup() to configure wakeup pins and pin trigger type.
324 * When @ref PWR_WKUP_COND_TIMER is set, use @ref hal_pwr_config_timer_wakeup() to configure the time count to wakeup.
325 * When @ref PWR_WKUP_COND_ALL is set, use @ref hal_pwr_config_ext_wakeup() and @ref hal_pwr_config_timer_wakeup() to configure
326 * AON timer and External AON GPIO.
327 ****************************************************************************************
328 */
329 void hal_pwr_set_wakeup_condition(uint32_t condition);
330
331 /**
332 ****************************************************************************************
333 * @brief Configure the AON Sleep Timer mode and count used to wakeup MCU.
334 * @param[in] timer_mode: Specifies the sleep timer mode.
335 * This parameter can be a combination of the following values:
336 * @arg @ref PWR_SLP_TIMER_MODE_NORMAL
337 * @arg @ref PWR_SLP_TIMER_MODE_SINGLE
338 * @arg @ref PWR_SLP_TIMER_MODE_RELOAD
339 * @arg @ref PWR_SLP_TIMER_MODE_DISABLE
340 * @param[in] load_count: Count value of the AON Sleep Timer.
341 * @note The sleep clock of AON Timer is 32 KHz.
342 ****************************************************************************************
343 */
344 void hal_pwr_config_timer_wakeup(uint8_t timer_mode, uint32_t load_count);
345
346 /**
347 ****************************************************************************************
348 * @brief Configure the External AON GPIO pins and pin trigger type that is used to wakeup MCU.
349 * @param[in] ext_wakeup_pinx: This parameter can be a combination of the following values:
350 * @arg @ref PWR_EXTWKUP_PIN0
351 * @arg @ref PWR_EXTWKUP_PIN1
352 * @arg @ref PWR_EXTWKUP_PIN2
353 * @arg @ref PWR_EXTWKUP_PIN3
354 * @arg @ref PWR_EXTWKUP_PIN4
355 * @arg @ref PWR_EXTWKUP_PIN5
356 * @arg @ref PWR_EXTWKUP_PIN_ALL
357 * @param[in] ext_wakeup_type: This parameter can be a combination of the following values:
358 * @arg @ref PWR_EXTWKUP_TYPE_LOW
359 * @arg @ref PWR_EXTWKUP_TYPE_HIGH
360 * @arg @ref PWR_EXTWKUP_TYPE_RISING
361 * @arg @ref PWR_EXTWKUP_TYPE_FALLING
362 * @note When the level of any selected GPIO pin changes in accordance with the set
363 * trigger type, MCU will be waked up from DeepSleep mode.
364 ****************************************************************************************
365 */
366 void hal_pwr_config_ext_wakeup(uint32_t ext_wakeup_pinx, uint32_t ext_wakeup_type);
367
368 /**
369 ****************************************************************************************
370 * @brief Disable the interrupt wake-up function of the specified AON GPIO pin.
371 * @param[in] disable_wakeup_pinx: This parameter can be a combination of the following values:
372 * @arg @ref PWR_EXTWKUP_PIN0
373 * @arg @ref PWR_EXTWKUP_PIN1
374 * @arg @ref PWR_EXTWKUP_PIN2
375 * @arg @ref PWR_EXTWKUP_PIN3
376 * @arg @ref PWR_EXTWKUP_PIN4
377 * @arg @ref PWR_EXTWKUP_PIN5
378 * @arg @ref PWR_EXTWKUP_PIN_ALL
379 ****************************************************************************************
380 */
381 void hal_pwr_disable_ext_wakeup(uint32_t disable_wakeup_pinx);
382
383 /**
384 ****************************************************************************************
385 * @brief Enters DeepSleep mode.
386 * @note In DeepSleep mode, all I/O pins keep the same state as in Run mode.
387 ****************************************************************************************
388 */
389 void hal_pwr_enter_chip_deepsleep(void);
390
391 /** @} */
392
393 /** @addtogroup PWR_Exported_Functions_Group2 BLE Communication timer and core configuration function
394 * @{
395 */
396
397 /**
398 ****************************************************************************************
399 * @brief Set the power state of communication timer and communication core in running mode.
400 * @param[in] timer_power_state: This parameter can be one of the following values:
401 * @arg @ref PWR_COMM_TIMER_POWER_UP
402 * @arg @ref PWR_COMM_TIMER_POWER_DOWN
403 * @param[in] core_power_state: This parameter can be one of the following values:
404 * @arg @ref PWR_COMM_CORE_POWER_UP
405 * @arg @ref PWR_COMM_CORE_POWER_DOWN
406 ****************************************************************************************
407 */
408 void hal_pwr_set_comm_power(uint32_t timer_power_state, uint32_t core_power_state);
409
410 /**
411 ****************************************************************************************
412 * @brief Set the work mode of communication timer and communication core.
413 * @param[in] timer_mode: This parameter can be one of the following values:
414 * @arg @ref PWR_COMM_TIMER_MODE_RESET
415 * @arg @ref PWR_COMM_TIMER_MODE_RUNNING
416 * @param[in] core_mode: This parameter can be one of the following values:
417 * @arg @ref PWR_COMM_CORE_MODE_RESET
418 * @arg @ref PWR_COMM_CORE_MODE_RUNNING
419 ****************************************************************************************
420 */
421 void hal_pwr_set_comm_mode(uint32_t timer_mode, uint32_t core_mode);
422
423 /**
424 ****************************************************************************************
425 * @brief Get the current value of specified timer.
426 * @note Only available on GR5515_C and later versions.
427 * @param[in] timer_type: This parameter can be one of the following values:
428 * @arg @ref PWR_TIMER_TYPE_CAL_TIMER
429 * @arg @ref PWR_TIMER_TYPE_AON_WDT
430 * @arg @ref PWR_TIMER_TYPE_SLP_TIMER
431 * @arg @ref PWR_TIMER_TYPE_CAL_ALARM
432 * @param[out] p_value: Pointer to an integer storing current value
433 * @retval ::HAL_OK: Operation is OK.
434 * @retval ::HAL_ERROR: Parameter error or operation not supported.
435 * @retval ::HAL_BUSY: Driver is busy.
436 * @retval ::HAL_TIMEOUT: Timeout occurred.
437 ****************************************************************************************
438 */
439 hal_status_t hal_pwr_get_timer_current_value(uint32_t timer_type, uint32_t *p_value);
440
441 /** @} */
442
443 /** @addtogroup PWR_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
444 * @brief IRQ Handler and Callbacks functions
445 * @{
446 */
447
448 /**
449 ****************************************************************************************
450 * @brief Handle PWR Sleep Timer interrupt request.
451 * @note Only available on GR5515_C and later versions.
452 ****************************************************************************************
453 */
454 void hal_pwr_sleep_timer_irq_handler(void);
455
456
457 /**
458 ****************************************************************************************
459 * @brief PWR Sleep Timer Elapsed callback.
460 * @note Only available on GR5515_C and later versions.
461 * This function should not be modified. When the callback is needed,
462 * the hal_pwr_sleep_timer_elapsed_callback can be implemented in the user file.
463 ****************************************************************************************
464 */
465 void hal_pwr_sleep_timer_elapsed_callback(void);
466
467
468
469 /** @} */
470
471 /** @} */
472
473 #ifdef __cplusplus
474 }
475 #endif
476
477
478 #endif /* __GR55xx_HAL_PWR_H__ */
479
480 /** @} */
481
482 /** @} */
483
484 /** @} */
hal_pwr_config_ext_wakeup
void hal_pwr_config_ext_wakeup(uint32_t ext_wakeup_pinx, uint32_t ext_wakeup_type)
Configure the External AON GPIO pins and pin trigger type that is used to wakeup MCU.
_hal_pwr_handler
PWR callback handle Structure definition.
Definition: gr55xx_hal_pwr.h:90
hal_pwr_get_timer_current_value
hal_status_t hal_pwr_get_timer_current_value(uint32_t timer_type, uint32_t *p_value)
Get the current value of specified timer.
hal_pwr_disable_ext_wakeup
void hal_pwr_disable_ext_wakeup(uint32_t disable_wakeup_pinx)
Disable the interrupt wake-up function of the specified AON GPIO pin.
hal_pwr_set_wakeup_condition
void hal_pwr_set_wakeup_condition(uint32_t condition)
Set the DeepSleep WakeUp Condition.
hal_pwr_config_timer_wakeup
void hal_pwr_config_timer_wakeup(uint8_t timer_mode, uint32_t load_count)
Configure the AON Sleep Timer mode and count used to wakeup MCU.
hal_pwr_sleep_timer_elapsed_callback
void hal_pwr_sleep_timer_elapsed_callback(void)
PWR Sleep Timer Elapsed callback.
hal_pwr_handler_t
struct _hal_pwr_handler hal_pwr_handler_t
PWR callback handle Structure definition.
hal_pwr_sleep_timer_irq_handler
void hal_pwr_sleep_timer_irq_handler(void)
Handle PWR Sleep Timer interrupt request.
hal_pwr_enter_chip_deepsleep
void hal_pwr_enter_chip_deepsleep(void)
Enters DeepSleep mode.
pwr_slp_elapsed_handler_t
void(* pwr_slp_elapsed_handler_t)(void)
PWR Sleep Timer Elapsed callback.
Definition: gr55xx_hal_pwr.h:77
hal_pwr_set_comm_power
void hal_pwr_set_comm_power(uint32_t timer_power_state, uint32_t core_power_state)
Set the power state of communication timer and communication core in running mode.
_hal_pwr_handler::pwr_slp_elapsed_hander
pwr_slp_elapsed_handler_t pwr_slp_elapsed_hander
Definition: gr55xx_hal_pwr.h:91
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
hal_pwr_set_comm_mode
void hal_pwr_set_comm_mode(uint32_t timer_mode, uint32_t core_mode)
Set the work mode of communication timer and communication core.
gr55xx_ll_pwr.h
Header file containing functions prototypes of PWR LL library.
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.