gr55xx_hal_sleep_timer.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file gr55xx_hal_sleep_timer.h
5  * @author BLE Driver Team
6  * @brief Header file containing functions prototypes of sleep timer 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_SLEEP_TIMER SLEEP_TIMER
47  * @brief SLEEP TIMER HAL module driver.
48  * @{
49  */
50 
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_SLEEP_TIMER_H__
53 #define __GR55xx_HAL_SLEEP_TIMER_H__
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_hal_def.h"
61 
62 /* Exported types ------------------------------------------------------------*/
63 
64 /* Exported functions --------------------------------------------------------*/
65 /** @addtogroup HAL_SLEEP_TIMER_FUNCTIONS Functions
66  * @{
67  */
68 
69 /**
70 ****************************************************************************************
71 * @brief Configure the AON Sleep Timer mode, count and start used to wakeup MCU.
72 * @param[in] mode: Specifies the sleep timer mode.
73 * This parameter can be a combination of the following values:
74 * @arg @ref PWR_SLP_TIMER_MODE_NORMAL
75 * @arg @ref PWR_SLP_TIMER_MODE_SINGLE
76 * @arg @ref PWR_SLP_TIMER_MODE_RELOAD
77 * @param[in] value: Count value of the AON Sleep Timer.
78 * @retval ::HAL_OK: Operation is OK.
79 * @retval ::HAL_ERROR: Operation is ERROR.
80 ****************************************************************************************
81 */
82 hal_status_t hal_sleep_timer_config_and_start(uint8_t mode, uint32_t value);
83 
84 /**
85 ****************************************************************************************
86 * @brief stop Sleep Timer
87 ****************************************************************************************
88 */
90 
91 /**
92 ****************************************************************************************
93 * @brief Get the current value of sleep timer
94 * @retval the current value of sleep timer
95 ****************************************************************************************
96 */
98 
99 /**
100 ****************************************************************************************
101 * @brief Get clock frequency of sleep timer
102 * @retval clock frequency of sleep timer
103 ****************************************************************************************
104 */
106 
107 /**
108 ****************************************************************************************
109 * @brief get sleep timer is running or not
110 * @retval runing state of sleep timer (1 or 0).
111 ****************************************************************************************
112 */
114 /** @} */
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* __GR55xx_HAL_SLEEP_TIMER_H__ */
121 
122 /** @} */
123 
124 /** @} */
125 
126 /** @} */
hal_sleep_timer_config_and_start
hal_status_t hal_sleep_timer_config_and_start(uint8_t mode, uint32_t value)
Configure the AON Sleep Timer mode, count and start used to wakeup MCU.
hal_sleep_timer_get_current_value
uint32_t hal_sleep_timer_get_current_value(void)
Get the current value of sleep timer.
hal_sleep_timer_get_clock_freq
uint32_t hal_sleep_timer_get_clock_freq(void)
Get clock frequency of sleep timer.
hal_sleep_timer_stop
void hal_sleep_timer_stop(void)
stop Sleep Timer
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
hal_sleep_timer_status_get
uint8_t hal_sleep_timer_status_get(void)
get sleep timer is running or not
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.