Go to the documentation of this file.
51 #ifndef __GR55XX_HAL_RTC_H__
52 #define __GR55XX_HAL_RTC_H__
75 #define RTC_FLAG_ALARM RTC_INT_STAT_ALARM
76 #define RTC_FLAG_WRAP RTC_INT_STAT_WRAP
77 #define RTC_FLAG_TICK RTC_INT_STAT_TICK
83 #define RTC_IT_ALARM RTC_INT_EN_ALARM
84 #define RTC_IT_WRAP RTC_INT_EN_WRAP
85 #define RTC_IT_TICK RTC_INT_EN_TICK
91 #define HAL_RTC_ERROR_NONE (0x00000000U)
92 #define HAL_RTC_ERROR_INVALID_PARAM (0x00000001U)
93 #define HAL_RTC_ERROR_TIMEOUT (0x00000002U)
99 #define RTC_DIV_NONE LL_RTC_DIV_NONE
100 #define RTC_DIV_2 LL_RTC_DIV_2
101 #define RTC_DIV_4 LL_RTC_DIV_4
102 #define RTC_DIV_8 LL_RTC_DIV_8
103 #define RTC_DIV_16 LL_RTC_DIV_16
104 #define RTC_DIV_32 LL_RTC_DIV_32
105 #define RTC_DIV_64 LL_RTC_DIV_64
106 #define RTC_DIV_128 LL_RTC_DIV_128
112 #define ONE_TIME LL_RTC_TIMER_TICK_TYPE_SINGLE
113 #define AUTO_RELOAD LL_RTC_TIMER_TICK_TYPE_AUTO
123 #define __HAL_RTC_DISABLE(RTCx) MODIFY_REG(RTCx->CFG0, 0xFFFFFFFF, RTC_CFG0_CFG);
125 #define __HAL_RTC_ENABLE(RTCx) SET_BITS(RTCx->CFG0, RTC_CFG0_CFG | RTC_CFG0_EN);
127 #define __HAL_RTC_BUSY_FLAG(RTCx) ((READ_BITS(RTCx->STAT, RTC_STAT_BUSY) == RTC_STAT_BUSY))
129 #define __HAL_RTC_CLEAR_FLAG(RTCx, __FLAG__) WRITE_REG(RTCx->INT_STAT, (__FLAG__))
131 #define __HAL_RTC_ENABLE_IT(RTCx, __INTERRUPT__) SET_BITS(RTCx->INT_EN, (__INTERRUPT__))
133 #define __HAL_RTC_DISABLE_IT(RTCx, __INTERRUPT__) CLEAR_BITS(RTCx->INT_EN, (__INTERRUPT__))
135 #define __HAL_RTC_GET_IT_SOURCE(RTCx, __FLAG__) (READ_BITS(RTCx->INT_STAT, (__FLAG__)) == (__FLAG__))
137 #define __HAL_RTC_CFG_EFFECT(RTCx) SET_BITS(RTCx->CFG0, RTC_CFG0_CFG)
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...
hal_lock_t
HAL Lock structures definition.
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....
uint32_t hal_rtc_get_cur_count(rtc_handle_t *p_rtc)
Get_cur_count_value.
__IO rtc_alarm_state_t state
void hal_rtc_alarm_callback(rtc_handle_t *p_rtc)
alarm_callback
void hal_rtc_tick_callback(rtc_handle_t *p_rtc)
tick_callback
__IO rtc_tick_state_t state
hal_rtc_state_t hal_rtc_get_state(rtc_handle_t *p_rtc)
Get_cur_rtc_state.
struct _tick_handle_t tick_handle_t
overflow_det_t overflow_det_state
hal_status_t hal_rtc_stop_alarm(rtc_handle_t *p_rtc)
Stop counting up and compare with alarm_value for alarm module.
hal_rtc_state_t
hal_rtc_state definition
HAL_RTC Callback function definition.
void hal_rtc_irq_handler(rtc_handle_t *p_rtc)
RTC_IRQHandler.
uint32_t hal_rtc_get_cur_tick(rtc_handle_t *p_rtc)
Get_cur_tick_value.
struct _rtc_handle_t rtc_handle_t
rtc handle definition
hal_status_t hal_rtc_stop_tick(rtc_handle_t *p_rtc)
Stop counting down for tick module.
void(* rtc_tick_callback)(rtc_handle_t *p_rtc)
void(* rtc_alarm_callback)(rtc_handle_t *p_rtc)
rtc_alarm_state_t
rtc_alarm_state definition
__IO hal_rtc_state_t state
hal_status_t hal_rtc_clear_wrap(rtc_handle_t *p_rtc)
Clear wrap count.
uint32_t hal_rtc_get_alarm_value(rtc_handle_t *p_rtc)
Get_alarm_value.
uint32_t hal_rtc_get_wrap_count(rtc_handle_t *p_rtc)
Get the times of overflow.
hal_status_t hal_rtc_set_alarm(rtc_handle_t *p_rtc, uint32_t value)
Compare counter with alarm_value for alarm module.
struct _alarm_handle_t alarm_handle_t
Header file containing functions prototypes of CALENDAR LL library.
void(* rtc_overflow_callback)(rtc_handle_t *p_rtc)
hal_status_t
HAL Status structures definition.
overflow_det_t
overflow config
struct _hal_rtc_callback hal_rtc_callback_t
HAL_RTC Callback function definition.
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....
struct _rtc_init_t rtc_init_t
rtc init params
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.
rtc_tick_state_t
rtc_tick_state definition
void hal_rtc_overflow_callback(rtc_handle_t *p_rtc)
overflow_callback
This file contains HAL common definitions, enumeration, macros and structures definitions.