app_rtc.h
Go to the documentation of this file.
1
52 #ifndef _APP_RTC_H_
53 #define _APP_RTC_H_
54
55 #include "gr55xx_hal.h"
56 #include "app_drv_error.h"
57 #include "app_rtos_cfg.h"
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62
63 #ifdef HAL_CALENDAR_MODULE_ENABLED
64
73 #define APP_RTC_ALARM_DISABLE_DATE CALENDAR_ALARM_DISABLE_DATE
74 #define APP_RTC_ALARM_DISABLE_TICK CALENDAR_ALARM_DISABLE_TICK
75 #define APP_RTC_ALARM_DISABLE_ALL CALENDAR_ALARM_DISABLE_ALL
84 typedef enum
85 {
86 APP_RTC_EVT_DATE_ALARM,
87 APP_RTC_EVT_TICK_ALARM,
88 } app_rtc_evt_type_t;
97 typedef calendar_time_t app_rtc_time_t;
98
102 typedef calendar_alarm_t app_rtc_alarm_t;
103
104
108 typedef struct
109 {
110 app_rtc_evt_type_t type;
111 } app_rtc_evt_t;
112
116 typedef void (*app_rtc_evt_handler_t)(app_rtc_evt_t *p_evt);
117
121 /* Exported functions --------------------------------------------------------*/
134 uint16_t app_rtc_init(app_rtc_evt_handler_t evt_handler);
135
143 uint16_t app_rtc_deinit(void);
144
154 uint16_t app_rtc_init_time(app_rtc_time_t *p_time);
155
165 uint16_t app_rtc_get_time(app_rtc_time_t *p_time);
166
176 uint16_t app_rtc_setup_alarm(app_rtc_alarm_t *p_alarm);
177
188 uint16_t app_rtc_setup_tick(uint32_t interval);
189
203 uint16_t app_rtc_disable_event(uint32_t disable_mode);
204
207 #endif
208
209 #ifdef __cplusplus
210 }
211 #endif
212
213 #endif
214
app_rtc_disable_event
uint16_t app_rtc_disable_event(uint32_t disable_mode)
Disable rtc alarm event.
app_rtc_evt_t::type
app_rtc_evt_type_t type
Definition: app_rtc.h:110
app_rtc_setup_tick
uint16_t app_rtc_setup_tick(uint32_t interval)
Set a rtc tick alarm.
app_rtc_deinit
uint16_t app_rtc_deinit(void)
De-initialize the app rtc.
app_rtc_init_time
uint16_t app_rtc_init_time(app_rtc_time_t *p_time)
Initialize the rtc time.
app_rtc_get_time
uint16_t app_rtc_get_time(app_rtc_time_t *p_time)
Get current rtc time.
app_rtc_time_t
calendar_time_t app_rtc_time_t
App time structure definition.
Definition: app_rtc.h:97
app_rtc_evt_handler_t
void(* app_rtc_evt_handler_t)(app_rtc_evt_t *p_evt)
RTC event callback definition.
Definition: app_rtc.h:116
app_rtc_setup_alarm
uint16_t app_rtc_setup_alarm(app_rtc_alarm_t *p_alarm)
Set a rtc date alarm.
APP_RTC_EVT_TICK_ALARM
@ APP_RTC_EVT_TICK_ALARM
Definition: app_rtc.h:87
_calendar_alarm
CALENDAR_Alarm calendar alarm structure definition.
Definition: gr55xx_hal_calendar.h:126
gr55xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_rtc_evt_type_t
app_rtc_evt_type_t
RTC event Enumerations definition.
Definition: app_rtc.h:85
APP_RTC_EVT_DATE_ALARM
@ APP_RTC_EVT_DATE_ALARM
Definition: app_rtc.h:86
_calendar_time
CALENDAR_Time calendar time structure definition.
Definition: gr55xx_hal_calendar.h:96
app_rtc_evt_t
RTC event structure definition.
Definition: app_rtc.h:109
app_rtos_cfg.h
Header file of app rtos config code.
app_drv_error.h
Header file of app driver error code.
app_rtc_alarm_t
calendar_alarm_t app_rtc_alarm_t
App alarm structure definition.
Definition: app_rtc.h:102
app_rtc_init
uint16_t app_rtc_init(app_rtc_evt_handler_t evt_handler)
Initialize the APP RTC DRIVER.