gr55xx_hal_rtc.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file gr55xx_hal_rtc.h
5  * @author BLE Driver Team
6  * @brief Header file containing functions prototypes of RTC 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_RTC RTC
47  * @brief RTC HAL module driver.
48  * @{
49  */
50 
51 #ifndef __GR55XX_HAL_RTC_H__
52 #define __GR55XX_HAL_RTC_H__
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 /* Includes ------------------------------------------------------------------*/
59 #include "gr55xx_ll_rtc.h"
60 #include "gr55xx_hal_def.h"
61 
62 /**
63  * @defgroup HAL_RTC_MACRO Defines
64  * @{
65  */
66 
67 /* Exported constants --------------------------------------------------------*/
68 /** @defgroup RTC_Exported_Constants RTC Exported Constants
69  * @{
70  */
71 
72 /** @defgroup RTC_INTERRUPT_STATUS RTC Interrupt Status
73  * @{
74  */
75 #define RTC_FLAG_ALARM RTC_INT_STAT_ALARM /**< Alarm interrupt flag */
76 #define RTC_FLAG_WRAP RTC_INT_STAT_WRAP /**< Wrap interrupt flag */
77 #define RTC_FLAG_TICK RTC_INT_STAT_TICK /**< Tick interrupt flag */
78 /** @} */
79 
80 /** @defgroup RTC_INTERRUPT_ENABLE RTC Interrupt Enable
81  * @{
82  */
83 #define RTC_IT_ALARM RTC_INT_EN_ALARM /**< Alarm interrupt */
84 #define RTC_IT_WRAP RTC_INT_EN_WRAP /**< Wrap interrupt */
85 #define RTC_IT_TICK RTC_INT_EN_TICK /**< Tick interrupt */
86 /** @} */
87 
88 /** @defgroup RTC_Error_Code_definition RTC Error Code definition
89  * @{
90  */
91 #define HAL_RTC_ERROR_NONE (0x00000000U) /**< No error */
92 #define HAL_RTC_ERROR_INVALID_PARAM (0x00000001U) /**< Invalid parameter error */
93 #define HAL_RTC_ERROR_TIMEOUT (0x00000002U) /**< Timeout error */
94 /** @} */
95 
96 /** @defgroup RTC_CLOCK_DIV Clock divider
97  * @{
98  */
99 #define RTC_DIV_NONE LL_RTC_DIV_NONE /**< Select SLP_CLK */
100 #define RTC_DIV_2 LL_RTC_DIV_2 /**< Select 1/32 divider */
101 #define RTC_DIV_4 LL_RTC_DIV_4 /**< Select 1/32 divider */
102 #define RTC_DIV_8 LL_RTC_DIV_8 /**< Select 1/32 divider */
103 #define RTC_DIV_16 LL_RTC_DIV_16 /**< Select 1/32 divider */
104 #define RTC_DIV_32 LL_RTC_DIV_32 /**< Select 1/64 divider */
105 #define RTC_DIV_64 LL_RTC_DIV_64 /**< Select 1/128 divider */
106 #define RTC_DIV_128 LL_RTC_DIV_128 /**< Select 1/256 divider */
107 /** @} */
108 
109 /** @defgroup RTC_RELOAD_MODE Relaod mode
110  * @{
111  */
112 #define ONE_TIME LL_RTC_TIMER_TICK_TYPE_SINGLE /**< Select periodic alarm one-time */
113 #define AUTO_RELOAD LL_RTC_TIMER_TICK_TYPE_AUTO /**< Select periodic alarm auto-reload */
114 /** @} */
115 
116 /** @} */
117 
118 /* Private macros ------------------------------------------------------------*/
119 /** @defgroup RTC_Private_Macro RTC Private Macros
120  * @{
121  */
122 
123 /** @brief Disable RTC
124  * @param RTCx Specifies the RTC instance.
125  * @retval None
126  */
127 #define __HAL_RTC_DISABLE(RTCx) MODIFY_REG(RTCx->CFG0, 0xFFFFFFFF, RTC_CFG0_CFG);
128 
129 /** @brief Enable RTC
130  * @param RTCx Specifies the RTC instance.
131  * @retval None
132  */
133 #define __HAL_RTC_ENABLE(RTCx) SET_BITS(RTCx->CFG0, RTC_CFG0_CFG | RTC_CFG0_EN);
134 
135 /** @brief Check RTC busy state
136  * @param RTCx Specifies the RTC instance.
137  * @retval TRUE or FALSE
138  */
139 #define __HAL_RTC_BUSY_FLAG(RTCx) ((READ_BITS(RTCx->STAT, RTC_STAT_BUSY) == RTC_STAT_BUSY))
140 
141 /** @brief Clear RTC flag
142  * @param RTCx Specifies the RTC instance.
143  * @param __FLAG__ Specifies the RTC Interrupt Status.
144  * @retval None
145  */
146 #define __HAL_RTC_CLEAR_FLAG(RTCx, __FLAG__) WRITE_REG(RTCx->INT_STAT, (__FLAG__))
147 
148 /** @brief Enable RTC interrupt
149  * @param RTCx Specifies the RTC instance.
150  * @param __INTERRUPT__ Specifies the RTC Interrupt Type.
151  * @retval None
152  */
153 #define __HAL_RTC_ENABLE_IT(RTCx, __INTERRUPT__) SET_BITS(RTCx->INT_EN, (__INTERRUPT__))
154 
155 /** @brief Disable RTC interrupt
156  * @param RTCx Specifies the RTC instance.
157  * @param __INTERRUPT__ Specifies the RTC Interrupt Type.
158  * @retval None
159  */
160 #define __HAL_RTC_DISABLE_IT(RTCx, __INTERRUPT__) CLEAR_BITS(RTCx->INT_EN, (__INTERRUPT__))
161 
162 /** @brief Get RTC interrupt source
163  * @param RTCx Specifies the RTC instance.
164  * @param __FLAG__ Specifies the RTC Interrupt Status.
165  * @retval TRUE or FALSE
166  */
167 #define __HAL_RTC_GET_IT_SOURCE(RTCx, __FLAG__) (READ_BITS(RTCx->INT_STAT, (__FLAG__)) == (__FLAG__))
168 
169 /** @brief Set RTC config takes effect
170  * @param RTCx Specifies the RTC instance.
171  * @retval None
172  */
173 #define __HAL_RTC_CFG_EFFECT(RTCx) SET_BITS(RTCx->CFG0, RTC_CFG0_CFG)
174 /** @} */
175 
176 /** @} */
177 
178 /* Exported types ------------------------------------------------------------*/
179 /** @addtogroup HAL_RTC_ENUMERATIONS Enumerations
180  * @{
181  */
182 
183 /**
184  * @brief hal_rtc_state definition
185  */
186 typedef enum
187 {
188  HAL_RTC_READY = 0x00U,
193 
194 /**
195  * @brief rtc_tick_state definition
196  */
197 typedef enum
198 {
199  TICK_READY = 0x00U,
201  TICK_ERROR
203 
204 /**
205  * @brief rtc_alarm_state definition
206  */
207 typedef enum
208 {
209  ALARM_READY = 0x00U,
213 
214 /**
215  * @brief overflow config
216  */
217 typedef enum
218 {
219  CLOSED = 0x00U,
220  OPENED = !CLOSED
222 
223 /** @} */
224 
225 /** @addtogroup HAL_RTC_STRUCTURES Structures
226  * @{
227  */
228 
229 /**
230  * @brief rtc init params
231  * @attention count up from zero if not set start_value.
232  */
233 typedef struct _rtc_init_t
234 {
235 
236  uint32_t start_value;
237 
238  uint32_t prescaler_div;
239 
241 
243 
244 /**
245  * @brief rtc tick handle definition
246  */
247 typedef struct _tick_handle_t
248 {
249  uint8_t mode;
250 
251  uint32_t value;
252 
254 
256 
257 /**
258  * @brief rtc alarm handle definition
259  */
260 typedef struct _alarm_handle_t
261 {
262  uint32_t value;
263 
265 
267 
268 
269 /**
270  * @brief rtc handle definition
271  */
272 typedef struct _rtc_handle_t
273 {
274  rtc_regs_t *p_instance; /*!< Register base address */
275 
276  rtc_init_t init; /*!< RTC required parameters */
277 
278  tick_handle_t tick; /*!< tick_handle */
279 
280  alarm_handle_t alarm; /*!< alarm_handle */
281 
282  hal_lock_t lock; /*!< RTC locking object */
283 
284  __IO hal_rtc_state_t state; /*!< Time communication state */
285 
286  __IO uint32_t error_code; /**< RTC Error code */
287 
289 
290 /** @} */
291 
292 /** @addtogroup HAL_RTC_CALLBACK_STRUCTURES Callback Structures
293  * @{
294  */
295 
296 /** @defgroup RTC_Callback RTC Callback
297  * @{
298  */
299 
300 /**
301  * @brief HAL_RTC Callback function definition
302  */
303 
304 typedef struct _rtc_callback
305 {
306  void (*rtc_alarm_callback)(rtc_handle_t *p_rtc); /**< RTC alarm count complete callback */
307  void (*rtc_tick_callback)(rtc_handle_t *p_rtc); /**< RTC tick count complete callback */
308  void (*rtc_overflow_callback)(rtc_handle_t *p_rtc); /**< RTC overflow callback */
310 
311 /** @} */
312 
313 /** @} */
314 
315 /* Exported functions --------------------------------------------------------*/
316 /** @addtogroup HAL_RTC_DRIVER_FUNCTIONS Functions
317  * @{
318  */
319 
320 /** @addtogroup RTC_Exported_Functions_Group1 Initialization and de-initialization Functions
321  * @brief Initialization and Configuration functions
322  * @{
323  */
324 
325 /**
326  ****************************************************************************************
327  * @brief Initialize the RTC according to the specified parameters in the
328  * rtc_init_t of associated handle.counter start after hal_rtc_init.
329  *
330  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
331  * information for the specified RTC module.
332  *
333  * @retval ::HAL_OK: Operation is OK.
334  * @retval ::HAL_ERROR: Parameter error or operation not supported.
335  * @retval ::HAL_BUSY: Driver is busy.
336  * @retval ::HAL_TIMEOUT: Timeout occurred.
337  ****************************************************************************************
338  */
340 
341 /**
342  ****************************************************************************************
343  * @brief DeInitialize the RTC according to the specified parameters in the
344  * rtc_init_t of associated handle.counter stop after hal_rtc_deinit.
345  *
346  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
347  * information for the specified RTC module.
348  *
349  * @retval ::HAL_OK: Operation is OK.
350  * @retval ::HAL_ERROR: Parameter error or operation not supported.
351  * @retval ::HAL_BUSY: Driver is busy.
352  * @retval ::HAL_TIMEOUT: Timeout occurred.
353  ****************************************************************************************
354  */
356 
357 /**
358  ****************************************************************************************
359  * @brief Start counting down for tick module
360  *
361  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
362  * information for the specified RTC module.
363  * @param[in] mode
364  * @param[in] value
365  *
366  * @retval ::HAL_OK: Operation is OK.
367  * @retval ::HAL_ERROR: Parameter error or operation not supported.
368  * @retval ::HAL_BUSY: Driver is busy.
369  * @retval ::HAL_TIMEOUT: Timeout occurred.
370  ****************************************************************************************
371  */
372 hal_status_t hal_rtc_set_tick_and_start(rtc_handle_t *p_rtc, uint8_t mode,uint32_t value);
373 
374 /**
375  ****************************************************************************************
376  * @brief Stop counting down for tick module
377  *
378  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
379  * information for the specified RTC module.
380  *
381  * @retval ::HAL_OK: Operation is OK.
382  * @retval ::HAL_ERROR: Parameter error or operation not supported.
383  * @retval ::HAL_BUSY: Driver is busy.
384  * @retval ::HAL_TIMEOUT: Timeout occurred.
385  ****************************************************************************************
386  */
388 
389 /**
390  ****************************************************************************************
391  * @brief Restart tick module and continue run with the previous settings.
392  * This function need be called after hal_rtc_stop_tick
393  *
394  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
395  * information for the specified RTC module.
396  *
397  * @retval ::HAL_OK: Operation is OK.
398  * @retval ::HAL_ERROR: Parameter error or operation not supported.
399  * @retval ::HAL_BUSY: Driver is busy.
400  * @retval ::HAL_TIMEOUT: Timeout occurred.
401  ****************************************************************************************
402  */
404 /**
405  ****************************************************************************************
406  * @brief Compare counter with alarm_value for alarm module
407  *
408  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
409  * information for the specified RTC module.
410  * @param[in] value
411  *
412  * @retval ::HAL_OK: Operation is OK.
413  * @retval ::HAL_ERROR: Parameter error or operation not supported.
414  * @retval ::HAL_BUSY: Driver is busy.
415  * @retval ::HAL_TIMEOUT: Timeout occurred.
416  ****************************************************************************************
417  */
419 
420 /**
421  ****************************************************************************************
422  * @brief Stop counting up and compare with alarm_value for alarm module
423  *
424  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
425  * information for the specified RTC module.
426  *
427  * @retval ::HAL_OK: Operation is OK.
428  * @retval ::HAL_ERROR: Parameter error or operation not supported.
429  * @retval ::HAL_BUSY: Driver is busy.
430  * @retval ::HAL_TIMEOUT: Timeout occurred.
431  ****************************************************************************************
432  */
434 
435 /**
436  ****************************************************************************************
437  * @brief Clear wrap count
438  *
439  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
440  * information for the specified RTC module.
441  *
442  * @retval ::HAL_OK: Operation is OK.
443  * @retval ::HAL_ERROR: Parameter error or operation not supported.
444  * @retval ::HAL_BUSY: Driver is busy.
445  * @retval ::HAL_TIMEOUT: Timeout occurred.
446  ****************************************************************************************
447  */
449 
450 /**
451  ****************************************************************************************
452  * @brief Get the times of overflow
453  *
454  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
455  * information for the specified RTC module.
456  *
457  * @retval ::
458  ****************************************************************************************
459  */
461 
462 /**
463  ****************************************************************************************
464  * @brief Get_cur_count_value
465  *
466  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
467  * information for the specified RTC module.
468  *
469  * @retval ::
470  ****************************************************************************************
471  */
473 
474 /**
475  ****************************************************************************************
476  * @brief Get_cur_tick_value
477  *
478  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
479  * information for the specified RTC module.
480  *
481  * @retval ::
482  ****************************************************************************************
483  */
485 
486 /**
487  ****************************************************************************************
488  * @brief Get_alarm_value
489  *
490  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
491  * information for the specified RTC module.
492  *
493  * @retval ::
494  ****************************************************************************************
495  */
497 
498 /**
499  ****************************************************************************************
500  * @brief Get_cur_rtc_state
501  *
502  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
503  * information for the specified RTC module.
504  *
505  * @retval ::HAL_OK: Operation is OK.
506  * @retval ::HAL_ERROR: Parameter error or operation not supported.
507  * @retval ::HAL_BUSY: Driver is busy.
508  * @retval ::HAL_TIMEOUT: Timeout occurred.
509  ****************************************************************************************
510  */
512 
513 /** @} */
514 
515 /** @addtogroup RTC_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
516  * @brief IRQ Handler and Callbacks functions
517  * @{
518  */
519 
520 /**
521  ****************************************************************************************
522  * @brief RTC_IRQHandler
523  *
524  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
525  * information for the specified RTC module.
526  ****************************************************************************************
527  */
529 
530 /**
531  ****************************************************************************************
532  * @brief alarm_callback
533  *
534  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
535  * information for the specified RTC module.
536  ****************************************************************************************
537  */
539 
540 /**
541  ****************************************************************************************
542  * @brief overflow_callback
543  *
544  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
545  * information for the specified RTC module.
546  ****************************************************************************************
547  */
549 
550 /**
551  ****************************************************************************************
552  * @brief tick_callback
553  *
554  * @param[in] p_rtc: Pointer to a RTC handle which contains the configuration
555  * information for the specified RTC module.
556  ****************************************************************************************
557  */
559 
560 /** @} */
561 
562 /** @} */
563 
564 #ifdef __cplusplus
565 }
566 #endif
567 
568 #endif
569 
570 /** @} */
571 
572 /** @} */
573 
574 /** @} */
hal_rtc_restart_tick
hal_status_t hal_rtc_restart_tick(rtc_handle_t *p_rtc)
Restart tick module and continue run with the previous settings. This function need be called after h...
_rtc_handle_t::init
rtc_init_t init
Definition: gr55xx_hal_rtc.h:276
hal_lock_t
hal_lock_t
HAL Lock structures definition.
Definition: gr55xx_hal_def.h:81
hal_rtc_deinit
hal_status_t hal_rtc_deinit(rtc_handle_t *p_rtc)
DeInitialize the RTC according to the specified parameters in the rtc_init_t of associated handle....
hal_rtc_get_cur_count
uint32_t hal_rtc_get_cur_count(rtc_handle_t *p_rtc)
Get_cur_count_value.
_alarm_handle_t::state
__IO rtc_alarm_state_t state
Definition: gr55xx_hal_rtc.h:264
hal_rtc_alarm_callback
void hal_rtc_alarm_callback(rtc_handle_t *p_rtc)
alarm_callback
_rtc_init_t::prescaler_div
uint32_t prescaler_div
Definition: gr55xx_hal_rtc.h:238
_rtc_callback::rtc_tick_callback
void(* rtc_tick_callback)(rtc_handle_t *p_rtc)
Definition: gr55xx_hal_rtc.h:307
HAL_RTC_RUNNING
@ HAL_RTC_RUNNING
Definition: gr55xx_hal_rtc.h:190
_rtc_init_t
rtc init params
Definition: gr55xx_hal_rtc.h:234
hal_rtc_tick_callback
void hal_rtc_tick_callback(rtc_handle_t *p_rtc)
tick_callback
HAL_RTC_RESET
@ HAL_RTC_RESET
Definition: gr55xx_hal_rtc.h:189
_tick_handle_t::state
__IO rtc_tick_state_t state
Definition: gr55xx_hal_rtc.h:253
HAL_RTC_ERROR
@ HAL_RTC_ERROR
Definition: gr55xx_hal_rtc.h:191
_rtc_handle_t::lock
hal_lock_t lock
Definition: gr55xx_hal_rtc.h:282
hal_rtc_get_state
hal_rtc_state_t hal_rtc_get_state(rtc_handle_t *p_rtc)
Get_cur_rtc_state.
_alarm_handle_t::value
uint32_t value
Definition: gr55xx_hal_rtc.h:262
tick_handle_t
struct _tick_handle_t tick_handle_t
rtc tick handle definition
_rtc_init_t::overflow_det_state
overflow_det_t overflow_det_state
Definition: gr55xx_hal_rtc.h:240
hal_rtc_stop_alarm
hal_status_t hal_rtc_stop_alarm(rtc_handle_t *p_rtc)
Stop counting up and compare with alarm_value for alarm module.
ALARM_READY
@ ALARM_READY
Definition: gr55xx_hal_rtc.h:209
hal_rtc_state_t
hal_rtc_state_t
hal_rtc_state definition
Definition: gr55xx_hal_rtc.h:187
_alarm_handle_t
rtc alarm handle definition
Definition: gr55xx_hal_rtc.h:261
HAL_RTC_READY
@ HAL_RTC_READY
Definition: gr55xx_hal_rtc.h:188
hal_rtc_irq_handler
void hal_rtc_irq_handler(rtc_handle_t *p_rtc)
RTC_IRQHandler.
_rtc_handle_t
rtc handle definition
Definition: gr55xx_hal_rtc.h:273
_rtc_handle_t::alarm
alarm_handle_t alarm
Definition: gr55xx_hal_rtc.h:280
OPENED
@ OPENED
Definition: gr55xx_hal_rtc.h:220
hal_rtc_get_cur_tick
uint32_t hal_rtc_get_cur_tick(rtc_handle_t *p_rtc)
Get_cur_tick_value.
_tick_handle_t
rtc tick handle definition
Definition: gr55xx_hal_rtc.h:248
rtc_handle_t
struct _rtc_handle_t rtc_handle_t
rtc handle definition
hal_rtc_stop_tick
hal_status_t hal_rtc_stop_tick(rtc_handle_t *p_rtc)
Stop counting down for tick module.
rtc_alarm_state_t
rtc_alarm_state_t
rtc_alarm_state definition
Definition: gr55xx_hal_rtc.h:208
ALARM_RUNNING
@ ALARM_RUNNING
Definition: gr55xx_hal_rtc.h:210
_rtc_handle_t::state
__IO hal_rtc_state_t state
Definition: gr55xx_hal_rtc.h:284
_rtc_handle_t::tick
tick_handle_t tick
Definition: gr55xx_hal_rtc.h:278
hal_rtc_clear_wrap
hal_status_t hal_rtc_clear_wrap(rtc_handle_t *p_rtc)
Clear wrap count.
TICK_READY
@ TICK_READY
Definition: gr55xx_hal_rtc.h:199
hal_rtc_get_alarm_value
uint32_t hal_rtc_get_alarm_value(rtc_handle_t *p_rtc)
Get_alarm_value.
hal_rtc_get_wrap_count
uint32_t hal_rtc_get_wrap_count(rtc_handle_t *p_rtc)
Get the times of overflow.
CLOSED
@ CLOSED
Definition: gr55xx_hal_rtc.h:219
hal_rtc_set_alarm
hal_status_t hal_rtc_set_alarm(rtc_handle_t *p_rtc, uint32_t value)
Compare counter with alarm_value for alarm module.
TICK_ERROR
@ TICK_ERROR
Definition: gr55xx_hal_rtc.h:201
TICK_RUNNING
@ TICK_RUNNING
Definition: gr55xx_hal_rtc.h:200
alarm_handle_t
struct _alarm_handle_t alarm_handle_t
rtc alarm handle definition
_rtc_handle_t::error_code
__IO uint32_t error_code
Definition: gr55xx_hal_rtc.h:286
_tick_handle_t::mode
uint8_t mode
Definition: gr55xx_hal_rtc.h:249
gr55xx_ll_rtc.h
Header file containing functions prototypes of CALENDAR LL library.
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
overflow_det_t
overflow_det_t
overflow config
Definition: gr55xx_hal_rtc.h:218
_rtc_callback
HAL_RTC Callback function definition.
Definition: gr55xx_hal_rtc.h:305
hal_rtc_init
hal_status_t hal_rtc_init(rtc_handle_t *p_rtc)
Initialize the RTC according to the specified parameters in the rtc_init_t of associated handle....
_tick_handle_t::value
uint32_t value
Definition: gr55xx_hal_rtc.h:251
rtc_init_t
struct _rtc_init_t rtc_init_t
rtc init params
hal_rtc_set_tick_and_start
hal_status_t hal_rtc_set_tick_and_start(rtc_handle_t *p_rtc, uint8_t mode, uint32_t value)
Start counting down for tick module.
ALARM_ERROR
@ ALARM_ERROR
Definition: gr55xx_hal_rtc.h:211
rtc_tick_state_t
rtc_tick_state_t
rtc_tick_state definition
Definition: gr55xx_hal_rtc.h:198
_rtc_callback::rtc_overflow_callback
void(* rtc_overflow_callback)(rtc_handle_t *p_rtc)
Definition: gr55xx_hal_rtc.h:308
hal_rtc_overflow_callback
void hal_rtc_overflow_callback(rtc_handle_t *p_rtc)
overflow_callback
rtc_callback_t
struct _rtc_callback rtc_callback_t
HAL_RTC Callback function definition.
_rtc_init_t::start_value
uint32_t start_value
Definition: gr55xx_hal_rtc.h:236
_rtc_handle_t::p_instance
rtc_regs_t * p_instance
Definition: gr55xx_hal_rtc.h:274
_rtc_callback::rtc_alarm_callback
void(* rtc_alarm_callback)(rtc_handle_t *p_rtc)
Definition: gr55xx_hal_rtc.h:306
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.