STM32F1 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F1 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Groups
stm32f10x_rtc.h
Go to the documentation of this file.
1 
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef __STM32F10x_RTC_H
24 #define __STM32F10x_RTC_H
25 
26 #ifdef __cplusplus
27  extern "C" {
28 #endif
29 
30 /* Includes ------------------------------------------------------------------*/
31 #include "stm32f10x.h"
32 
57 #define RTC_IT_OW ((uint16_t)0x0004)
58 #define RTC_IT_ALR ((uint16_t)0x0002)
59 #define RTC_IT_SEC ((uint16_t)0x0001)
60 #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00))
61 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \
62  ((IT) == RTC_IT_SEC))
63 
71 #define RTC_FLAG_RTOFF ((uint16_t)0x0020)
72 #define RTC_FLAG_RSF ((uint16_t)0x0008)
73 #define RTC_FLAG_OW ((uint16_t)0x0004)
74 #define RTC_FLAG_ALR ((uint16_t)0x0002)
75 #define RTC_FLAG_SEC ((uint16_t)0x0001)
76 #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00))
77 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \
78  ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \
79  ((FLAG) == RTC_FLAG_SEC))
80 #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF)
81 
102 void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState);
103 void RTC_EnterConfigMode(void);
104 void RTC_ExitConfigMode(void);
105 uint32_t RTC_GetCounter(void);
106 void RTC_SetCounter(uint32_t CounterValue);
107 void RTC_SetPrescaler(uint32_t PrescalerValue);
108 void RTC_SetAlarm(uint32_t AlarmValue);
109 uint32_t RTC_GetDivider(void);
110 void RTC_WaitForLastTask(void);
111 void RTC_WaitForSynchro(void);
112 FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG);
113 void RTC_ClearFlag(uint16_t RTC_FLAG);
114 ITStatus RTC_GetITStatus(uint16_t RTC_IT);
115 void RTC_ClearITPendingBit(uint16_t RTC_IT);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif /* __STM32F10x_RTC_H */
122 
134 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/