11 #ifndef __MG32F10x_RTC_H 12 #define __MG32F10x_RTC_H 40 #define RTC_IT_OW ((uint16_t)0x0004) 41 #define RTC_IT_ALR ((uint16_t)0x0002) 42 #define RTC_IT_SEC ((uint16_t)0x0001) 43 #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00)) 44 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \ 54 #define RTC_FLAG_RTOFF ((uint16_t)0x0020) 55 #define RTC_FLAG_RSF ((uint16_t)0x0008) 56 #define RTC_FLAG_OW ((uint16_t)0x0004) 57 #define RTC_FLAG_ALR ((uint16_t)0x0002) 58 #define RTC_FLAG_SEC ((uint16_t)0x0001) 59 #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00)) 60 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \ 61 ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \ 62 ((FLAG) == RTC_FLAG_SEC)) 63 #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF) 76 void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState);
void RTC_ExitConfigMode(void)
Exits from the RTC configuration mode.
Definition: mg32f10x_rtc.c:86
FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG)
Checks whether the specified RTC flag is set or not.
Definition: mg32f10x_rtc.c:203
void RTC_SetCounter(uint32_t CounterValue)
Sets the RTC counter value.
Definition: mg32f10x_rtc.c:107
void RTC_WaitForLastTask(void)
Waits until last write operation on RTC registers has finished.
Definition: mg32f10x_rtc.c:166
ITStatus RTC_GetITStatus(uint16_t RTC_IT)
Checks whether the specified RTC interrupt has occurred or not.
Definition: mg32f10x_rtc.c:250
void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState)
Enables or disables the specified RTC interrupts.
Definition: mg32f10x_rtc.c:54
void RTC_ClearITPendingBit(uint16_t RTC_IT)
Clears the RTC's interrupt pending bits.
Definition: mg32f10x_rtc.c:277
void RTC_SetAlarm(uint32_t AlarmValue)
Sets the RTC alarm value.
Definition: mg32f10x_rtc.c:140
uint32_t RTC_GetDivider(void)
Gets the RTC divider value.
Definition: mg32f10x_rtc.c:155
void RTC_WaitForSynchro(void)
Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL) are synchronized with RTC APB clock.
Definition: mg32f10x_rtc.c:182
void RTC_EnterConfigMode(void)
Enters the RTC configuration mode.
Definition: mg32f10x_rtc.c:75
void RTC_SetPrescaler(uint32_t PrescalerValue)
Sets the RTC prescaler value.
Definition: mg32f10x_rtc.c:122
uint32_t RTC_GetCounter(void)
Gets the RTC counter value.
Definition: mg32f10x_rtc.c:97
void RTC_ClearFlag(uint16_t RTC_FLAG)
Clears the RTC's pending flags.
Definition: mg32f10x_rtc.c:232