31#define RTC_INIT_KEY 0xA5EB1357UL
32#define RTC_WRITE_KEY 0x0000A965UL
45#define RTC_TICK_1_SEC 0x0UL
46#define RTC_TICK_1_2_SEC 0x1UL
47#define RTC_TICK_1_4_SEC 0x2UL
48#define RTC_TICK_1_8_SEC 0x3UL
49#define RTC_TICK_1_16_SEC 0x4UL
50#define RTC_TICK_1_32_SEC 0x5UL
51#define RTC_TICK_1_64_SEC 0x6UL
52#define RTC_TICK_1_128_SEC 0x7UL
57#define RTC_SUNDAY 0x0UL
58#define RTC_MONDAY 0x1UL
59#define RTC_TUESDAY 0x2UL
60#define RTC_WEDNESDAY 0x3UL
61#define RTC_THURSDAY 0x4UL
62#define RTC_FRIDAY 0x5UL
63#define RTC_SATURDAY 0x6UL
68#define RTC_SNOOPER_LOW_LEVEL 0x0UL
69#define RTC_SNOOPER_HIGH_LEVEL 0x2UL
70#define RTC_SNOOPER_FALLING_EDGE 0x8UL
71#define RTC_SNOOPER_RISING_EDGE 0xAUL
72#define RTC_SNOOPER_DETECT_Msk 0xAUL
77#define RTC_WAIT_COUNT 0xFFFFFFFF
78#define RTC_YEAR2000 2000
79#define RTC_FCR_REFERENCE 32761
120#define RTC_IS_LEAP_YEAR() (RTC->LEAPYEAR & RTC_LEAPYEAR_LEAPYEAR_Msk ? 1:0)
131#define RTC_CLEAR_ALARM_INT_FLAG() (RTC->INTSTS = (RTC->INTSTS & ~(RTC_INTSTS_TICKIF_Msk | RTC_INTSTS_SNPDIF_Msk)) | RTC_INTSTS_ALMIF_Msk)
142#define RTC_CLEAR_TICK_INT_FLAG() (RTC->INTSTS = (RTC->INTSTS & ~(RTC_INTSTS_ALMIF_Msk | RTC_INTSTS_SNPDIF_Msk)) | RTC_INTSTS_TICKIF_Msk)
153#define RTC_CLEAR_SNOOPER_INT_FLAG() (RTC->INTSTS = (RTC->INTSTS & ~(RTC_INTSTS_ALMIF_Msk | RTC_INTSTS_TICKIF_Msk)) | RTC_INTSTS_SNPDIF_Msk)
165#define RTC_GET_ALARM_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_ALMIF_Msk)? 1:0)
177#define RTC_GET_TICK_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_TICKIF_Msk)? 1:0)
189#define RTC_GET_SNPPOER_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_SNPDIF_Msk)? 1:0)
202#define RTC_READ_SPARE_REGISTER(u32RegNum) (RTC->SPR[(u32RegNum)])
216#define RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue) (RTC->SPR[(u32RegNum)] = (u32RegValue))
238 if(i32TimeoutCnt == 0)
251void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek);
252void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm);
254void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm);
#define RTC_RWEN_RWENF_Msk
void RTC_EnableInt(uint32_t u32IntFlagMask)
Enable RTC Interrupt.
void RTC_DisableSnooperDetection(void)
Disable Snooper Pin Detect.
uint32_t RTC_GetDayOfWeek(void)
Get Day of the Week.
void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt)
Update Current RTC Date and Time.
void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt)
Get RTC Alarm Date and Time.
void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt)
Update RTC Alarm Date and Time.
void RTC_EnableSpareAccess(void)
Enable Spare Registers Access.
int32_t RTC_Open(S_RTC_TIME_DATA_T *sPt)
Initialize RTC module and start counting.
static __INLINE int32_t RTC_WaitAccessEnable(void)
Wait RTC Access Enable.
void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek)
Update RTC Current Date.
void RTC_Close(void)
Disable RTC Clock.
void RTC_32KCalibration(int32_t i32FrequencyX100)
Set 32k Frequency Compensation Data.
void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
Update RTC Current Time.
void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
Update RTC Alarm Time.
void RTC_DisableInt(uint32_t u32IntFlagMask)
Disable RTC Interrupt.
void RTC_DisableSpareRegister(void)
Disable Spare Register.
void RTC_SetTickPeriod(uint32_t u32TickSelection)
Set RTC Tick Period Time.
void RTC_EnableSnooperDetection(uint32_t u32PinCondition)
Enable Snooper Pin Detect.
void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day)
Update RTC Alarm Date.
void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt)
Get Current RTC Date and Time.