2 ******************************************************************************
\r
3 * @file stm32l1xx_rtc.h
\r
4 * @author MCD Application Team
\r
6 * @date 31-December-2010
\r
7 * @brief This file contains all the functions prototypes for the RTC firmware
\r
9 ******************************************************************************
\r
12 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
\r
13 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
\r
14 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
\r
15 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
\r
16 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
\r
17 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
\r
19 * <h2><center>© COPYRIGHT 2010 STMicroelectronics</center></h2>
\r
20 ******************************************************************************
\r
23 /* Define to prevent recursive inclusion -------------------------------------*/
\r
24 #ifndef __STM32L1xx_RTC_H
\r
25 #define __STM32L1xx_RTC_H
\r
31 /* Includes ------------------------------------------------------------------*/
\r
32 #include "stm32l1xx.h"
\r
34 /** @addtogroup STM32L1xx_StdPeriph_Driver
\r
42 /* Exported types ------------------------------------------------------------*/
\r
45 * @brief RTC Init structures definition
\r
49 uint32_t RTC_HourFormat; /*!< Specifies the RTC Hour Format.
\r
50 This parameter can be a value of @ref RTC_Hour_Formats */
\r
52 uint32_t RTC_AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value.
\r
53 This parameter must be set to a value lower than 0x7F */
\r
55 uint32_t RTC_SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value.
\r
56 This parameter must be set to a value lower than 0x1FFF */
\r
60 * @brief RTC Time structure definition
\r
64 uint8_t RTC_Hours; /*!< Specifies the RTC Time Hour.
\r
65 This parameter must be set to a value in the 0-12 range
\r
66 if the RTC_HourFormat_12 is selected or 0-23 range if
\r
67 the RTC_HourFormat_24 is selected. */
\r
69 uint8_t RTC_Minutes; /*!< Specifies the RTC Time Minutes.
\r
70 This parameter must be set to a value in the 0-59 range. */
\r
72 uint8_t RTC_Seconds; /*!< Specifies the RTC Time Seconds.
\r
73 This parameter must be set to a value in the 0-59 range. */
\r
75 uint8_t RTC_H12; /*!< Specifies the RTC AM/PM Time.
\r
76 This parameter can be a value of @ref RTC_AM_PM_Definitions */
\r
80 * @brief RTC Date structure definition
\r
84 uint32_t RTC_WeekDay; /*!< Specifies the RTC Date WeekDay.
\r
85 This parameter can be a value of @ref RTC_WeekDay_Definitions */
\r
87 uint32_t RTC_Month; /*!< Specifies the RTC Date Month.
\r
88 This parameter can be a value of @ref RTC_Month_Date_Definitions */
\r
90 uint8_t RTC_Date; /*!< Specifies the RTC Date.
\r
91 This parameter must be set to a value in the 1-31 range. */
\r
93 uint8_t RTC_Year; /*!< Specifies the RTC Date Year.
\r
94 This parameter must be set to a value in the 0-99 range. */
\r
98 * @brief RTC Alarm structure definition
\r
102 RTC_TimeTypeDef RTC_AlarmTime; /*!< Specifies the RTC Alarm Time members. */
\r
104 uint32_t RTC_AlarmMask; /*!< Specifies the RTC Alarm Masks.
\r
105 This parameter can be a value of @ref RTC_AlarmMask_Definitions */
\r
107 uint32_t RTC_AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay.
\r
108 This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */
\r
110 uint8_t RTC_AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay.
\r
111 This parameter must be set to a value in the 1-31 range
\r
112 if the Alarm Date is selected.
\r
113 This parameter can be a value of @ref RTC_WeekDay_Definitions
\r
114 if the Alarm WeekDay is selected. */
\r
117 /* Exported constants --------------------------------------------------------*/
\r
119 /** @defgroup RTC_Exported_Constants
\r
124 /** @defgroup RTC_Hour_Formats
\r
127 #define RTC_HourFormat_24 ((uint32_t)0x00000000)
\r
128 #define RTC_HourFormat_12 ((uint32_t)0x00000040)
\r
129 #define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HourFormat_12) || \
\r
130 ((FORMAT) == RTC_HourFormat_24))
\r
135 /** @defgroup RTC_Asynchronous_Predivider
\r
138 #define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7F)
\r
145 /** @defgroup RTC_Synchronous_Predivider
\r
148 #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x1FFF)
\r
154 /** @defgroup RTC_Time_Definitions
\r
157 #define IS_RTC_HOUR12(HOUR) (((HOUR) > 0) && ((HOUR) <= 12))
\r
158 #define IS_RTC_HOUR24(HOUR) ((HOUR) <= 23)
\r
159 #define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59)
\r
160 #define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59)
\r
166 /** @defgroup RTC_AM_PM_Definitions
\r
169 #define RTC_H12_AM ((uint8_t)0x00)
\r
170 #define RTC_H12_PM ((uint8_t)0x40)
\r
171 #define IS_RTC_H12(PM) (((PM) == RTC_H12_AM) || ((PM) == RTC_H12_PM))
\r
177 /** @defgroup RTC_Year_Date_Definitions
\r
180 #define IS_RTC_YEAR(YEAR) ((YEAR) <= 99)
\r
186 /** @defgroup RTC_Month_Date_Definitions
\r
189 #define RTC_Month_January ((uint32_t)0x00000001)
\r
190 #define RTC_Month_February ((uint32_t)0x00000002)
\r
191 #define RTC_Month_March ((uint32_t)0x00000003)
\r
192 #define RTC_Month_April ((uint32_t)0x00000004)
\r
193 #define RTC_Month_May ((uint32_t)0x00000005)
\r
194 #define RTC_Month_June ((uint32_t)0x00000006)
\r
195 #define RTC_Month_July ((uint32_t)0x00000007)
\r
196 #define RTC_Month_August ((uint32_t)0x00000008)
\r
197 #define RTC_Month_September ((uint32_t)0x00000009)
\r
198 #define RTC_Month_October ((uint32_t)0x00000010)
\r
199 #define RTC_Month_November ((uint32_t)0x00000011)
\r
200 #define RTC_Month_December ((uint32_t)0x00000012)
\r
201 #define IS_RTC_MONTH(MONTH) (((MONTH) >= 1) && ((MONTH) <= 12))
\r
202 #define IS_RTC_DATE(DATE) (((DATE) >= 1) && ((DATE) <= 31))
\r
208 /** @defgroup RTC_WeekDay_Definitions
\r
212 #define RTC_Weekday_Monday ((uint32_t)0x00000001)
\r
213 #define RTC_Weekday_Tuesday ((uint32_t)0x00000002)
\r
214 #define RTC_Weekday_Wednesday ((uint32_t)0x00000003)
\r
215 #define RTC_Weekday_Thursday ((uint32_t)0x00000004)
\r
216 #define RTC_Weekday_Friday ((uint32_t)0x00000005)
\r
217 #define RTC_Weekday_Saturday ((uint32_t)0x00000006)
\r
218 #define RTC_Weekday_Sunday ((uint32_t)0x00000007)
\r
219 #define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
\r
220 ((WEEKDAY) == RTC_Weekday_Tuesday) || \
\r
221 ((WEEKDAY) == RTC_Weekday_Wednesday) || \
\r
222 ((WEEKDAY) == RTC_Weekday_Thursday) || \
\r
223 ((WEEKDAY) == RTC_Weekday_Friday) || \
\r
224 ((WEEKDAY) == RTC_Weekday_Saturday) || \
\r
225 ((WEEKDAY) == RTC_Weekday_Sunday))
\r
231 /** @defgroup RTC_Alarm_Definitions
\r
234 #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) > 0) && ((DATE) <= 31))
\r
235 #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
\r
236 ((WEEKDAY) == RTC_Weekday_Tuesday) || \
\r
237 ((WEEKDAY) == RTC_Weekday_Wednesday) || \
\r
238 ((WEEKDAY) == RTC_Weekday_Thursday) || \
\r
239 ((WEEKDAY) == RTC_Weekday_Friday) || \
\r
240 ((WEEKDAY) == RTC_Weekday_Saturday) || \
\r
241 ((WEEKDAY) == RTC_Weekday_Sunday))
\r
248 /** @defgroup RTC_AlarmDateWeekDay_Definitions
\r
251 #define RTC_AlarmDateWeekDaySel_Date ((uint32_t)0x00000000)
\r
252 #define RTC_AlarmDateWeekDaySel_WeekDay ((uint32_t)0x40000000)
\r
254 #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_AlarmDateWeekDaySel_Date) || \
\r
255 ((SEL) == RTC_AlarmDateWeekDaySel_WeekDay))
\r
262 /** @defgroup RTC_AlarmMask_Definitions
\r
265 #define RTC_AlarmMask_None ((uint32_t)0x00000000)
\r
266 #define RTC_AlarmMask_DateWeekDay ((uint32_t)0x80000000)
\r
267 #define RTC_AlarmMask_Hours ((uint32_t)0x00800000)
\r
268 #define RTC_AlarmMask_Minutes ((uint32_t)0x00008000)
\r
269 #define RTC_AlarmMask_Seconds ((uint32_t)0x00000080)
\r
270 #define RTC_AlarmMask_All ((uint32_t)0x80808080)
\r
271 #define IS_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET)
\r
277 /** @defgroup RTC_Alarms_Definitions
\r
280 #define RTC_Alarm_A ((uint32_t)0x00000100)
\r
281 #define RTC_Alarm_B ((uint32_t)0x00000200)
\r
282 #define IS_RTC_ALARM(ALARM) (((ALARM) == RTC_Alarm_A) || ((ALARM) == RTC_Alarm_B))
\r
283 #define IS_RTC_CMD_ALARM(ALARM) (((ALARM) & (RTC_Alarm_A | RTC_Alarm_B)) != (uint32_t)RESET)
\r
289 /** @defgroup RTC_Wakeup_Timer_Definitions
\r
292 #define RTC_WakeUpClock_RTCCLK_Div16 ((uint32_t)0x00000000)
\r
293 #define RTC_WakeUpClock_RTCCLK_Div8 ((uint32_t)0x00000001)
\r
294 #define RTC_WakeUpClock_RTCCLK_Div4 ((uint32_t)0x00000002)
\r
295 #define RTC_WakeUpClock_RTCCLK_Div2 ((uint32_t)0x00000003)
\r
296 #define RTC_WakeUpClock_CK_SPRE_16bits ((uint32_t)0x00000004)
\r
297 #define RTC_WakeUpClock_CK_SPRE_17bits ((uint32_t)0x00000006)
\r
298 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WakeUpClock_RTCCLK_Div16) || \
\r
299 ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div8) || \
\r
300 ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div4) || \
\r
301 ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div2) || \
\r
302 ((CLOCK) == RTC_WakeUpClock_CK_SPRE_16bits) || \
\r
303 ((CLOCK) == RTC_WakeUpClock_CK_SPRE_17bits))
\r
304 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
\r
309 /** @defgroup RTC_Time_Stamp_Edges_definitions
\r
312 #define RTC_TimeStampEdge_Rising ((uint32_t)0x00000000)
\r
313 #define RTC_TimeStampEdge_Falling ((uint32_t)0x00000008)
\r
314 #define IS_RTC_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TimeStampEdge_Rising) || \
\r
315 ((EDGE) == RTC_TimeStampEdge_Falling))
\r
320 /** @defgroup RTC_Output_selection_Definitions
\r
323 #define RTC_Output_Disable ((uint32_t)0x00000000)
\r
324 #define RTC_Output_AlarmA ((uint32_t)0x00200000)
\r
325 #define RTC_Output_AlarmB ((uint32_t)0x00400000)
\r
326 #define RTC_Output_WakeUp ((uint32_t)0x00600000)
\r
328 #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_Output_Disable) || \
\r
329 ((OUTPUT) == RTC_Output_AlarmA) || \
\r
330 ((OUTPUT) == RTC_Output_AlarmB) || \
\r
331 ((OUTPUT) == RTC_Output_WakeUp))
\r
337 /** @defgroup RTC_Output_Polarity_Definitions
\r
340 #define RTC_OutputPolarity_High ((uint32_t)0x00000000)
\r
341 #define RTC_OutputPolarity_Low ((uint32_t)0x00100000)
\r
342 #define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OutputPolarity_High) || \
\r
343 ((POL) == RTC_OutputPolarity_Low))
\r
349 /** @defgroup RTC_Digital_Calibration_Definitions
\r
352 #define RTC_CalibSign_Positive ((uint32_t)0x00000000)
\r
353 #define RTC_CalibSign_Negative ((uint32_t)0x00000080)
\r
354 #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CalibSign_Positive) || \
\r
355 ((SIGN) == RTC_CalibSign_Negative))
\r
356 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
\r
363 /** @defgroup RTC_DayLightSaving_Definitions
\r
366 #define RTC_DayLightSaving_SUB1H ((uint32_t)0x00020000)
\r
367 #define RTC_DayLightSaving_ADD1H ((uint32_t)0x00010000)
\r
368 #define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DayLightSaving_SUB1H) || \
\r
369 ((SAVE) == RTC_DayLightSaving_ADD1H))
\r
371 #define RTC_StoreOperation_Reset ((uint32_t)0x00000000)
\r
372 #define RTC_StoreOperation_Set ((uint32_t)0x00040000)
\r
373 #define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_StoreOperation_Reset) || \
\r
374 ((OPERATION) == RTC_StoreOperation_Set))
\r
379 /** @defgroup RTC_Tamper_Trigger_Definitions
\r
382 #define RTC_TamperTrigger_RisingEdge ((uint32_t)0x00000000)
\r
383 #define RTC_TamperTrigger_FallingEdge ((uint32_t)0x00000001)
\r
384 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TamperTrigger_RisingEdge) || \
\r
385 ((TRIGGER) == RTC_TamperTrigger_FallingEdge))
\r
391 /** @defgroup RTC_Tamper_Pins_Definitions
\r
394 #define RTC_Tamper_1 RTC_TAFCR_TAMP1E
\r
395 #define IS_RTC_TAMPER(TAMPER) (((TAMPER) == RTC_Tamper_1))
\r
401 /** @defgroup RTC_Output_Type_ALARM_OUT
\r
404 #define RTC_OutputType_OpenDrain ((uint32_t)0x00000000)
\r
405 #define RTC_OutputType_PushPull ((uint32_t)0x00040000)
\r
406 #define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OutputType_OpenDrain) || \
\r
407 ((TYPE) == RTC_OutputType_PushPull))
\r
413 /** @defgroup RTC_Backup_Registers_Definitions
\r
417 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
\r
418 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
\r
419 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
\r
420 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
\r
421 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
\r
422 #define RTC_BKP_DR5 ((uint32_t)0x00000005)
\r
423 #define RTC_BKP_DR6 ((uint32_t)0x00000006)
\r
424 #define RTC_BKP_DR7 ((uint32_t)0x00000007)
\r
425 #define RTC_BKP_DR8 ((uint32_t)0x00000008)
\r
426 #define RTC_BKP_DR9 ((uint32_t)0x00000009)
\r
427 #define RTC_BKP_DR10 ((uint32_t)0x0000000A)
\r
428 #define RTC_BKP_DR11 ((uint32_t)0x0000000B)
\r
429 #define RTC_BKP_DR12 ((uint32_t)0x0000000C)
\r
430 #define RTC_BKP_DR13 ((uint32_t)0x0000000D)
\r
431 #define RTC_BKP_DR14 ((uint32_t)0x0000000E)
\r
432 #define RTC_BKP_DR15 ((uint32_t)0x0000000F)
\r
433 #define RTC_BKP_DR16 ((uint32_t)0x00000010)
\r
434 #define RTC_BKP_DR17 ((uint32_t)0x00000011)
\r
435 #define RTC_BKP_DR18 ((uint32_t)0x00000012)
\r
436 #define RTC_BKP_DR19 ((uint32_t)0x00000013)
\r
437 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
\r
438 ((BKP) == RTC_BKP_DR1) || \
\r
439 ((BKP) == RTC_BKP_DR2) || \
\r
440 ((BKP) == RTC_BKP_DR3) || \
\r
441 ((BKP) == RTC_BKP_DR4) || \
\r
442 ((BKP) == RTC_BKP_DR5) || \
\r
443 ((BKP) == RTC_BKP_DR6) || \
\r
444 ((BKP) == RTC_BKP_DR7) || \
\r
445 ((BKP) == RTC_BKP_DR8) || \
\r
446 ((BKP) == RTC_BKP_DR9) || \
\r
447 ((BKP) == RTC_BKP_DR10) || \
\r
448 ((BKP) == RTC_BKP_DR11) || \
\r
449 ((BKP) == RTC_BKP_DR12) || \
\r
450 ((BKP) == RTC_BKP_DR13) || \
\r
451 ((BKP) == RTC_BKP_DR14) || \
\r
452 ((BKP) == RTC_BKP_DR15) || \
\r
453 ((BKP) == RTC_BKP_DR16) || \
\r
454 ((BKP) == RTC_BKP_DR17) || \
\r
455 ((BKP) == RTC_BKP_DR18) || \
\r
456 ((BKP) == RTC_BKP_DR19))
\r
461 /** @defgroup RTC_Input_parameter_format_definitions
\r
464 #define RTC_Format_BIN ((uint32_t)0x000000000)
\r
465 #define RTC_Format_BCD ((uint32_t)0x000000001)
\r
466 #define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_Format_BIN) || ((FORMAT) == RTC_Format_BCD))
\r
472 /** @defgroup RTC_Flags_Definitions
\r
475 #define RTC_FLAG_TAMP1F ((uint32_t)0x00002000)
\r
476 #define RTC_FLAG_TSOVF ((uint32_t)0x00001000)
\r
477 #define RTC_FLAG_TSF ((uint32_t)0x00000800)
\r
478 #define RTC_FLAG_WUTF ((uint32_t)0x00000400)
\r
479 #define RTC_FLAG_ALRBF ((uint32_t)0x00000200)
\r
480 #define RTC_FLAG_ALRAF ((uint32_t)0x00000100)
\r
481 #define RTC_FLAG_INITF ((uint32_t)0x00000040)
\r
482 #define RTC_FLAG_RSF ((uint32_t)0x00000020)
\r
483 #define RTC_FLAG_INITS ((uint32_t)0x00000010)
\r
484 #define RTC_FLAG_WUTWF ((uint32_t)0x00000004)
\r
485 #define RTC_FLAG_ALRBWF ((uint32_t)0x00000002)
\r
486 #define RTC_FLAG_ALRAWF ((uint32_t)0x00000001)
\r
487 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_TSOVF) || ((FLAG) == RTC_FLAG_TSF) || \
\r
488 ((FLAG) == RTC_FLAG_WUTF) || ((FLAG) == RTC_FLAG_ALRBF) || \
\r
489 ((FLAG) == RTC_FLAG_ALRAF) || ((FLAG) == RTC_FLAG_INITF) || \
\r
490 ((FLAG) == RTC_FLAG_RSF) || ((FLAG) == RTC_FLAG_WUTWF) || \
\r
491 ((FLAG) == RTC_FLAG_ALRBWF) || ((FLAG) == RTC_FLAG_ALRAWF) || \
\r
492 ((FLAG) == RTC_FLAG_TAMP1F))
\r
493 #define IS_RTC_CLEAR_FLAG(FLAG) (((FLAG) != (uint32_t)RESET) && (((FLAG) & 0xFFFFC0DF) == (uint32_t)RESET))
\r
499 /** @defgroup RTC_Interrupts_Definitions
\r
502 #define RTC_IT_TS ((uint32_t)0x00008000)
\r
503 #define RTC_IT_WUT ((uint32_t)0x00004000)
\r
504 #define RTC_IT_ALRB ((uint32_t)0x00002000)
\r
505 #define RTC_IT_ALRA ((uint32_t)0x00001000)
\r
506 #define RTC_IT_TAMP ((uint32_t)0x00000004) /* Used only to Enable the Tamper Interrupt */
\r
507 #define RTC_IT_TAMP1 ((uint32_t)0x00020000)
\r
509 #define IS_RTC_CONFIG_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFFF0FFB) == (uint32_t)RESET))
\r
510 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_TS) || ((IT) == RTC_IT_WUT) || \
\r
511 ((IT) == RTC_IT_ALRB) || ((IT) == RTC_IT_ALRA) || \
\r
512 ((IT) == RTC_IT_TAMP1))
\r
513 #define IS_RTC_CLEAR_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFFD0FFF) == (uint32_t)RESET))
\r
524 /* Exported macro ------------------------------------------------------------*/
\r
525 /* Exported functions ------------------------------------------------------- */
\r
527 /* Function used to set the RTC configuration to the default reset state *****/
\r
528 ErrorStatus RTC_DeInit(void);
\r
531 /* Initialization and Configuration functions *********************************/
\r
532 ErrorStatus RTC_Init(RTC_InitTypeDef* RTC_InitStruct);
\r
533 void RTC_StructInit(RTC_InitTypeDef* RTC_InitStruct);
\r
534 void RTC_WriteProtectionCmd(FunctionalState NewState);
\r
535 ErrorStatus RTC_EnterInitMode(void);
\r
536 void RTC_ExitInitMode(void);
\r
537 ErrorStatus RTC_WaitForSynchro(void);
\r
538 ErrorStatus RTC_RefClockCmd(FunctionalState NewState);
\r
540 /* Time and Date configuration functions **************************************/
\r
541 ErrorStatus RTC_SetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
\r
542 void RTC_TimeStructInit(RTC_TimeTypeDef* RTC_TimeStruct);
\r
543 void RTC_GetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
\r
544 ErrorStatus RTC_SetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
\r
545 void RTC_DateStructInit(RTC_DateTypeDef* RTC_DateStruct);
\r
546 void RTC_GetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
\r
548 /* Alarms (Alarm A and Alarm B) configuration functions **********************/
\r
549 void RTC_SetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
\r
550 void RTC_AlarmStructInit(RTC_AlarmTypeDef* RTC_AlarmStruct);
\r
551 void RTC_GetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
\r
552 ErrorStatus RTC_AlarmCmd(uint32_t RTC_Alarm, FunctionalState NewState);
\r
554 /* WakeUp Timer configuration functions ***************************************/
\r
555 void RTC_WakeUpClockConfig(uint32_t RTC_WakeUpClock);
\r
556 void RTC_SetWakeUpCounter(uint32_t RTC_WakeUpCounter);
\r
557 uint32_t RTC_GetWakeUpCounter(void);
\r
558 ErrorStatus RTC_WakeUpCmd(FunctionalState NewState);
\r
560 /* Daylight Saving configuration functions ************************************/
\r
561 void RTC_DayLightSavingConfig(uint32_t RTC_DayLightSaving, uint32_t RTC_StoreOperation);
\r
562 uint32_t RTC_GetStoreOperation(void);
\r
564 /* Output pin Configuration function ******************************************/
\r
565 void RTC_OutputConfig(uint32_t RTC_Output, uint32_t RTC_OutputPolarity);
\r
567 /* Digital Calibration configuration functions ********************************/
\r
568 ErrorStatus RTC_DigitalCalibConfig(uint32_t RTC_CalibSign, uint32_t Value);
\r
569 ErrorStatus RTC_DigitalCalibCmd(FunctionalState NewState);
\r
570 void RTC_CalibOutputCmd(FunctionalState NewState);
\r
572 /* TimeStamp configuration functions ******************************************/
\r
573 void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState);
\r
574 void RTC_GetTimeStamp(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_StampTimeStruct,
\r
575 RTC_DateTypeDef* RTC_StampDateStruct);
\r
578 /* Tampers configuration functions ********************************************/
\r
579 void RTC_TamperTriggerConfig(uint32_t RTC_Tamper, uint32_t RTC_TamperTrigger);
\r
580 void RTC_TamperCmd(uint32_t RTC_Tamper, FunctionalState NewState);
\r
582 /* Backup Data Registers configuration functions ******************************/
\r
583 void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data);
\r
584 uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR);
\r
586 /* Output Type Config configuration functions *********************************/
\r
587 void RTC_OutputTypeConfig(uint32_t RTC_OutputType);
\r
590 /* Interrupts and flags management functions **********************************/
\r
591 void RTC_ITConfig(uint32_t RTC_IT, FunctionalState NewState);
\r
592 FlagStatus RTC_GetFlagStatus(uint32_t RTC_FLAG);
\r
593 void RTC_ClearFlag(uint32_t RTC_FLAG);
\r
594 ITStatus RTC_GetITStatus(uint32_t RTC_IT);
\r
595 void RTC_ClearITPendingBit(uint32_t RTC_IT);
\r
601 #endif /*__STM32L1xx_RTC_H */
\r
611 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
\r