19 #include "hpm_rtc_regs.h"
37 #define RTC_ALARM_TYPE_ONE_SHOT (0U)
38 #define RTC_ALARM_TYPE_PERIODIC (1U)
39 #define RTC_ALARM_TYPE_ABSOLUTE_TIME_ONE_SHOT (2U)
44 #define ALARM_PERIOD_ONE_SEC (1UL)
45 #define ALARM_PERIOD_ONE_MIN (60UL)
46 #define ALARM_PERIOD_ONE_HOUR (3600U)
47 #define ALARM_PERIOD_ONE_DAY (ALARM_PERIOD_ONE_HOUR * 24UL)
#define RTC_ALARM_EN_ENABLE1_MASK
Definition: hpm_rtc_regs.h:142
#define RTC_ALARM_EN_ENABLE0_MASK
Definition: hpm_rtc_regs.h:154
#define RTC_ALARM_FLAG_ALARM0_MASK
Definition: hpm_rtc_regs.h:129
#define RTC_ALARM_FLAG_ALARM1_MASK
Definition: hpm_rtc_regs.h:119
uint32_t hpm_stat_t
Definition: hpm_common.h:126
#define IS_HPM_BITMASK_SET(val, mask)
Definition: hpm_common.h:61
static void rtc_enable_alarm_interrupt(RTC_Type *base, uint32_t index, bool enable)
Enable RTC alarm interrupt.
Definition: hpm_rtc_drv.h:93
hpm_stat_t rtc_config_alarm(RTC_Type *base, rtc_alarm_config_t *config)
Configure RTC Alarm.
Definition: hpm_rtc_drv.c:39
static uint32_t rtc_get_alarm_flags(RTC_Type *base)
Get the RTC alarm flags.
Definition: hpm_rtc_drv.h:154
hpm_stat_t rtc_config_time(RTC_Type *base, time_t time)
Configure the RTC time.
Definition: hpm_rtc_drv.c:12
static bool rtc_is_alarm_flag_asserted(RTC_Type *base, uint32_t index)
Check whether RTC alarm flag is set or not.
Definition: hpm_rtc_drv.h:139
static void rtc_clear_alarm_flags(RTC_Type *base, uint32_t masks)
Clear RTC alarm flags based on flag masks.
Definition: hpm_rtc_drv.h:128
struct timeval rtc_get_timeval(RTC_Type *base)
Get accurate time return by RTC module.
Definition: hpm_rtc_drv.c:24
static void rtc_clear_alarm_flag(RTC_Type *base, uint32_t index)
Clear RTC alarm flag based on alarm index.
Definition: hpm_rtc_drv.h:113
time_t rtc_get_time(RTC_Type *base)
Get the time returned by RTC module.
Definition: hpm_rtc_drv.c:18
Definition: hpm_rtc_regs.h:12
__RW uint32_t ALARM_FLAG
Definition: hpm_rtc_regs.h:21
__RW uint32_t ALARM_EN
Definition: hpm_rtc_regs.h:22
RTC alarm configuration.
Definition: hpm_rtc_drv.h:28
uint16_t type
Definition: hpm_rtc_drv.h:30
uint16_t index
Definition: hpm_rtc_drv.h:29
time_t period
Definition: hpm_rtc_drv.h:31