STM32F10x Standard Peripherals Library  3.5.0
/opt/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rtc.h
Go to the documentation of this file.
00001 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __STM32F10x_RTC_H
00025 #define __STM32F10x_RTC_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32f10x.h"
00033 
00058 #define RTC_IT_OW            ((uint16_t)0x0004)  
00059 #define RTC_IT_ALR           ((uint16_t)0x0002)  
00060 #define RTC_IT_SEC           ((uint16_t)0x0001)  
00061 #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00))
00062 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \
00063                            ((IT) == RTC_IT_SEC))
00064 
00072 #define RTC_FLAG_RTOFF       ((uint16_t)0x0020)  
00073 #define RTC_FLAG_RSF         ((uint16_t)0x0008)  
00074 #define RTC_FLAG_OW          ((uint16_t)0x0004)  
00075 #define RTC_FLAG_ALR         ((uint16_t)0x0002)  
00076 #define RTC_FLAG_SEC         ((uint16_t)0x0001)  
00077 #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00))
00078 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \
00079                                ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \
00080                                ((FLAG) == RTC_FLAG_SEC))
00081 #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF)
00082 
00103 void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState);
00104 void RTC_EnterConfigMode(void);
00105 void RTC_ExitConfigMode(void);
00106 uint32_t  RTC_GetCounter(void);
00107 void RTC_SetCounter(uint32_t CounterValue);
00108 void RTC_SetPrescaler(uint32_t PrescalerValue);
00109 void RTC_SetAlarm(uint32_t AlarmValue);
00110 uint32_t  RTC_GetDivider(void);
00111 void RTC_WaitForLastTask(void);
00112 void RTC_WaitForSynchro(void);
00113 FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG);
00114 void RTC_ClearFlag(uint16_t RTC_FLAG);
00115 ITStatus RTC_GetITStatus(uint16_t RTC_IT);
00116 void RTC_ClearITPendingBit(uint16_t RTC_IT);
00117 
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121 
00122 #endif /* __STM32F10x_RTC_H */
00123 
00135 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/