35#define RTC_INIT_KEY 0xA5EB1357
36#define RTC_WRITE_KEY 0xA965
38#define RTC_WAIT_COUNT 0xFFFFFFFF
40#define RTC_YEAR2000 2000
41#define RTC_FCR_REFERENCE 32761
49#define RTC_TICK_1_SEC ((uint32_t) 0x00000000)
50#define RTC_TICK_1_2_SEC ((uint32_t) 0x00000001)
51#define RTC_TICK_1_4_SEC ((uint32_t) 0x00000002)
52#define RTC_TICK_1_8_SEC ((uint32_t) 0x00000003)
53#define RTC_TICK_1_16_SEC ((uint32_t) 0x00000004)
54#define RTC_TICK_1_32_SEC ((uint32_t) 0x00000005)
55#define RTC_TICK_1_64_SEC ((uint32_t) 0x00000006)
56#define RTC_TICK_1_128_SEC ((uint32_t) 0x00000007)
58#define RTC_SUNDAY ((uint32_t) 0x00000000)
59#define RTC_MONDAY ((uint32_t) 0x00000001)
60#define RTC_TUESDAY ((uint32_t) 0x00000002)
61#define RTC_WEDNESDAY ((uint32_t) 0x00000003)
62#define RTC_THURSDAY ((uint32_t) 0x00000004)
63#define RTC_FRIDAY ((uint32_t) 0x00000005)
64#define RTC_SATURDAY ((uint32_t) 0x00000006)
67#define RTC_SNOOPER_RISING 0
68#define RTC_SNOOPER_FALLING 1
109#define RTC_READ_SPARE_REGISTER(u32RegNum) (RTC->SPR[u32RegNum])
120#define RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue) (RTC->SPR[u32RegNum] = u32RegValue)
131#define RTC_IS_LEAP_YEAR() ((RTC->LIR & (RTC_LIR_LIR_Msk))?1:0)
141#define RTC_CLEAR_ALARM_INT_FLAG() (RTC->RIIR = RTC_RIIR_AIF_Msk)
151#define RTC_CLEAR_TICK_INT_FLAG() (RTC->RIIR = RTC_RIIR_TIF_Msk)
161#define RTC_GET_ALARM_INT_FLAG() ((RTC->RIIR & RTC_RIIR_AIF_Msk) >> RTC_RIIR_AIF_Pos)
171#define RTC_CLEAR_TAMPER_FLAG(u32PinNum) (RTC->RIIR = RTC_RIIR_SNOOPIF_Msk)
181#define RTC_GET_TICK_INT_FLAG() ((RTC->RIIR & RTC_RIIR_TIF_Msk) >> RTC_RIIR_TIF_Pos)
192#define RTC_GET_TAMPER_FLAG() ( (RTC->RIIR & RTC_RIIR_SNOOPIF_Msk) >> RTC_RIIR_SNOOPIF_Pos)
202#define RTC_ENABLE_TICK_WAKEUP() (RTC->TTR |= RTC_TTR_TWKE_Msk);
212#define RTC_DISABLE_TICK_WAKEUP() (RTC->TTR &= ~RTC_TTR_TWKE_Msk);
224void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm);
226void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm);
227void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek);
void RTC_EnableInt(uint32_t u32IntFlagMask)
The function is used to enable specified interrupt.
void RTC_32KCalibration(int32_t i32FrequencyX100)
Set Frequency Compensation Data.
uint32_t RTC_GetDayOfWeek(void)
This function is used to get day of week.
void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt)
This function is used to update date/time to RTC.
void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt)
Read alarm date/time from RTC setting.
void RTC_Open(S_RTC_TIME_DATA_T *sPt)
This function is used to: .
void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt)
This function is used to set alarm date/time to RTC.
void RTC_EnableTamperDetection(uint32_t u32PinCondition)
This function is used to: .
void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek)
This function is used to update date to RTC.
void RTC_Close(void)
Disable RTC clock.
void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
This function is used to update time to RTC.
void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
This function is used to set alarm date to RTC.
void RTC_DisableInt(uint32_t u32IntFlagMask)
The function is used to disable specified interrupt.
void RTC_DisableTamperDetection(void)
This function is used to disable tamper detection function.
void RTC_SetTickPeriod(uint32_t u32TickSelection)
The function is used to set time tick period for periodic time tick Interrupt.
void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day)
This function is used to set alarm date to RTC.
void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt)
Read current date/time from RTC setting.
RTC define Time Data Struct.