stm32f4xx_rtc.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_rtc.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 30-September-2011
  7. * @brief This file contains all the functions prototypes for the RTC firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  20. ******************************************************************************
  21. */
  22. /* Define to prevent recursive inclusion -------------------------------------*/
  23. #ifndef __STM32F4xx_RTC_H
  24. #define __STM32F4xx_RTC_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f4xx.h"
  30. /** @addtogroup STM32F4xx_StdPeriph_Driver
  31. * @{
  32. */
  33. /** @addtogroup RTC
  34. * @{
  35. */
  36. /* Exported types ------------------------------------------------------------*/
  37. /**
  38. * @brief RTC Init structures definition
  39. */
  40. typedef struct
  41. {
  42. uint32_t RTC_HourFormat; /*!< Specifies the RTC Hour Format.
  43. This parameter can be a value of @ref RTC_Hour_Formats */
  44. uint32_t RTC_AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value.
  45. This parameter must be set to a value lower than 0x7F */
  46. uint32_t RTC_SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value.
  47. This parameter must be set to a value lower than 0x7FFF */
  48. }RTC_InitTypeDef;
  49. /**
  50. * @brief RTC Time structure definition
  51. */
  52. typedef struct
  53. {
  54. uint8_t RTC_Hours; /*!< Specifies the RTC Time Hour.
  55. This parameter must be set to a value in the 0-12 range
  56. if the RTC_HourFormat_12 is selected or 0-23 range if
  57. the RTC_HourFormat_24 is selected. */
  58. uint8_t RTC_Minutes; /*!< Specifies the RTC Time Minutes.
  59. This parameter must be set to a value in the 0-59 range. */
  60. uint8_t RTC_Seconds; /*!< Specifies the RTC Time Seconds.
  61. This parameter must be set to a value in the 0-59 range. */
  62. uint8_t RTC_H12; /*!< Specifies the RTC AM/PM Time.
  63. This parameter can be a value of @ref RTC_AM_PM_Definitions */
  64. }RTC_TimeTypeDef;
  65. /**
  66. * @brief RTC Date structure definition
  67. */
  68. typedef struct
  69. {
  70. uint8_t RTC_WeekDay; /*!< Specifies the RTC Date WeekDay.
  71. This parameter can be a value of @ref RTC_WeekDay_Definitions */
  72. uint8_t RTC_Month; /*!< Specifies the RTC Date Month (in BCD format).
  73. This parameter can be a value of @ref RTC_Month_Date_Definitions */
  74. uint8_t RTC_Date; /*!< Specifies the RTC Date.
  75. This parameter must be set to a value in the 1-31 range. */
  76. uint8_t RTC_Year; /*!< Specifies the RTC Date Year.
  77. This parameter must be set to a value in the 0-99 range. */
  78. }RTC_DateTypeDef;
  79. /**
  80. * @brief RTC Alarm structure definition
  81. */
  82. typedef struct
  83. {
  84. RTC_TimeTypeDef RTC_AlarmTime; /*!< Specifies the RTC Alarm Time members. */
  85. uint32_t RTC_AlarmMask; /*!< Specifies the RTC Alarm Masks.
  86. This parameter can be a value of @ref RTC_AlarmMask_Definitions */
  87. uint32_t RTC_AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay.
  88. This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */
  89. uint8_t RTC_AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay.
  90. If the Alarm Date is selected, this parameter
  91. must be set to a value in the 1-31 range.
  92. If the Alarm WeekDay is selected, this
  93. parameter can be a value of @ref RTC_WeekDay_Definitions */
  94. }RTC_AlarmTypeDef;
  95. /* Exported constants --------------------------------------------------------*/
  96. /** @defgroup RTC_Exported_Constants
  97. * @{
  98. */
  99. /** @defgroup RTC_Hour_Formats
  100. * @{
  101. */
  102. #define RTC_HourFormat_24 ((uint32_t)0x00000000)
  103. #define RTC_HourFormat_12 ((uint32_t)0x00000040)
  104. #define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HourFormat_12) || \
  105. ((FORMAT) == RTC_HourFormat_24))
  106. /**
  107. * @}
  108. */
  109. /** @defgroup RTC_Asynchronous_Predivider
  110. * @{
  111. */
  112. #define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7F)
  113. /**
  114. * @}
  115. */
  116. /** @defgroup RTC_Synchronous_Predivider
  117. * @{
  118. */
  119. #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FFF)
  120. /**
  121. * @}
  122. */
  123. /** @defgroup RTC_Time_Definitions
  124. * @{
  125. */
  126. #define IS_RTC_HOUR12(HOUR) (((HOUR) > 0) && ((HOUR) <= 12))
  127. #define IS_RTC_HOUR24(HOUR) ((HOUR) <= 23)
  128. #define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59)
  129. #define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59)
  130. /**
  131. * @}
  132. */
  133. /** @defgroup RTC_AM_PM_Definitions
  134. * @{
  135. */
  136. #define RTC_H12_AM ((uint8_t)0x00)
  137. #define RTC_H12_PM ((uint8_t)0x40)
  138. #define IS_RTC_H12(PM) (((PM) == RTC_H12_AM) || ((PM) == RTC_H12_PM))
  139. /**
  140. * @}
  141. */
  142. /** @defgroup RTC_Year_Date_Definitions
  143. * @{
  144. */
  145. #define IS_RTC_YEAR(YEAR) ((YEAR) <= 99)
  146. /**
  147. * @}
  148. */
  149. /** @defgroup RTC_Month_Date_Definitions
  150. * @{
  151. */
  152. /* Coded in BCD format */
  153. #define RTC_Month_January ((uint8_t)0x01)
  154. #define RTC_Month_February ((uint8_t)0x02)
  155. #define RTC_Month_March ((uint8_t)0x03)
  156. #define RTC_Month_April ((uint8_t)0x04)
  157. #define RTC_Month_May ((uint8_t)0x05)
  158. #define RTC_Month_June ((uint8_t)0x06)
  159. #define RTC_Month_July ((uint8_t)0x07)
  160. #define RTC_Month_August ((uint8_t)0x08)
  161. #define RTC_Month_September ((uint8_t)0x09)
  162. #define RTC_Month_October ((uint8_t)0x10)
  163. #define RTC_Month_November ((uint8_t)0x11)
  164. #define RTC_Month_December ((uint8_t)0x12)
  165. #define IS_RTC_MONTH(MONTH) (((MONTH) >= 1) && ((MONTH) <= 12))
  166. #define IS_RTC_DATE(DATE) (((DATE) >= 1) && ((DATE) <= 31))
  167. /**
  168. * @}
  169. */
  170. /** @defgroup RTC_WeekDay_Definitions
  171. * @{
  172. */
  173. #define RTC_Weekday_Monday ((uint8_t)0x01)
  174. #define RTC_Weekday_Tuesday ((uint8_t)0x02)
  175. #define RTC_Weekday_Wednesday ((uint8_t)0x03)
  176. #define RTC_Weekday_Thursday ((uint8_t)0x04)
  177. #define RTC_Weekday_Friday ((uint8_t)0x05)
  178. #define RTC_Weekday_Saturday ((uint8_t)0x06)
  179. #define RTC_Weekday_Sunday ((uint8_t)0x07)
  180. #define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
  181. ((WEEKDAY) == RTC_Weekday_Tuesday) || \
  182. ((WEEKDAY) == RTC_Weekday_Wednesday) || \
  183. ((WEEKDAY) == RTC_Weekday_Thursday) || \
  184. ((WEEKDAY) == RTC_Weekday_Friday) || \
  185. ((WEEKDAY) == RTC_Weekday_Saturday) || \
  186. ((WEEKDAY) == RTC_Weekday_Sunday))
  187. /**
  188. * @}
  189. */
  190. /** @defgroup RTC_Alarm_Definitions
  191. * @{
  192. */
  193. #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) > 0) && ((DATE) <= 31))
  194. #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
  195. ((WEEKDAY) == RTC_Weekday_Tuesday) || \
  196. ((WEEKDAY) == RTC_Weekday_Wednesday) || \
  197. ((WEEKDAY) == RTC_Weekday_Thursday) || \
  198. ((WEEKDAY) == RTC_Weekday_Friday) || \
  199. ((WEEKDAY) == RTC_Weekday_Saturday) || \
  200. ((WEEKDAY) == RTC_Weekday_Sunday))
  201. /**
  202. * @}
  203. */
  204. /** @defgroup RTC_AlarmDateWeekDay_Definitions
  205. * @{
  206. */
  207. #define RTC_AlarmDateWeekDaySel_Date ((uint32_t)0x00000000)
  208. #define RTC_AlarmDateWeekDaySel_WeekDay ((uint32_t)0x40000000)
  209. #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_AlarmDateWeekDaySel_Date) || \
  210. ((SEL) == RTC_AlarmDateWeekDaySel_WeekDay))
  211. /**
  212. * @}
  213. */
  214. /** @defgroup RTC_AlarmMask_Definitions
  215. * @{
  216. */
  217. #define RTC_AlarmMask_None ((uint32_t)0x00000000)
  218. #define RTC_AlarmMask_DateWeekDay ((uint32_t)0x80000000)
  219. #define RTC_AlarmMask_Hours ((uint32_t)0x00800000)
  220. #define RTC_AlarmMask_Minutes ((uint32_t)0x00008000)
  221. #define RTC_AlarmMask_Seconds ((uint32_t)0x00000080)
  222. #define RTC_AlarmMask_All ((uint32_t)0x80808080)
  223. #define IS_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET)
  224. /**
  225. * @}
  226. */
  227. /** @defgroup RTC_Alarms_Definitions
  228. * @{
  229. */
  230. #define RTC_Alarm_A ((uint32_t)0x00000100)
  231. #define RTC_Alarm_B ((uint32_t)0x00000200)
  232. #define IS_RTC_ALARM(ALARM) (((ALARM) == RTC_Alarm_A) || ((ALARM) == RTC_Alarm_B))
  233. #define IS_RTC_CMD_ALARM(ALARM) (((ALARM) & (RTC_Alarm_A | RTC_Alarm_B)) != (uint32_t)RESET)
  234. /**
  235. * @}
  236. */
  237. /** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions
  238. * @{
  239. */
  240. #define RTC_AlarmSubSecondMask_All ((uint32_t)0x00000000) /*!< All Alarm SS fields are masked.
  241. There is no comparison on sub seconds
  242. for Alarm */
  243. #define RTC_AlarmSubSecondMask_SS14_1 ((uint32_t)0x01000000) /*!< SS[14:1] are don't care in Alarm
  244. comparison. Only SS[0] is compared. */
  245. #define RTC_AlarmSubSecondMask_SS14_2 ((uint32_t)0x02000000) /*!< SS[14:2] are don't care in Alarm
  246. comparison. Only SS[1:0] are compared */
  247. #define RTC_AlarmSubSecondMask_SS14_3 ((uint32_t)0x03000000) /*!< SS[14:3] are don't care in Alarm
  248. comparison. Only SS[2:0] are compared */
  249. #define RTC_AlarmSubSecondMask_SS14_4 ((uint32_t)0x04000000) /*!< SS[14:4] are don't care in Alarm
  250. comparison. Only SS[3:0] are compared */
  251. #define RTC_AlarmSubSecondMask_SS14_5 ((uint32_t)0x05000000) /*!< SS[14:5] are don't care in Alarm
  252. comparison. Only SS[4:0] are compared */
  253. #define RTC_AlarmSubSecondMask_SS14_6 ((uint32_t)0x06000000) /*!< SS[14:6] are don't care in Alarm
  254. comparison. Only SS[5:0] are compared */
  255. #define RTC_AlarmSubSecondMask_SS14_7 ((uint32_t)0x07000000) /*!< SS[14:7] are don't care in Alarm
  256. comparison. Only SS[6:0] are compared */
  257. #define RTC_AlarmSubSecondMask_SS14_8 ((uint32_t)0x08000000) /*!< SS[14:8] are don't care in Alarm
  258. comparison. Only SS[7:0] are compared */
  259. #define RTC_AlarmSubSecondMask_SS14_9 ((uint32_t)0x09000000) /*!< SS[14:9] are don't care in Alarm
  260. comparison. Only SS[8:0] are compared */
  261. #define RTC_AlarmSubSecondMask_SS14_10 ((uint32_t)0x0A000000) /*!< SS[14:10] are don't care in Alarm
  262. comparison. Only SS[9:0] are compared */
  263. #define RTC_AlarmSubSecondMask_SS14_11 ((uint32_t)0x0B000000) /*!< SS[14:11] are don't care in Alarm
  264. comparison. Only SS[10:0] are compared */
  265. #define RTC_AlarmSubSecondMask_SS14_12 ((uint32_t)0x0C000000) /*!< SS[14:12] are don't care in Alarm
  266. comparison.Only SS[11:0] are compared */
  267. #define RTC_AlarmSubSecondMask_SS14_13 ((uint32_t)0x0D000000) /*!< SS[14:13] are don't care in Alarm
  268. comparison. Only SS[12:0] are compared */
  269. #define RTC_AlarmSubSecondMask_SS14 ((uint32_t)0x0E000000) /*!< SS[14] is don't care in Alarm
  270. comparison.Only SS[13:0] are compared */
  271. #define RTC_AlarmSubSecondMask_None ((uint32_t)0x0F000000) /*!< SS[14:0] are compared and must match
  272. to activate alarm. */
  273. #define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_AlarmSubSecondMask_All) || \
  274. ((MASK) == RTC_AlarmSubSecondMask_SS14_1) || \
  275. ((MASK) == RTC_AlarmSubSecondMask_SS14_2) || \
  276. ((MASK) == RTC_AlarmSubSecondMask_SS14_3) || \
  277. ((MASK) == RTC_AlarmSubSecondMask_SS14_4) || \
  278. ((MASK) == RTC_AlarmSubSecondMask_SS14_5) || \
  279. ((MASK) == RTC_AlarmSubSecondMask_SS14_6) || \
  280. ((MASK) == RTC_AlarmSubSecondMask_SS14_7) || \
  281. ((MASK) == RTC_AlarmSubSecondMask_SS14_8) || \
  282. ((MASK) == RTC_AlarmSubSecondMask_SS14_9) || \
  283. ((MASK) == RTC_AlarmSubSecondMask_SS14_10) || \
  284. ((MASK) == RTC_AlarmSubSecondMask_SS14_11) || \
  285. ((MASK) == RTC_AlarmSubSecondMask_SS14_12) || \
  286. ((MASK) == RTC_AlarmSubSecondMask_SS14_13) || \
  287. ((MASK) == RTC_AlarmSubSecondMask_SS14) || \
  288. ((MASK) == RTC_AlarmSubSecondMask_None))
  289. /**
  290. * @}
  291. */
  292. /** @defgroup RTC_Alarm_Sub_Seconds_Value
  293. * @{
  294. */
  295. #define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= 0x00007FFF)
  296. /**
  297. * @}
  298. */
  299. /** @defgroup RTC_Wakeup_Timer_Definitions
  300. * @{
  301. */
  302. #define RTC_WakeUpClock_RTCCLK_Div16 ((uint32_t)0x00000000)
  303. #define RTC_WakeUpClock_RTCCLK_Div8 ((uint32_t)0x00000001)
  304. #define RTC_WakeUpClock_RTCCLK_Div4 ((uint32_t)0x00000002)
  305. #define RTC_WakeUpClock_RTCCLK_Div2 ((uint32_t)0x00000003)
  306. #define RTC_WakeUpClock_CK_SPRE_16bits ((uint32_t)0x00000004)
  307. #define RTC_WakeUpClock_CK_SPRE_17bits ((uint32_t)0x00000006)
  308. #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WakeUpClock_RTCCLK_Div16) || \
  309. ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div8) || \
  310. ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div4) || \
  311. ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div2) || \
  312. ((CLOCK) == RTC_WakeUpClock_CK_SPRE_16bits) || \
  313. ((CLOCK) == RTC_WakeUpClock_CK_SPRE_17bits))
  314. #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
  315. /**
  316. * @}
  317. */
  318. /** @defgroup RTC_Time_Stamp_Edges_definitions
  319. * @{
  320. */
  321. #define RTC_TimeStampEdge_Rising ((uint32_t)0x00000000)
  322. #define RTC_TimeStampEdge_Falling ((uint32_t)0x00000008)
  323. #define IS_RTC_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TimeStampEdge_Rising) || \
  324. ((EDGE) == RTC_TimeStampEdge_Falling))
  325. /**
  326. * @}
  327. */
  328. /** @defgroup RTC_Output_selection_Definitions
  329. * @{
  330. */
  331. #define RTC_Output_Disable ((uint32_t)0x00000000)
  332. #define RTC_Output_AlarmA ((uint32_t)0x00200000)
  333. #define RTC_Output_AlarmB ((uint32_t)0x00400000)
  334. #define RTC_Output_WakeUp ((uint32_t)0x00600000)
  335. #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_Output_Disable) || \
  336. ((OUTPUT) == RTC_Output_AlarmA) || \
  337. ((OUTPUT) == RTC_Output_AlarmB) || \
  338. ((OUTPUT) == RTC_Output_WakeUp))
  339. /**
  340. * @}
  341. */
  342. /** @defgroup RTC_Output_Polarity_Definitions
  343. * @{
  344. */
  345. #define RTC_OutputPolarity_High ((uint32_t)0x00000000)
  346. #define RTC_OutputPolarity_Low ((uint32_t)0x00100000)
  347. #define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OutputPolarity_High) || \
  348. ((POL) == RTC_OutputPolarity_Low))
  349. /**
  350. * @}
  351. */
  352. /** @defgroup RTC_Digital_Calibration_Definitions
  353. * @{
  354. */
  355. #define RTC_CalibSign_Positive ((uint32_t)0x00000000)
  356. #define RTC_CalibSign_Negative ((uint32_t)0x00000080)
  357. #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CalibSign_Positive) || \
  358. ((SIGN) == RTC_CalibSign_Negative))
  359. #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
  360. /**
  361. * @}
  362. */
  363. /** @defgroup RTC_Calib_Output_selection_Definitions
  364. * @{
  365. */
  366. #define RTC_CalibOutput_512Hz ((uint32_t)0x00000000)
  367. #define RTC_CalibOutput_1Hz ((uint32_t)0x00080000)
  368. #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CalibOutput_512Hz) || \
  369. ((OUTPUT) == RTC_CalibOutput_1Hz))
  370. /**
  371. * @}
  372. */
  373. /** @defgroup RTC_Smooth_calib_period_Definitions
  374. * @{
  375. */
  376. #define RTC_SmoothCalibPeriod_32sec ((uint32_t)0x00000000) /*!< if RTCCLK = 32768 Hz, Smooth calibation
  377. period is 32s, else 2exp20 RTCCLK seconds */
  378. #define RTC_SmoothCalibPeriod_16sec ((uint32_t)0x00002000) /*!< if RTCCLK = 32768 Hz, Smooth calibation
  379. period is 16s, else 2exp19 RTCCLK seconds */
  380. #define RTC_SmoothCalibPeriod_8sec ((uint32_t)0x00004000) /*!< if RTCCLK = 32768 Hz, Smooth calibation
  381. period is 8s, else 2exp18 RTCCLK seconds */
  382. #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SmoothCalibPeriod_32sec) || \
  383. ((PERIOD) == RTC_SmoothCalibPeriod_16sec) || \
  384. ((PERIOD) == RTC_SmoothCalibPeriod_8sec))
  385. /**
  386. * @}
  387. */
  388. /** @defgroup RTC_Smooth_calib_Plus_pulses_Definitions
  389. * @{
  390. */
  391. #define RTC_SmoothCalibPlusPulses_Set ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
  392. during a X -second window = Y - CALM[8:0].
  393. with Y = 512, 256, 128 when X = 32, 16, 8 */
  394. #define RTC_SmoothCalibPlusPulses_Reset ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
  395. during a 32-second window = CALM[8:0]. */
  396. #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SmoothCalibPlusPulses_Set) || \
  397. ((PLUS) == RTC_SmoothCalibPlusPulses_Reset))
  398. /**
  399. * @}
  400. */
  401. /** @defgroup RTC_Smooth_calib_Minus_pulses_Definitions
  402. * @{
  403. */
  404. #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
  405. /**
  406. * @}
  407. */
  408. /** @defgroup RTC_DayLightSaving_Definitions
  409. * @{
  410. */
  411. #define RTC_DayLightSaving_SUB1H ((uint32_t)0x00020000)
  412. #define RTC_DayLightSaving_ADD1H ((uint32_t)0x00010000)
  413. #define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DayLightSaving_SUB1H) || \
  414. ((SAVE) == RTC_DayLightSaving_ADD1H))
  415. #define RTC_StoreOperation_Reset ((uint32_t)0x00000000)
  416. #define RTC_StoreOperation_Set ((uint32_t)0x00040000)
  417. #define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_StoreOperation_Reset) || \
  418. ((OPERATION) == RTC_StoreOperation_Set))
  419. /**
  420. * @}
  421. */
  422. /** @defgroup RTC_Tamper_Trigger_Definitions
  423. * @{
  424. */
  425. #define RTC_TamperTrigger_RisingEdge ((uint32_t)0x00000000)
  426. #define RTC_TamperTrigger_FallingEdge ((uint32_t)0x00000001)
  427. #define RTC_TamperTrigger_LowLevel ((uint32_t)0x00000000)
  428. #define RTC_TamperTrigger_HighLevel ((uint32_t)0x00000001)
  429. #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TamperTrigger_RisingEdge) || \
  430. ((TRIGGER) == RTC_TamperTrigger_FallingEdge) || \
  431. ((TRIGGER) == RTC_TamperTrigger_LowLevel) || \
  432. ((TRIGGER) == RTC_TamperTrigger_HighLevel))
  433. /**
  434. * @}
  435. */
  436. /** @defgroup RTC_Tamper_Filter_Definitions
  437. * @{
  438. */
  439. #define RTC_TamperFilter_Disable ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
  440. #define RTC_TamperFilter_2Sample ((uint32_t)0x00000800) /*!< Tamper is activated after 2
  441. consecutive samples at the active level */
  442. #define RTC_TamperFilter_4Sample ((uint32_t)0x00001000) /*!< Tamper is activated after 4
  443. consecutive samples at the active level */
  444. #define RTC_TamperFilter_8Sample ((uint32_t)0x00001800) /*!< Tamper is activated after 8
  445. consecutive samples at the active leve. */
  446. #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TamperFilter_Disable) || \
  447. ((FILTER) == RTC_TamperFilter_2Sample) || \
  448. ((FILTER) == RTC_TamperFilter_4Sample) || \
  449. ((FILTER) == RTC_TamperFilter_8Sample))
  450. /**
  451. * @}
  452. */
  453. /** @defgroup RTC_Tamper_Sampling_Frequencies_Definitions
  454. * @{
  455. */
  456. #define RTC_TamperSamplingFreq_RTCCLK_Div32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
  457. with a frequency = RTCCLK / 32768 */
  458. #define RTC_TamperSamplingFreq_RTCCLK_Div16384 ((uint32_t)0x000000100) /*!< Each of the tamper inputs are sampled
  459. with a frequency = RTCCLK / 16384 */
  460. #define RTC_TamperSamplingFreq_RTCCLK_Div8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
  461. with a frequency = RTCCLK / 8192 */
  462. #define RTC_TamperSamplingFreq_RTCCLK_Div4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
  463. with a frequency = RTCCLK / 4096 */
  464. #define RTC_TamperSamplingFreq_RTCCLK_Div2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
  465. with a frequency = RTCCLK / 2048 */
  466. #define RTC_TamperSamplingFreq_RTCCLK_Div1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
  467. with a frequency = RTCCLK / 1024 */
  468. #define RTC_TamperSamplingFreq_RTCCLK_Div512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
  469. with a frequency = RTCCLK / 512 */
  470. #define RTC_TamperSamplingFreq_RTCCLK_Div256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
  471. with a frequency = RTCCLK / 256 */
  472. #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div32768) || \
  473. ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div16384) || \
  474. ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div8192) || \
  475. ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div4096) || \
  476. ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div2048) || \
  477. ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div1024) || \
  478. ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div512) || \
  479. ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div256))
  480. /**
  481. * @}
  482. */
  483. /** @defgroup RTC_Tamper_Pin_Precharge_Duration_Definitions
  484. * @{
  485. */
  486. #define RTC_TamperPrechargeDuration_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
  487. sampling during 1 RTCCLK cycle */
  488. #define RTC_TamperPrechargeDuration_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
  489. sampling during 2 RTCCLK cycles */
  490. #define RTC_TamperPrechargeDuration_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
  491. sampling during 4 RTCCLK cycles */
  492. #define RTC_TamperPrechargeDuration_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
  493. sampling during 8 RTCCLK cycles */
  494. #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TamperPrechargeDuration_1RTCCLK) || \
  495. ((DURATION) == RTC_TamperPrechargeDuration_2RTCCLK) || \
  496. ((DURATION) == RTC_TamperPrechargeDuration_4RTCCLK) || \
  497. ((DURATION) == RTC_TamperPrechargeDuration_8RTCCLK))
  498. /**
  499. * @}
  500. */
  501. /** @defgroup RTC_Tamper_Pins_Definitions
  502. * @{
  503. */
  504. #define RTC_Tamper_1 RTC_TAFCR_TAMP1E
  505. #define IS_RTC_TAMPER(TAMPER) (((TAMPER) == RTC_Tamper_1))
  506. /**
  507. * @}
  508. */
  509. /** @defgroup RTC_Tamper_Pin_Selection
  510. * @{
  511. */
  512. #define RTC_TamperPin_PC13 ((uint32_t)0x00000000)
  513. #define RTC_TamperPin_PI8 ((uint32_t)0x00010000)
  514. #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TamperPin_PC13) || \
  515. ((PIN) == RTC_TamperPin_PI8))
  516. /**
  517. * @}
  518. */
  519. /** @defgroup RTC_TimeStamp_Pin_Selection
  520. * @{
  521. */
  522. #define RTC_TimeStampPin_PC13 ((uint32_t)0x00000000)
  523. #define RTC_TimeStampPin_PI8 ((uint32_t)0x00020000)
  524. #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TimeStampPin_PC13) || \
  525. ((PIN) == RTC_TimeStampPin_PI8))
  526. /**
  527. * @}
  528. */
  529. /** @defgroup RTC_Output_Type_ALARM_OUT
  530. * @{
  531. */
  532. #define RTC_OutputType_OpenDrain ((uint32_t)0x00000000)
  533. #define RTC_OutputType_PushPull ((uint32_t)0x00040000)
  534. #define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OutputType_OpenDrain) || \
  535. ((TYPE) == RTC_OutputType_PushPull))
  536. /**
  537. * @}
  538. */
  539. /** @defgroup RTC_Add_1_Second_Parameter_Definitions
  540. * @{
  541. */
  542. #define RTC_ShiftAdd1S_Reset ((uint32_t)0x00000000)
  543. #define RTC_ShiftAdd1S_Set ((uint32_t)0x80000000)
  544. #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_ShiftAdd1S_Reset) || \
  545. ((SEL) == RTC_ShiftAdd1S_Set))
  546. /**
  547. * @}
  548. */
  549. /** @defgroup RTC_Substract_Fraction_Of_Second_Value
  550. * @{
  551. */
  552. #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
  553. /**
  554. * @}
  555. */
  556. /** @defgroup RTC_Backup_Registers_Definitions
  557. * @{
  558. */
  559. #define RTC_BKP_DR0 ((uint32_t)0x00000000)
  560. #define RTC_BKP_DR1 ((uint32_t)0x00000001)
  561. #define RTC_BKP_DR2 ((uint32_t)0x00000002)
  562. #define RTC_BKP_DR3 ((uint32_t)0x00000003)
  563. #define RTC_BKP_DR4 ((uint32_t)0x00000004)
  564. #define RTC_BKP_DR5 ((uint32_t)0x00000005)
  565. #define RTC_BKP_DR6 ((uint32_t)0x00000006)
  566. #define RTC_BKP_DR7 ((uint32_t)0x00000007)
  567. #define RTC_BKP_DR8 ((uint32_t)0x00000008)
  568. #define RTC_BKP_DR9 ((uint32_t)0x00000009)
  569. #define RTC_BKP_DR10 ((uint32_t)0x0000000A)
  570. #define RTC_BKP_DR11 ((uint32_t)0x0000000B)
  571. #define RTC_BKP_DR12 ((uint32_t)0x0000000C)
  572. #define RTC_BKP_DR13 ((uint32_t)0x0000000D)
  573. #define RTC_BKP_DR14 ((uint32_t)0x0000000E)
  574. #define RTC_BKP_DR15 ((uint32_t)0x0000000F)
  575. #define RTC_BKP_DR16 ((uint32_t)0x00000010)
  576. #define RTC_BKP_DR17 ((uint32_t)0x00000011)
  577. #define RTC_BKP_DR18 ((uint32_t)0x00000012)
  578. #define RTC_BKP_DR19 ((uint32_t)0x00000013)
  579. #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
  580. ((BKP) == RTC_BKP_DR1) || \
  581. ((BKP) == RTC_BKP_DR2) || \
  582. ((BKP) == RTC_BKP_DR3) || \
  583. ((BKP) == RTC_BKP_DR4) || \
  584. ((BKP) == RTC_BKP_DR5) || \
  585. ((BKP) == RTC_BKP_DR6) || \
  586. ((BKP) == RTC_BKP_DR7) || \
  587. ((BKP) == RTC_BKP_DR8) || \
  588. ((BKP) == RTC_BKP_DR9) || \
  589. ((BKP) == RTC_BKP_DR10) || \
  590. ((BKP) == RTC_BKP_DR11) || \
  591. ((BKP) == RTC_BKP_DR12) || \
  592. ((BKP) == RTC_BKP_DR13) || \
  593. ((BKP) == RTC_BKP_DR14) || \
  594. ((BKP) == RTC_BKP_DR15) || \
  595. ((BKP) == RTC_BKP_DR16) || \
  596. ((BKP) == RTC_BKP_DR17) || \
  597. ((BKP) == RTC_BKP_DR18) || \
  598. ((BKP) == RTC_BKP_DR19))
  599. /**
  600. * @}
  601. */
  602. /** @defgroup RTC_Input_parameter_format_definitions
  603. * @{
  604. */
  605. #define RTC_Format_BIN ((uint32_t)0x000000000)
  606. #define RTC_Format_BCD ((uint32_t)0x000000001)
  607. #define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_Format_BIN) || ((FORMAT) == RTC_Format_BCD))
  608. /**
  609. * @}
  610. */
  611. /** @defgroup RTC_Flags_Definitions
  612. * @{
  613. */
  614. #define RTC_FLAG_RECALPF ((uint32_t)0x00010000)
  615. #define RTC_FLAG_TAMP1F ((uint32_t)0x00002000)
  616. #define RTC_FLAG_TSOVF ((uint32_t)0x00001000)
  617. #define RTC_FLAG_TSF ((uint32_t)0x00000800)
  618. #define RTC_FLAG_WUTF ((uint32_t)0x00000400)
  619. #define RTC_FLAG_ALRBF ((uint32_t)0x00000200)
  620. #define RTC_FLAG_ALRAF ((uint32_t)0x00000100)
  621. #define RTC_FLAG_INITF ((uint32_t)0x00000040)
  622. #define RTC_FLAG_RSF ((uint32_t)0x00000020)
  623. #define RTC_FLAG_INITS ((uint32_t)0x00000010)
  624. #define RTC_FLAG_SHPF ((uint32_t)0x00000008)
  625. #define RTC_FLAG_WUTWF ((uint32_t)0x00000004)
  626. #define RTC_FLAG_ALRBWF ((uint32_t)0x00000002)
  627. #define RTC_FLAG_ALRAWF ((uint32_t)0x00000001)
  628. #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_TSOVF) || ((FLAG) == RTC_FLAG_TSF) || \
  629. ((FLAG) == RTC_FLAG_WUTF) || ((FLAG) == RTC_FLAG_ALRBF) || \
  630. ((FLAG) == RTC_FLAG_ALRAF) || ((FLAG) == RTC_FLAG_INITF) || \
  631. ((FLAG) == RTC_FLAG_RSF) || ((FLAG) == RTC_FLAG_WUTWF) || \
  632. ((FLAG) == RTC_FLAG_ALRBWF) || ((FLAG) == RTC_FLAG_ALRAWF) || \
  633. ((FLAG) == RTC_FLAG_TAMP1F) || ((FLAG) == RTC_FLAG_RECALPF) || \
  634. ((FLAG) == RTC_FLAG_SHPF))
  635. #define IS_RTC_CLEAR_FLAG(FLAG) (((FLAG) != (uint32_t)RESET) && (((FLAG) & 0xFFFF00DF) == (uint32_t)RESET))
  636. /**
  637. * @}
  638. */
  639. /** @defgroup RTC_Interrupts_Definitions
  640. * @{
  641. */
  642. #define RTC_IT_TS ((uint32_t)0x00008000)
  643. #define RTC_IT_WUT ((uint32_t)0x00004000)
  644. #define RTC_IT_ALRB ((uint32_t)0x00002000)
  645. #define RTC_IT_ALRA ((uint32_t)0x00001000)
  646. #define RTC_IT_TAMP ((uint32_t)0x00000004) /* Used only to Enable the Tamper Interrupt */
  647. #define RTC_IT_TAMP1 ((uint32_t)0x00020000)
  648. #define IS_RTC_CONFIG_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFFF0FFB) == (uint32_t)RESET))
  649. #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_TS) || ((IT) == RTC_IT_WUT) || \
  650. ((IT) == RTC_IT_ALRB) || ((IT) == RTC_IT_ALRA) || \
  651. ((IT) == RTC_IT_TAMP1))
  652. #define IS_RTC_CLEAR_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFFD0FFF) == (uint32_t)RESET))
  653. /**
  654. * @}
  655. */
  656. /** @defgroup RTC_Legacy
  657. * @{
  658. */
  659. #define RTC_DigitalCalibConfig RTC_CoarseCalibConfig
  660. #define RTC_DigitalCalibCmd RTC_CoarseCalibCmd
  661. /**
  662. * @}
  663. */
  664. /**
  665. * @}
  666. */
  667. /* Exported macro ------------------------------------------------------------*/
  668. /* Exported functions --------------------------------------------------------*/
  669. /* Function used to set the RTC configuration to the default reset state *****/
  670. ErrorStatus RTC_DeInit(void);
  671. /* Initialization and Configuration functions *********************************/
  672. ErrorStatus RTC_Init(RTC_InitTypeDef* RTC_InitStruct);
  673. void RTC_StructInit(RTC_InitTypeDef* RTC_InitStruct);
  674. void RTC_WriteProtectionCmd(FunctionalState NewState);
  675. ErrorStatus RTC_EnterInitMode(void);
  676. void RTC_ExitInitMode(void);
  677. ErrorStatus RTC_WaitForSynchro(void);
  678. ErrorStatus RTC_RefClockCmd(FunctionalState NewState);
  679. void RTC_BypassShadowCmd(FunctionalState NewState);
  680. /* Time and Date configuration functions **************************************/
  681. ErrorStatus RTC_SetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
  682. void RTC_TimeStructInit(RTC_TimeTypeDef* RTC_TimeStruct);
  683. void RTC_GetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
  684. uint32_t RTC_GetSubSecond(void);
  685. ErrorStatus RTC_SetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
  686. void RTC_DateStructInit(RTC_DateTypeDef* RTC_DateStruct);
  687. void RTC_GetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
  688. /* Alarms (Alarm A and Alarm B) configuration functions **********************/
  689. void RTC_SetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
  690. void RTC_AlarmStructInit(RTC_AlarmTypeDef* RTC_AlarmStruct);
  691. void RTC_GetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
  692. ErrorStatus RTC_AlarmCmd(uint32_t RTC_Alarm, FunctionalState NewState);
  693. void RTC_AlarmSubSecondConfig(uint32_t RTC_Alarm, uint32_t RTC_AlarmSubSecondValue, uint32_t RTC_AlarmSubSecondMask);
  694. uint32_t RTC_GetAlarmSubSecond(uint32_t RTC_Alarm);
  695. /* WakeUp Timer configuration functions ***************************************/
  696. void RTC_WakeUpClockConfig(uint32_t RTC_WakeUpClock);
  697. void RTC_SetWakeUpCounter(uint32_t RTC_WakeUpCounter);
  698. uint32_t RTC_GetWakeUpCounter(void);
  699. ErrorStatus RTC_WakeUpCmd(FunctionalState NewState);
  700. /* Daylight Saving configuration functions ************************************/
  701. void RTC_DayLightSavingConfig(uint32_t RTC_DayLightSaving, uint32_t RTC_StoreOperation);
  702. uint32_t RTC_GetStoreOperation(void);
  703. /* Output pin Configuration function ******************************************/
  704. void RTC_OutputConfig(uint32_t RTC_Output, uint32_t RTC_OutputPolarity);
  705. /* Digital Calibration configuration functions *********************************/
  706. ErrorStatus RTC_CoarseCalibConfig(uint32_t RTC_CalibSign, uint32_t Value);
  707. ErrorStatus RTC_CoarseCalibCmd(FunctionalState NewState);
  708. void RTC_CalibOutputCmd(FunctionalState NewState);
  709. void RTC_CalibOutputConfig(uint32_t RTC_CalibOutput);
  710. ErrorStatus RTC_SmoothCalibConfig(uint32_t RTC_SmoothCalibPeriod,
  711. uint32_t RTC_SmoothCalibPlusPulses,
  712. uint32_t RTC_SmouthCalibMinusPulsesValue);
  713. /* TimeStamp configuration functions ******************************************/
  714. void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState);
  715. void RTC_GetTimeStamp(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_StampTimeStruct,
  716. RTC_DateTypeDef* RTC_StampDateStruct);
  717. uint32_t RTC_GetTimeStampSubSecond(void);
  718. /* Tampers configuration functions ********************************************/
  719. void RTC_TamperTriggerConfig(uint32_t RTC_Tamper, uint32_t RTC_TamperTrigger);
  720. void RTC_TamperCmd(uint32_t RTC_Tamper, FunctionalState NewState);
  721. void RTC_TamperFilterConfig(uint32_t RTC_TamperFilter);
  722. void RTC_TamperSamplingFreqConfig(uint32_t RTC_TamperSamplingFreq);
  723. void RTC_TamperPinsPrechargeDuration(uint32_t RTC_TamperPrechargeDuration);
  724. void RTC_TimeStampOnTamperDetectionCmd(FunctionalState NewState);
  725. void RTC_TamperPullUpCmd(FunctionalState NewState);
  726. /* Backup Data Registers configuration functions ******************************/
  727. void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data);
  728. uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR);
  729. /* RTC Tamper and TimeStamp Pins Selection and Output Type Config configuration
  730. functions ******************************************************************/
  731. void RTC_TamperPinSelection(uint32_t RTC_TamperPin);
  732. void RTC_TimeStampPinSelection(uint32_t RTC_TimeStampPin);
  733. void RTC_OutputTypeConfig(uint32_t RTC_OutputType);
  734. /* RTC_Shift_control_synchonisation_functions *********************************/
  735. ErrorStatus RTC_SynchroShiftConfig(uint32_t RTC_ShiftAdd1S, uint32_t RTC_ShiftSubFS);
  736. /* Interrupts and flags management functions **********************************/
  737. void RTC_ITConfig(uint32_t RTC_IT, FunctionalState NewState);
  738. FlagStatus RTC_GetFlagStatus(uint32_t RTC_FLAG);
  739. void RTC_ClearFlag(uint32_t RTC_FLAG);
  740. ITStatus RTC_GetITStatus(uint32_t RTC_IT);
  741. void RTC_ClearITPendingBit(uint32_t RTC_IT);
  742. #ifdef __cplusplus
  743. }
  744. #endif
  745. #endif /*__STM32F4xx_RTC_H */
  746. /**
  747. * @}
  748. */
  749. /**
  750. * @}
  751. */
  752. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/