35 #define RTC_INIT_KEY 0xA5EB1357 36 #define RTC_WRITE_KEY 0xA965 38 #define RTC_WAIT_COUNT 0xFFFFFFFF 40 #define RTC_YEAR2000 2000 42 #define RTC_CLOCK_12 0 43 #define RTC_CLOCK_24 1 48 #define RTC_TICK_1_SEC ((uint32_t) 0x00000000) 49 #define RTC_TICK_1_2_SEC ((uint32_t) 0x00000001) 50 #define RTC_TICK_1_4_SEC ((uint32_t) 0x00000002) 51 #define RTC_TICK_1_8_SEC ((uint32_t) 0x00000003) 52 #define RTC_TICK_1_16_SEC ((uint32_t) 0x00000004) 53 #define RTC_TICK_1_32_SEC ((uint32_t) 0x00000005) 54 #define RTC_TICK_1_64_SEC ((uint32_t) 0x00000006) 55 #define RTC_TICK_1_128_SEC ((uint32_t) 0x00000007) 57 #define RTC_SUNDAY ((uint32_t) 0x00000000) 58 #define RTC_MONDAY ((uint32_t) 0x00000001) 59 #define RTC_TUESDAY ((uint32_t) 0x00000002) 60 #define RTC_WEDNESDAY ((uint32_t) 0x00000003) 61 #define RTC_THURSDAY ((uint32_t) 0x00000004) 62 #define RTC_FRIDAY ((uint32_t) 0x00000005) 63 #define RTC_SATURDAY ((uint32_t) 0x00000006) 66 #define RTC_SNOOPER_RISING 0 67 #define RTC_SNOOPER_FALLING 1 108 #define RTC_EnableSpareAccess() (RTC->SPRCTL |= RTC_SPRCTL_SPRRWEN_Msk) 118 #define RTC_READ_SPARE_REGISTER(u32RegNum) (RTC->SPR[u32RegNum]) 129 #define RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue) (RTC->SPR[u32RegNum] = u32RegValue) 140 #define RTC_IS_LEAP_YEAR() ((RTC->LEAPYEAR & (RTC_LEAPYEAR_LEAPYEAR_Msk))?1:0) 150 #define RTC_CLEAR_ALARM_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_ALMIF_Msk) 160 #define RTC_CLEAR_TICK_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_TICKIF_Msk) 170 #define RTC_GET_ALARM_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_ALMIF_Msk) >> RTC_INTSTS_ALMIF_Pos) 180 #define RTC_CLEAR_TAMPER_FLAG(u32PinNum) (RTC->INTSTS = RTC_INTSTS_SNPDIF_Msk) 190 #define RTC_GET_TICK_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_TICKIF_Msk) >> RTC_INTSTS_TICKIF_Pos) 201 #define RTC_GET_TAMPER_FLAG() ( (RTC->INTSTS & RTC_INTSTS_SNPDIF_Msk) >> RTC_INTSTS_SNPDIF_Pos) 213 void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm);
214 void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day);
215 void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm);
216 void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek);
void RTC_SetTickPeriod(uint32_t u32TickSelection)
The function is used to set time tick period for periodic time tick Interrupt.
void RTC_32KCalibration(int32_t i32FrequencyX100)
Set Frequency Compensation Data.
void RTC_DisableInt(uint32_t u32IntFlagMask)
The function is used to disable specified interrupt.
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_EnableTamperDetection(uint32_t u32PinCondition)
This function is used to: .
void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt)
Read current date/time from RTC setting.
void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day)
This function is used to set alarm date to RTC.
void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt)
Read alarm date/time from RTC setting.
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_EnableInt(uint32_t u32IntFlagMask)
The function is used to enable specified interrupt.
void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt)
This function is used to update date/time to RTC.
uint32_t RTC_GetDayOfWeek(void)
This function is used to get day of week.
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_Open(S_RTC_TIME_DATA_T *sPt)
This function is used to: .
RTC define Time Data Struct.
void RTC_Close(void)
Disable RTC clock.
void RTC_DisableTamperDetection(void)
This function is used to disable tamper detection function.
void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt)
This function is used to set alarm date/time to RTC.