HPM SDK
HPMicro Software Development Kit
hpm_rtc_drv.h File Reference
#include "hpm_common.h"
#include "hpm_rtc_regs.h"
#include <sys/time.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  rtc_alarm_config_t
 RTC alarm configuration. More...
 

Macros

#define RTC_ALARM_TYPE_ONE_SHOT   (0U)
 RTC Alarm type. More...
 
#define RTC_ALARM_TYPE_PERIODIC   (1U)
 
#define RTC_ALARM_TYPE_ABSOLUTE_TIME_ONE_SHOT   (2U)
 
#define ALARM_PERIOD_ONE_SEC   (1UL)
 Typical RTC alarm period definitions. More...
 
#define ALARM_PERIOD_ONE_MIN   (60UL)
 
#define ALARM_PERIOD_ONE_HOUR   (3600U)
 
#define ALARM_PERIOD_ONE_DAY   (ALARM_PERIOD_ONE_HOUR * 24UL)
 

Functions

hpm_stat_t rtc_config_time (RTC_Type *base, time_t time)
 Configure the RTC time. More...
 
hpm_stat_t rtc_config_alarm (RTC_Type *base, rtc_alarm_config_t *config)
 Configure RTC Alarm. More...
 
time_t rtc_get_time (RTC_Type *base)
 Get the time returned by RTC module. More...
 
struct timeval rtc_get_timeval (RTC_Type *base)
 Get accurate time return by RTC module. More...
 
static void rtc_enable_alarm_interrupt (RTC_Type *base, uint32_t index, bool enable)
 Enable RTC alarm interrupt. More...
 
static void rtc_clear_alarm_flag (RTC_Type *base, uint32_t index)
 Clear RTC alarm flag based on alarm index. More...
 
static void rtc_clear_alarm_flags (RTC_Type *base, uint32_t masks)
 Clear RTC alarm flags based on flag masks. More...
 
static bool rtc_is_alarm_flag_asserted (RTC_Type *base, uint32_t index)
 Check whether RTC alarm flag is set or not. More...
 
static uint32_t rtc_get_alarm_flags (RTC_Type *base)
 Get the RTC alarm flags. More...