gr55xx_hal_calendar.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gr55xx_hal_calendar.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of CALENDAR 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_CALENDAR CALENDAR
47 * @brief CALENDAR HAL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_CALENDAR_H__
53 #define __GR55xx_HAL_CALENDAR_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_ll_calendar.h"
61 #include "gr55xx_hal_def.h"
62
63 /* Exported types ------------------------------------------------------------*/
64 /** @addtogroup HAL_CALENDAR_ENUMERATIONS Enumerations
65 * @{
66 */
67
68 /** @defgroup HAL_CALENDAR_STATE HAL CALENDAR state
69 * @{
70 */
71 /**
72 * @brief HAL CALENDAR State Enumerations definition
73 */
74 typedef enum
75 {
76 HAL_CALENDAR_STATE_RESET = 0x00, /**< Peripheral not initialized */
77 HAL_CALENDAR_STATE_READY = 0x01, /**< Peripheral initialized and ready for use */
78 HAL_CALENDAR_STATE_ERROR = 0x04 /**< Peripheral in error */
79 } hal_calender_state_t;
80
81 /** @} */
82 /** @} */
83
84
85 /** @addtogroup HAL_CALENDAR_STRUCTURES Structures
86 * @{
87 */
88 /** @defgroup CALENDAR_Time CALENDAR Time
89 * @{
90 */
91
92 /**
93 * @brief CALENDAR_Time calendar time structure definition
94 */
95 typedef struct _calendar_time
96 {
97 uint8_t sec; /**< Specifies the Calendar time seconds.
98 This parameter must be a number between min_value = 0 and max_value = 59. */
99
100 uint8_t min; /**< Specifies the Calendar time minutes.
101 This parameter must be a number between min_value = 0 and max_value = 59. */
102
103 uint8_t hour; /**< Specifies the Calendar time hour.
104 This parameter must be a number between min_value = 0 and max_value = 23. */
105
106 uint8_t date; /**< Specifies the Calendar date.
107 This parameter must be a number between min_value = 1 and max_value = 31. */
108
109 uint8_t mon; /**< Specifies the Calendar month.
110 This parameter must be a number between min_value = 1 and max_value = 12. */
111
112 uint8_t year; /**< Specifies the Calendar year which stars from 2010.
113 This parameter must be a number between min_value = 10 and max_value = 99. */
114
115 uint8_t week; /**< Specifies the Calendar weekday.
116 This parameter must be a number between min_value = 0 and max_value = 6. */
117
118 uint16_t ms; /**< Specifies the Calendar time milliseconds.
119 This parameter must be a number between min_value = 0 and max_value = 999. */
120 } calendar_time_t;
121
122 /**
123 * @brief CALENDAR_Alarm calendar alarm structure definition
124 */
125 typedef struct _calendar_alarm
126 {
127 uint8_t min; /**< Specifies the alarm time minutes.
128 This parameter must be a number between min_value = 0 and max_value = 59. */
129
130 uint8_t hour; /**< Specifies the alarm time hour.
131 This parameter must be a number between min_value = 0 and max_value = 23. */
132
133 uint8_t alarm_sel; /**< Specifies the alarm is on date or weekday.
134 This parameter can be a value of @ref CALENDAR_ALARM_SEL. */
135
136 uint8_t alarm_date_week_mask; /**< Specifies the alarm date/weekday.
137 If the alarm date is selected, this parameter must be set to a value in the 1 ~ 31 range.
138 If the alarm weekday is selected, this parameter must be a value of @ref CALENDAR_ALARM_WEEKDAY. */
139
140 } calendar_alarm_t;
141
142 /** @} */
143
144 /** @defgroup CALENDAR_handle CALENDAR handle
145 * @{
146 */
147
148 /**
149 * @brief CALENDAR handle Structure definition
150 */
151 typedef struct _calendar_handle
152 {
153 calendar_time_t time_init; /**< Specifies the Calendar inital time. */
154
155 calendar_alarm_t alarm; /**< Specifies the Calendar date alarm. */
156
157 hal_lock_t lock; /**< Specifies the Calendar locking object. */
158
159 uint32_t prev_ms; /**< Accumulated millisecond count .*/
160
161 uint32_t interval; /**< Specifies the Calendar milliseconds alarm. */
162
163 uint8_t mode; /**< Specifies the Calendar alarm mode. */
164
165 uint8_t sec; /**< The seconds for the date alarm. */
166
167 uint16_t ms; /**< The milliseconds for the date alarm. */
168
169 hal_calender_state_t state; /**< Calendar state */
170 } calendar_handle_t;
171
172 /** @} */
173 /** @} */
174
175
176 /** @addtogroup HAL_CALENDAR_CALLBACK_STRUCTURES Callback Structures
177 * @{
178 */
179
180 /** @defgroup HAL_CALENDAR_Callback Callback
181 * @{
182 */
183
184 /**
185 * @brief HAL_CALENDAR Callback function definition
186 */
187
188 typedef struct _hal_calendar_callback
189 {
190 void (*calendar_alarm_callback)(calendar_handle_t *p_calendar); /**< CALENDAR date count complete callback */
191 void (*calendar_tick_callback)(calendar_handle_t *p_calendar); /**< CALENDAR tick count complete callback */
192 void (*calendar_overflow_callback)(calendar_handle_t *p_calendar); /**< CALENDAR count overflow callback */
193 } hal_calendar_callback_t;
194
195 /** @} */
196
197 /** @} */
198
199
200 /**
201 * @defgroup HAL_CALENDAR_MACRO Defines
202 * @{
203 */
204
205 /* Exported constants --------------------------------------------------------*/
206 /** @defgroup CALENDAR_Exported_Constants CALENDAR Exported Constants
207 * @{
208 */
209
210 /** @defgroup CALENDAR_Interrupts CALENDAR Interrupts
211 * @{
212 */
213 #define CALENDAR_IT_ALARM AON_CALENDAR_TIMER_CTL_ALARM_INT_EN /**< Alarm interrupt */
214 #define CALENDAR_IT_WARP AON_CALENDAR_TIMER_CTL_WRAP_INT_EN /**< Warp interrupt */
215 /** @} */
216
217 /** @defgroup CALENDAR_Flags CALENDAR Flags
218 * @{
219 */
220 #define CALENDAR_FLAG_ALARM AON_SLP_EVENT_CALENDAR_TIMER_ALARM /**< Alarm interrupt flag */
221 #define CALENDAR_FLAG_WARP AON_SLP_EVENT_CALENDAR_TIMER_WRAP /**< Warp interrupt flag */
222 /** @} */
223
224 /** @defgroup CALENDAR_ALARM_SEL CALENDAR Alarm type select
225 * @{
226 */
227 #define CALENDAR_ALARM_SEL_DATE (0UL) /**< Alarm in date */
228 #define CALENDAR_ALARM_SEL_WEEKDAY (1UL) /**< Alarm in weekday */
229 /** @} */
230
231 /** @defgroup CALENDAR_ALARM_WEEKDAY CALENDAR Alarm weekday
232 * @{
233 */
234 #define CALENDAR_ALARM_WEEKDAY_SUN (0x01ul) /**< Alarm weekday mask Sunday */
235 #define CALENDAR_ALARM_WEEKDAY_MON (0x02ul) /**< Alarm weekday mask Monday */
236 #define CALENDAR_ALARM_WEEKDAY_TUE (0x04ul) /**< Alarm weekday mask Tuesday */
237 #define CALENDAR_ALARM_WEEKDAY_WED (0x08ul) /**< Alarm weekday mask Wednesday */
238 #define CALENDAR_ALARM_WEEKDAY_THU (0x10ul) /**< Alarm weekday mask Thursday */
239 #define CALENDAR_ALARM_WEEKDAY_FRI (0x20ul) /**< Alarm weekday mask Friday */
240 #define CALENDAR_ALARM_WEEKDAY_SAT (0x40ul) /**< Alarm weekday mask Saturday */
241 /** @} */
242
243 /** @defgroup CALENDAR_ALARM_DISABLE CALENDAR Alarm mdoe
244 * @{
245 */
246 #define CALENDAR_ALARM_DISABLE_DATE (1UL) /**< Disable date alarm */
247 #define CALENDAR_ALARM_DISABLE_TICK (2UL) /**< Disable tick alarm */
248 #define CALENDAR_ALARM_DISABLE_ALL ((CALENDAR_ALARM_DISABLE_DATE) | CALENDAR_ALARM_DISABLE_TICK) /**< Disable all alarm */
249 /** @} */
250
251 /** @} */
252
253 /* Exported macro ------------------------------------------------------------*/
254 /** @defgroup CALENDAR_Exported_Macros CALENDAR Exported Macros
255 * @{
256 */
257
258 /** @brief Enable the specified CALENDAR peripheral.
259 * @retval None
260 */
261 #define __HAL_CALENDAR_ENABLE() SET_BITS(AON->CALENDAR_TIMER_CTL, AON_CALENDAR_TIMER_CTL_EN)
262
263 /** @brief Disable the specified CALENDAR peripheral.
264 * @retval None
265 */
266 #define __HAL_CALENDAR_DISABLE() CLEAR_BITS(AON->CALENDAR_TIMER_CTL, AON_CALENDAR_TIMER_CTL_EN)
267
268 /** @brief Enable the specified CALENDAR interrupts.
269 * @param __INTERRUPT__ Specifies the interrupt source to enable.
270 * This parameter can be one of the following values:
271 * @arg @ref CALENDAR_IT_ALARM Alarm Interrupt
272 * @arg @ref CALENDAR_IT_WARP Warp Interrupt
273 * @retval None
274 */
275 #define __HAL_CALENDAR_ENABLE_IT(__INTERRUPT__) SET_BITS(AON->CALENDAR_TIMER_CTL, (__INTERRUPT__))
276
277 /** @brief Disable the specified CALENDAR interrupts.
278 * @param __INTERRUPT__ Specifies the interrupt source to disable.
279 * This parameter can be one of the following values:
280 * @arg @ref CALENDAR_IT_ALARM Alarm Interrupt
281 * @arg @ref CALENDAR_IT_WARP Warp Interrupt
282 * @retval None
283 */
284 #define __HAL_CALENDAR_DISABLE_IT(__INTERRUPT__) CLEAR_BITS(AON->CALENDAR_TIMER_CTL, (__INTERRUPT__))
285
286 /** @brief Check whether the specified CALENDAR interrupt flag is set or not.
287 * @param __FLAG__ Specifies the interrupt source to check.
288 * This parameter can be one of the following values:
289 * @arg @ref CALENDAR_FLAG_ALARM Alarm Interrupt event
290 * @arg @ref CALENDAR_FLAG_WARP Warp Interrupt event
291 * @retval The new state of __IT__ (TRUE or FALSE).
292 */
293 #define __HAL_CALENDAR_GET_IT_SOURCE(__FLAG__) (READ_BITS(AON->SLP_EVENT, (__FLAG__)) == (__FLAG__))
294
295 /** @brief Clear the specified CALENDAR flag.
296 * @param __FLAG__ Specifies the flag to clear.
297 * This parameter can be one of the following values:
298 * @arg @ref CALENDAR_FLAG_ALARM Alarm Interrupt event
299 * @arg @ref CALENDAR_FLAG_WARP Warp Interrupt event
300 * @retval None
301 */
302 #define __HAL_CALENDAR_CLEAR_FLAG(__FLAG__) WRITE_REG(AON->SLP_EVENT, ~(__FLAG__))
303
304 /** @} */
305
306 /* Private macros ------------------------------------------------------------*/
307 /** @defgroup CALENDAR_Private_Macro CALENDAR Private Macros
308 * @{
309 */
310
311 /** @brief Check if CALENDAR Alarm Type is valid.
312 * @param __TYPE__ CALENDAR Alarm Type.
313 * @retval SET (__TYPE__ is valid) or RESET (__TYPE__ is invalid)
314 */
315 #define IS_CALENDAR_ALARM_TYPE(__TYPE__) (((__TYPE__) == CALENDAR_ALARM_SEL_DATE) || \
316 ((__TYPE__) == CALENDAR_ALARM_SEL_WEEKDAY))
317
318 /** @brief Check if CALENDAR Date is valid.
319 * @param __DATE__ CALENDAR Date.
320 * @retval SET (__DATE__ is valid) or RESET (__DATE__ is invalid)
321 */
322 #define IS_CALENDAR_DATE(__DATE__) (((__DATE__) > 0) && ((__DATE__) <= 31))
323
324 /** @brief Check if CALENDAR Weekday is valid.
325 * @param __WEEKDAY__ CALENDAR Weekday.
326 * @retval SET (__WEEKDAY__ is valid) or RESET (__WEEKDAY__ is invalid)
327 */
328 #define IS_CALENDAR_WEEKDAY(__WEEKDAY__) (((__WEEKDAY__) >= 0) && ((__WEEKDAY__) <= 6))
329
330 /** @brief Check if CALENDAR year is leap year.
331 * @param __YEAR__ CALENDAR Year.
332 * @retval SET (__YEAR__ is leap year) or RESET (__YEAR__ is nonleap year)
333 */
334 #define IS_CALENDAR_LEAP_YEAR(__YEAR__) ((((__YEAR__) % 4) == 0 && ((__YEAR__) % 100) != 0) || \
335 ((__YEAR__) % 400) == 0)
336
337 /** @} */
338
339 /** @} */
340
341 /* Exported functions --------------------------------------------------------*/
342 /** @addtogroup HAL_CALENDAR_DRIVER_FUNCTIONS Functions
343 * @{
344 */
345
346 /** @addtogroup CALENDAR_Exported_Functions_Group1 Initialization and de-initialization functions
347 * @brief Initialization and Configuration functions.
348 *
349 @verbatim
350 ==============================================================================
351 ##### Initialization and Configuration functions #####
352 ==============================================================================
353 [..]
354 This section provides functions allowing to:
355 (+) Initialize and start the CALENDAR according to the specified parameters
356 in the cslendar_init_t of associated handle.
357 (+) Initialize the CALENDAR MSP.
358
359 @endverbatim
360 * @{
361 */
362
363 /**
364 ****************************************************************************************
365 * @brief Initialize the CALENDAR according to the specified parameters in the
366 * calendar_init_t of associated handle.
367 *
368 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
369 * information for the specified CALENDAR module.
370 *
371 * @retval ::HAL_OK: Operation is OK.
372 * @retval ::HAL_ERROR: Parameter error or operation not supported.
373 * @retval ::HAL_BUSY: Driver is busy.
374 * @retval ::HAL_TIMEOUT: Timeout occurred.
375 ****************************************************************************************
376 */
377 hal_status_t hal_calendar_init(calendar_handle_t *p_calendar);
378
379 /**
380 ****************************************************************************************
381 * @brief De-initialize the CALENDAR peripheral.
382 *
383 * @param[in] p_calendar: CALENDAR handle.
384 *
385 * @retval ::HAL_OK: Operation is OK.
386 * @retval ::HAL_ERROR: Parameter error or operation not supported.
387 * @retval ::HAL_BUSY: Driver is busy.
388 * @retval ::HAL_TIMEOUT: Timeout occurred.
389 ****************************************************************************************
390 */
391 hal_status_t hal_calendar_deinit(calendar_handle_t *p_calendar);
392
393 /** @} */
394
395 /** @addtogroup CALENDAR_Exported_Functions_Group2 IO operation functions
396 * @brief IO operation functions
397 *
398 @verbatim
399 ==============================================================================
400 ##### IO operation functions #####
401 ==============================================================================
402 [..]
403 This section provides functions allowing to:
404 (+) Init the CALENDAR time.
405 (+) Get the CALENDAR time.
406 (+) Set the CALENDAR alarm.
407 (+) Disable the CALENDAR alarm.
408 (+) Handle CALENDAR interrupt request and associated function callback.
409
410 @endverbatim
411 * @{
412 */
413
414 /**
415 ****************************************************************************************
416 * @brief Initialize the CALENDAR time.
417 *
418 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
419 * information for the specified CALENDAR module.
420 * @param[in] p_time: Pointer to a CALENDAR time struction.
421 *
422 * @retval ::HAL_OK: Operation is OK.
423 * @retval ::HAL_ERROR: Parameter error or operation not supported.
424 * @retval ::HAL_BUSY: Driver is busy.
425 * @retval ::HAL_TIMEOUT: Timeout occurred.
426 ****************************************************************************************
427 */
428 hal_status_t hal_calendar_init_time(calendar_handle_t *p_calendar, calendar_time_t *p_time);
429
430 /**
431 ****************************************************************************************
432 * @brief Get current CALENDAR time.
433 *
434 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
435 * information for the specified CALENDAR module.
436 * @param[in] p_time: Pointer to a CALENDAR time struction.
437 *
438 * @retval ::HAL_OK: Operation is OK.
439 * @retval ::HAL_ERROR: Parameter error or operation not supported.
440 * @retval ::HAL_BUSY: Driver is busy.
441 * @retval ::HAL_TIMEOUT: Timeout occurred.
442 ****************************************************************************************
443 */
444 hal_status_t hal_calendar_get_time(calendar_handle_t *p_calendar, calendar_time_t *p_time);
445
446 /**
447 ****************************************************************************************
448 * @brief Set a CALENDAR date alarm.
449 *
450 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
451 * information for the specified CALENDAR module.
452 * @param[in] p_alarm: After seconds will generate an date alarm interrupt.
453 *
454 * @retval ::HAL_OK: Operation is OK.
455 * @retval ::HAL_ERROR: Parameter error or operation not supported.
456 * @retval ::HAL_BUSY: Driver is busy.
457 * @retval ::HAL_TIMEOUT: Timeout occurred.
458 ****************************************************************************************
459 */
460 hal_status_t hal_calendar_set_alarm(calendar_handle_t *p_calendar, calendar_alarm_t *p_alarm);
461
462 /**
463 ****************************************************************************************
464 * @brief Set a CALENDAR tick alarm.
465 *
466 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
467 * information for the specified CALENDAR module.
468 * @param[in] interval: After milliseconds will generate an milliseconds alarm interrupt.
469 * The value of interval is greater than or equal to 5ms.(Max: 3600*1000 ms)
470 *
471 * @retval ::HAL_OK: Operation is OK.
472 * @retval ::HAL_ERROR: Parameter error or operation not supported.
473 * @retval ::HAL_BUSY: Driver is busy.
474 * @retval ::HAL_TIMEOUT: Timeout occurred.
475 ****************************************************************************************
476 */
477 hal_status_t hal_calendar_set_tick(calendar_handle_t *p_calendar, uint32_t interval);
478
479 /**
480 ****************************************************************************************
481 * @brief Disable CALENDAR alarm event.
482 *
483 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
484 * information for the specified CALENDAR module.
485 * @param[in] disable_mode: Disable specified CALENDAR alarm mode.
486 * This parameter can be the following values:
487 * @arg @ref CALENDAR_ALARM_DISABLE_DATE
488 * @arg @ref CALENDAR_ALARM_DISABLE_TICK
489 * @arg @ref CALENDAR_ALARM_DISABLE_ALL
490 *
491 * @retval ::HAL_OK: Operation is OK.
492 * @retval ::HAL_ERROR: Parameter error or operation not supported.
493 * @retval ::HAL_BUSY: Driver is busy.
494 * @retval ::HAL_TIMEOUT: Timeout occurred.
495 ****************************************************************************************
496 */
497 hal_status_t hal_calendar_disable_event(calendar_handle_t *p_calendar, uint32_t disable_mode);
498
499 /** @} */
500
501
502 /** @addtogroup CALENDAR_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
503 * @brief IRQ Handler and Callbacks functions
504 * @{
505 */
506
507 /**
508 ****************************************************************************************
509 * @brief Handle CALENDAR interrupt request.
510 *
511 * @note When alarm is enabled, CALENDAR will generate an interrupt on conter match alarm value.
512 *
513 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
514 * information for the specified CALENDAR module.
515 ****************************************************************************************
516 */
517 void calendar_irq_handler(calendar_handle_t *p_calendar);
518
519 /**
520 ****************************************************************************************
521 * @brief CALENDAR date count complete callback.
522 *
523 * @note This function should not be modified. when the callback is needed,
524 * the hal_calendar_alarm_callback can be implemented in the user file.
525 *
526 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
527 * information for the specified CALENDAR module.
528 ****************************************************************************************
529 */
530 void hal_calendar_alarm_callback(calendar_handle_t *p_calendar);
531
532 /**
533 ****************************************************************************************
534 * @brief CALENDAR milliseconds count complete callback.
535 *
536 * @note This function should not be modified. when the callback is needed,
537 * the hal_calendar_tick_callback can be implemented in the user file.
538 *
539 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
540 * information for the specified CALENDAR module.
541 ****************************************************************************************
542 */
543 void hal_calendar_tick_callback(calendar_handle_t *p_calendar);
544
545 /**
546 ****************************************************************************************
547 * @brief CALENDAR overflow callback.
548 *
549 * @note This function should not be modified. when the callback is needed,
550 * the hal_calendar_overflow_callback can be implemented in the user file.
551 *
552 * @note The overflow time is about 36 hours.
553 *
554 * @param[in] p_calendar: Pointer to a CALENDAR handle which contains the configuration
555 * information for the specified CALENDAR module.
556 ****************************************************************************************
557 */
558 void hal_calendar_overflow_callback(calendar_handle_t *p_calendar);
559
560 /** @} */
561
562 /** @} */
563
564 #ifdef __cplusplus
565 }
566 #endif
567
568 #endif /* __GR55xx_HAL_CALENDAR_H__ */
569
570 /** @} */
571
572 /** @} */
573
574 /** @} */
_calendar_time::sec
uint8_t sec
Specifies the Calendar time seconds.
Definition: gr55xx_hal_calendar.h:97
_calendar_alarm::alarm_date_week_mask
uint8_t alarm_date_week_mask
Specifies the alarm date/weekday.
Definition: gr55xx_hal_calendar.h:136
_calendar_time::date
uint8_t date
Specifies the Calendar date.
Definition: gr55xx_hal_calendar.h:106
_calendar_time::min
uint8_t min
Specifies the Calendar time minutes.
Definition: gr55xx_hal_calendar.h:100
calendar_alarm_t
struct _calendar_alarm calendar_alarm_t
CALENDAR_Alarm calendar alarm structure definition.
hal_lock_t
hal_lock_t
HAL Lock structures definition.
Definition: gr55xx_hal_def.h:81
calendar_time_t
struct _calendar_time calendar_time_t
CALENDAR_Time calendar time structure definition.
_calendar_handle::state
hal_calender_state_t state
Calendar state.
Definition: gr55xx_hal_calendar.h:169
HAL_CALENDAR_STATE_ERROR
@ HAL_CALENDAR_STATE_ERROR
Peripheral in error
Definition: gr55xx_hal_calendar.h:78
_calendar_time::hour
uint8_t hour
Specifies the Calendar time hour.
Definition: gr55xx_hal_calendar.h:103
hal_calendar_alarm_callback
void hal_calendar_alarm_callback(calendar_handle_t *p_calendar)
CALENDAR date count complete callback.
hal_calendar_disable_event
hal_status_t hal_calendar_disable_event(calendar_handle_t *p_calendar, uint32_t disable_mode)
Disable CALENDAR alarm event.
hal_calendar_deinit
hal_status_t hal_calendar_deinit(calendar_handle_t *p_calendar)
De-initialize the CALENDAR peripheral.
_calendar_time::ms
uint16_t ms
Specifies the Calendar time milliseconds.
Definition: gr55xx_hal_calendar.h:118
hal_calender_state_t
hal_calender_state_t
HAL CALENDAR State Enumerations definition.
Definition: gr55xx_hal_calendar.h:75
hal_calendar_tick_callback
void hal_calendar_tick_callback(calendar_handle_t *p_calendar)
CALENDAR milliseconds count complete callback.
_calendar_handle::time_init
calendar_time_t time_init
Specifies the Calendar inital time.
Definition: gr55xx_hal_calendar.h:153
HAL_CALENDAR_STATE_RESET
@ HAL_CALENDAR_STATE_RESET
Peripheral not initialized
Definition: gr55xx_hal_calendar.h:76
_calendar_time::mon
uint8_t mon
Specifies the Calendar month.
Definition: gr55xx_hal_calendar.h:109
hal_calendar_get_time
hal_status_t hal_calendar_get_time(calendar_handle_t *p_calendar, calendar_time_t *p_time)
Get current CALENDAR time.
_hal_calendar_callback::calendar_alarm_callback
void(* calendar_alarm_callback)(calendar_handle_t *p_calendar)
CALENDAR date count complete callback.
Definition: gr55xx_hal_calendar.h:190
hal_calendar_init
hal_status_t hal_calendar_init(calendar_handle_t *p_calendar)
Initialize the CALENDAR according to the specified parameters in the calendar_init_t of associated ha...
_calendar_handle
CALENDAR handle Structure definition.
Definition: gr55xx_hal_calendar.h:152
hal_calendar_callback_t
struct _hal_calendar_callback hal_calendar_callback_t
HAL_CALENDAR Callback function definition.
hal_calendar_set_alarm
hal_status_t hal_calendar_set_alarm(calendar_handle_t *p_calendar, calendar_alarm_t *p_alarm)
Set a CALENDAR date alarm.
_calendar_handle::prev_ms
uint32_t prev_ms
Accumulated millisecond count .
Definition: gr55xx_hal_calendar.h:159
_calendar_alarm::alarm_sel
uint8_t alarm_sel
Specifies the alarm is on date or weekday.
Definition: gr55xx_hal_calendar.h:133
_calendar_handle::lock
hal_lock_t lock
Specifies the Calendar locking object.
Definition: gr55xx_hal_calendar.h:157
_calendar_handle::alarm
calendar_alarm_t alarm
Specifies the Calendar date alarm.
Definition: gr55xx_hal_calendar.h:155
_calendar_time::week
uint8_t week
Specifies the Calendar weekday.
Definition: gr55xx_hal_calendar.h:115
hal_calendar_init_time
hal_status_t hal_calendar_init_time(calendar_handle_t *p_calendar, calendar_time_t *p_time)
Initialize the CALENDAR time.
gr55xx_ll_calendar.h
Header file containing functions prototypes of CALENDAR LL library.
_calendar_handle::sec
uint8_t sec
The seconds for the date alarm.
Definition: gr55xx_hal_calendar.h:165
_calendar_handle::interval
uint32_t interval
Specifies the Calendar milliseconds alarm.
Definition: gr55xx_hal_calendar.h:161
_calendar_alarm
CALENDAR_Alarm calendar alarm structure definition.
Definition: gr55xx_hal_calendar.h:126
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
HAL_CALENDAR_STATE_READY
@ HAL_CALENDAR_STATE_READY
Peripheral initialized and ready for use
Definition: gr55xx_hal_calendar.h:77
_calendar_alarm::hour
uint8_t hour
Specifies the alarm time hour.
Definition: gr55xx_hal_calendar.h:130
hal_calendar_overflow_callback
void hal_calendar_overflow_callback(calendar_handle_t *p_calendar)
CALENDAR overflow callback.
_hal_calendar_callback
HAL_CALENDAR Callback function definition.
Definition: gr55xx_hal_calendar.h:189
hal_calendar_set_tick
hal_status_t hal_calendar_set_tick(calendar_handle_t *p_calendar, uint32_t interval)
Set a CALENDAR tick alarm.
calendar_handle_t
struct _calendar_handle calendar_handle_t
CALENDAR handle Structure definition.
_calendar_handle::ms
uint16_t ms
The milliseconds for the date alarm.
Definition: gr55xx_hal_calendar.h:167
_calendar_alarm::min
uint8_t min
Specifies the alarm time minutes.
Definition: gr55xx_hal_calendar.h:127
_hal_calendar_callback::calendar_overflow_callback
void(* calendar_overflow_callback)(calendar_handle_t *p_calendar)
CALENDAR count overflow callback.
Definition: gr55xx_hal_calendar.h:192
_calendar_handle::mode
uint8_t mode
Specifies the Calendar alarm mode.
Definition: gr55xx_hal_calendar.h:163
_hal_calendar_callback::calendar_tick_callback
void(* calendar_tick_callback)(calendar_handle_t *p_calendar)
CALENDAR tick count complete callback.
Definition: gr55xx_hal_calendar.h:191
calendar_irq_handler
void calendar_irq_handler(calendar_handle_t *p_calendar)
Handle CALENDAR interrupt request.
_calendar_time
CALENDAR_Time calendar time structure definition.
Definition: gr55xx_hal_calendar.h:96
_calendar_time::year
uint8_t year
Specifies the Calendar year which stars from 2010.
Definition: gr55xx_hal_calendar.h:112
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.