STM32F0 Standard Peripheral bibliotheek  1.0
ST Microelectronics standard peripheral bibliotheek documentatie voor de STM32F0 familie
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f0xx_rtc.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F0XX_RTC_H
31 #define __STM32F0XX_RTC_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f0xx.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 
53 typedef struct
54 {
55  uint32_t RTC_HourFormat;
58  uint32_t RTC_AsynchPrediv;
61  uint32_t RTC_SynchPrediv;
64 
68 typedef struct
69 {
70  uint8_t RTC_Hours;
75  uint8_t RTC_Minutes;
78  uint8_t RTC_Seconds;
81  uint8_t RTC_H12;
84 
88 typedef struct
89 {
90  uint8_t RTC_WeekDay;
93  uint8_t RTC_Month;
96  uint8_t RTC_Date;
99  uint8_t RTC_Year;
102 
106 typedef struct
107 {
110  uint32_t RTC_AlarmMask;
113  uint32_t RTC_AlarmDateWeekDaySel;
116  uint8_t RTC_AlarmDateWeekDay;
122 
123 /* Exported constants --------------------------------------------------------*/
124 
133 #define RTC_HourFormat_24 ((uint32_t)0x00000000)
134 #define RTC_HourFormat_12 ((uint32_t)0x00000040)
135 #define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HourFormat_12) || \
136  ((FORMAT) == RTC_HourFormat_24))
137 
144 #define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7F)
145 
154 #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FFF)
155 
163 #define IS_RTC_HOUR12(HOUR) (((HOUR) > 0) && ((HOUR) <= 12))
164 #define IS_RTC_HOUR24(HOUR) ((HOUR) <= 23)
165 #define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59)
166 #define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59)
167 
175 #define RTC_H12_AM ((uint8_t)0x00)
176 #define RTC_H12_PM ((uint8_t)0x40)
177 #define IS_RTC_H12(PM) (((PM) == RTC_H12_AM) || ((PM) == RTC_H12_PM))
178 
186 #define IS_RTC_YEAR(YEAR) ((YEAR) <= 99)
187 
195 #define RTC_Month_January ((uint8_t)0x01)
196 #define RTC_Month_February ((uint8_t)0x02)
197 #define RTC_Month_March ((uint8_t)0x03)
198 #define RTC_Month_April ((uint8_t)0x04)
199 #define RTC_Month_May ((uint8_t)0x05)
200 #define RTC_Month_June ((uint8_t)0x06)
201 #define RTC_Month_July ((uint8_t)0x07)
202 #define RTC_Month_August ((uint8_t)0x08)
203 #define RTC_Month_September ((uint8_t)0x09)
204 #define RTC_Month_October ((uint8_t)0x10)
205 #define RTC_Month_November ((uint8_t)0x11)
206 #define RTC_Month_December ((uint8_t)0x12)
207 #define IS_RTC_MONTH(MONTH) (((MONTH) >= 1) && ((MONTH) <= 12))
208 #define IS_RTC_DATE(DATE) (((DATE) >= 1) && ((DATE) <= 31))
209 
218 #define RTC_Weekday_Monday ((uint8_t)0x01)
219 #define RTC_Weekday_Tuesday ((uint8_t)0x02)
220 #define RTC_Weekday_Wednesday ((uint8_t)0x03)
221 #define RTC_Weekday_Thursday ((uint8_t)0x04)
222 #define RTC_Weekday_Friday ((uint8_t)0x05)
223 #define RTC_Weekday_Saturday ((uint8_t)0x6)
224 #define RTC_Weekday_Sunday ((uint8_t)0x07)
225 #define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
226  ((WEEKDAY) == RTC_Weekday_Tuesday) || \
227  ((WEEKDAY) == RTC_Weekday_Wednesday) || \
228  ((WEEKDAY) == RTC_Weekday_Thursday) || \
229  ((WEEKDAY) == RTC_Weekday_Friday) || \
230  ((WEEKDAY) == RTC_Weekday_Saturday) || \
231  ((WEEKDAY) == RTC_Weekday_Sunday))
232 
240 #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) > 0) && ((DATE) <= 31))
241 #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
242  ((WEEKDAY) == RTC_Weekday_Tuesday) || \
243  ((WEEKDAY) == RTC_Weekday_Wednesday) || \
244  ((WEEKDAY) == RTC_Weekday_Thursday) || \
245  ((WEEKDAY) == RTC_Weekday_Friday) || \
246  ((WEEKDAY) == RTC_Weekday_Saturday) || \
247  ((WEEKDAY) == RTC_Weekday_Sunday))
248 
257 #define RTC_AlarmDateWeekDaySel_Date ((uint32_t)0x00000000)
258 #define RTC_AlarmDateWeekDaySel_WeekDay ((uint32_t)0x40000000)
259 
260 #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_AlarmDateWeekDaySel_Date) || \
261  ((SEL) == RTC_AlarmDateWeekDaySel_WeekDay))
262 
271 #define RTC_AlarmMask_None ((uint32_t)0x00000000)
272 #define RTC_AlarmMask_DateWeekDay ((uint32_t)0x80000000)
273 #define RTC_AlarmMask_Hours ((uint32_t)0x00800000)
274 #define RTC_AlarmMask_Minutes ((uint32_t)0x00008000)
275 #define RTC_AlarmMask_Seconds ((uint32_t)0x00000080)
276 #define RTC_AlarmMask_All ((uint32_t)0x80808080)
277 #define IS_RTC_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET)
278 
286 #define RTC_Alarm_A ((uint32_t)0x00000100)
287 #define IS_RTC_ALARM(ALARM) ((ALARM) == RTC_Alarm_A)
288 #define IS_RTC_CMD_ALARM(ALARM) (((ALARM) & (RTC_Alarm_A)) != (uint32_t)RESET)
289 
297 #define RTC_AlarmSubSecondMask_All ((uint8_t)0x00)
300 #define RTC_AlarmSubSecondMask_SS14_1 ((uint8_t)0x01)
302 #define RTC_AlarmSubSecondMask_SS14_2 ((uint8_t)0x02)
304 #define RTC_AlarmSubSecondMask_SS14_3 ((uint8_t)0x03)
306 #define RTC_AlarmSubSecondMask_SS14_4 ((uint8_t)0x04)
308 #define RTC_AlarmSubSecondMask_SS14_5 ((uint8_t)0x05)
310 #define RTC_AlarmSubSecondMask_SS14_6 ((uint8_t)0x06)
312 #define RTC_AlarmSubSecondMask_SS14_7 ((uint8_t)0x07)
314 #define RTC_AlarmSubSecondMask_SS14_8 ((uint8_t)0x08)
316 #define RTC_AlarmSubSecondMask_SS14_9 ((uint8_t)0x09)
318 #define RTC_AlarmSubSecondMask_SS14_10 ((uint8_t)0x0A)
320 #define RTC_AlarmSubSecondMask_SS14_11 ((uint8_t)0x0B)
322 #define RTC_AlarmSubSecondMask_SS14_12 ((uint8_t)0x0C)
324 #define RTC_AlarmSubSecondMask_SS14_13 ((uint8_t)0x0D)
326 #define RTC_AlarmSubSecondMask_SS14 ((uint8_t)0x0E)
328 #define RTC_AlarmSubSecondMask_None ((uint8_t)0x0F)
330 #define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_AlarmSubSecondMask_All) || \
331  ((MASK) == RTC_AlarmSubSecondMask_SS14_1) || \
332  ((MASK) == RTC_AlarmSubSecondMask_SS14_2) || \
333  ((MASK) == RTC_AlarmSubSecondMask_SS14_3) || \
334  ((MASK) == RTC_AlarmSubSecondMask_SS14_4) || \
335  ((MASK) == RTC_AlarmSubSecondMask_SS14_5) || \
336  ((MASK) == RTC_AlarmSubSecondMask_SS14_6) || \
337  ((MASK) == RTC_AlarmSubSecondMask_SS14_7) || \
338  ((MASK) == RTC_AlarmSubSecondMask_SS14_8) || \
339  ((MASK) == RTC_AlarmSubSecondMask_SS14_9) || \
340  ((MASK) == RTC_AlarmSubSecondMask_SS14_10) || \
341  ((MASK) == RTC_AlarmSubSecondMask_SS14_11) || \
342  ((MASK) == RTC_AlarmSubSecondMask_SS14_12) || \
343  ((MASK) == RTC_AlarmSubSecondMask_SS14_13) || \
344  ((MASK) == RTC_AlarmSubSecondMask_SS14) || \
345  ((MASK) == RTC_AlarmSubSecondMask_None))
346 
354 #define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= 0x00007FFF)
355 
363 #define RTC_TimeStampEdge_Rising ((uint32_t)0x00000000)
364 #define RTC_TimeStampEdge_Falling ((uint32_t)0x00000008)
365 #define IS_RTC_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TimeStampEdge_Rising) || \
366  ((EDGE) == RTC_TimeStampEdge_Falling))
367 
374 #define RTC_Output_Disable ((uint32_t)0x00000000)
375 #define RTC_Output_AlarmA ((uint32_t)0x00200000)
376 
377 #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_Output_Disable) || \
378  ((OUTPUT) == RTC_Output_AlarmA))
379 
387 #define RTC_OutputPolarity_High ((uint32_t)0x00000000)
388 #define RTC_OutputPolarity_Low ((uint32_t)0x00100000)
389 #define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OutputPolarity_High) || \
390  ((POL) == RTC_OutputPolarity_Low))
391 
399 #define RTC_CalibOutput_512Hz ((uint32_t)0x00000000)
400 #define RTC_CalibOutput_1Hz ((uint32_t)0x00080000)
401 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CalibOutput_512Hz) || \
402  ((OUTPUT) == RTC_CalibOutput_1Hz))
403 
410 #define RTC_SmoothCalibPeriod_32sec ((uint32_t)0x00000000)
412 #define RTC_SmoothCalibPeriod_16sec ((uint32_t)0x00002000)
414 #define RTC_SmoothCalibPeriod_8sec ((uint32_t)0x00004000)
416 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SmoothCalibPeriod_32sec) || \
417  ((PERIOD) == RTC_SmoothCalibPeriod_16sec) || \
418  ((PERIOD) == RTC_SmoothCalibPeriod_8sec))
419 
427 #define RTC_SmoothCalibPlusPulses_Set ((uint32_t)0x00008000)
430 #define RTC_SmoothCalibPlusPulses_Reset ((uint32_t)0x00000000)
432 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SmoothCalibPlusPulses_Set) || \
433  ((PLUS) == RTC_SmoothCalibPlusPulses_Reset))
434 
442 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
443 
451 #define RTC_DayLightSaving_SUB1H ((uint32_t)0x00020000)
452 #define RTC_DayLightSaving_ADD1H ((uint32_t)0x00010000)
453 #define IS_RTC_DAYLIGHT_SAVING(SAVING) (((SAVING) == RTC_DayLightSaving_SUB1H) || \
454  ((SAVING) == RTC_DayLightSaving_ADD1H))
455 
456 #define RTC_StoreOperation_Reset ((uint32_t)0x00000000)
457 #define RTC_StoreOperation_Set ((uint32_t)0x00040000)
458 #define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_StoreOperation_Reset) || \
459  ((OPERATION) == RTC_StoreOperation_Set))
460 
467 #define RTC_TamperTrigger_RisingEdge ((uint32_t)0x00000000)
468 #define RTC_TamperTrigger_FallingEdge ((uint32_t)0x00000001)
469 #define RTC_TamperTrigger_LowLevel ((uint32_t)0x00000000)
470 #define RTC_TamperTrigger_HighLevel ((uint32_t)0x00000001)
471 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TamperTrigger_RisingEdge) || \
472  ((TRIGGER) == RTC_TamperTrigger_FallingEdge) || \
473  ((TRIGGER) == RTC_TamperTrigger_LowLevel) || \
474  ((TRIGGER) == RTC_TamperTrigger_HighLevel))
475 
483 #define RTC_TamperFilter_Disable ((uint32_t)0x00000000)
485 #define RTC_TamperFilter_2Sample ((uint32_t)0x00000800)
487 #define RTC_TamperFilter_4Sample ((uint32_t)0x00001000)
489 #define RTC_TamperFilter_8Sample ((uint32_t)0x00001800)
491 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TamperFilter_Disable) || \
492  ((FILTER) == RTC_TamperFilter_2Sample) || \
493  ((FILTER) == RTC_TamperFilter_4Sample) || \
494  ((FILTER) == RTC_TamperFilter_8Sample))
495 
502 #define RTC_TamperSamplingFreq_RTCCLK_Div32768 ((uint32_t)0x00000000)
504 #define RTC_TamperSamplingFreq_RTCCLK_Div16384 ((uint32_t)0x00000100)
506 #define RTC_TamperSamplingFreq_RTCCLK_Div8192 ((uint32_t)0x00000200)
508 #define RTC_TamperSamplingFreq_RTCCLK_Div4096 ((uint32_t)0x00000300)
510 #define RTC_TamperSamplingFreq_RTCCLK_Div2048 ((uint32_t)0x00000400)
512 #define RTC_TamperSamplingFreq_RTCCLK_Div1024 ((uint32_t)0x00000500)
514 #define RTC_TamperSamplingFreq_RTCCLK_Div512 ((uint32_t)0x00000600)
516 #define RTC_TamperSamplingFreq_RTCCLK_Div256 ((uint32_t)0x00000700)
518 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div32768) || \
519  ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div16384) || \
520  ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div8192) || \
521  ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div4096) || \
522  ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div2048) || \
523  ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div1024) || \
524  ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div512) || \
525  ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div256))
526 
534 #define RTC_TamperPrechargeDuration_1RTCCLK ((uint32_t)0x00000000)
536 #define RTC_TamperPrechargeDuration_2RTCCLK ((uint32_t)0x00002000)
538 #define RTC_TamperPrechargeDuration_4RTCCLK ((uint32_t)0x00004000)
540 #define RTC_TamperPrechargeDuration_8RTCCLK ((uint32_t)0x00006000)
543 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TamperPrechargeDuration_1RTCCLK) || \
544  ((DURATION) == RTC_TamperPrechargeDuration_2RTCCLK) || \
545  ((DURATION) == RTC_TamperPrechargeDuration_4RTCCLK) || \
546  ((DURATION) == RTC_TamperPrechargeDuration_8RTCCLK))
547 
554 #define RTC_Tamper_1 RTC_TAFCR_TAMP1E
556 #define RTC_Tamper_2 RTC_TAFCR_TAMP2E
559 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFD6) == 0x00) && ((TAMPER) != (uint32_t)RESET))
560 
568 #define RTC_OutputType_OpenDrain ((uint32_t)0x00000000)
569 #define RTC_OutputType_PushPull ((uint32_t)0x00040000)
570 #define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OutputType_OpenDrain) || \
571  ((TYPE) == RTC_OutputType_PushPull))
572 
580 #define RTC_ShiftAdd1S_Reset ((uint32_t)0x00000000)
581 #define RTC_ShiftAdd1S_Set ((uint32_t)0x80000000)
582 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_ShiftAdd1S_Reset) || \
583  ((SEL) == RTC_ShiftAdd1S_Set))
584 
591 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
601 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
602 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
603 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
604 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
605 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
606 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
607  ((BKP) == RTC_BKP_DR1) || \
608  ((BKP) == RTC_BKP_DR2) || \
609  ((BKP) == RTC_BKP_DR3) || \
610  ((BKP) == RTC_BKP_DR4))
611 
618 #define RTC_Format_BIN ((uint32_t)0x000000000)
619 #define RTC_Format_BCD ((uint32_t)0x000000001)
620 #define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_Format_BIN) || ((FORMAT) == RTC_Format_BCD))
621 
629 #define RTC_FLAG_RECALPF ((uint32_t)0x00010000)
630 #define RTC_FLAG_TAMP2F ((uint32_t)0x00004000)
631 #define RTC_FLAG_TAMP1F ((uint32_t)0x00002000)
632 #define RTC_FLAG_TSOVF ((uint32_t)0x00001000)
633 #define RTC_FLAG_TSF ((uint32_t)0x00000800)
634 #define RTC_FLAG_ALRAF ((uint32_t)0x00000100)
635 #define RTC_FLAG_INITF ((uint32_t)0x00000040)
636 #define RTC_FLAG_RSF ((uint32_t)0x00000020)
637 #define RTC_FLAG_INITS ((uint32_t)0x00000010)
638 #define RTC_FLAG_SHPF ((uint32_t)0x00000008)
639 
640 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RECALPF) || ((FLAG) == RTC_FLAG_SHPF) || \
641  ((FLAG) == RTC_FLAG_TAMP2F) || ((FLAG) == RTC_FLAG_TAMP1F) || \
642  ((FLAG) == RTC_FLAG_TSOVF) || ((FLAG) == RTC_FLAG_TSF) || \
643  ((FLAG) == RTC_FLAG_ALRAF) || ((FLAG) == RTC_FLAG_INITF) || \
644  ((FLAG) == RTC_FLAG_RSF) || ((FLAG) == RTC_FLAG_INITS))
645 #define IS_RTC_CLEAR_FLAG(FLAG) (((FLAG) != (uint32_t)RESET) && (((FLAG) & 0xFFFF86DF) == (uint32_t)RESET))
646 
654 #define RTC_IT_TS ((uint32_t)0x00008000)
655 #define RTC_IT_ALRA ((uint32_t)0x00001000)
656 #define RTC_IT_TAMP ((uint32_t)0x00000004) /* Used only to Enable the Tamper Interrupt */
657 #define RTC_IT_TAMP1 ((uint32_t)0x00020000)
658 #define RTC_IT_TAMP2 ((uint32_t)0x00040000)
659 
660 #define IS_RTC_CONFIG_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFFF6FFB) == (uint32_t)RESET))
661 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_TS) || ((IT) == RTC_IT_ALRA) || \
662  ((IT) == RTC_IT_TAMP1) || ((IT) == RTC_IT_TAMP2))
663 
664 #define IS_RTC_CLEAR_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFF96FFF) == (uint32_t)RESET))
665 
675 /* Exported macro ------------------------------------------------------------*/
676 /* Exported functions ------------------------------------------------------- */
677 /* Function used to set the RTC configuration to the default reset state *****/
678 ErrorStatus RTC_DeInit(void);
679 
680 
681 /* Initialization and Configuration functions *********************************/
682 ErrorStatus RTC_Init(RTC_InitTypeDef* RTC_InitStruct);
683 void RTC_StructInit(RTC_InitTypeDef* RTC_InitStruct);
684 void RTC_WriteProtectionCmd(FunctionalState NewState);
685 ErrorStatus RTC_EnterInitMode(void);
686 void RTC_ExitInitMode(void);
687 ErrorStatus RTC_WaitForSynchro(void);
688 ErrorStatus RTC_RefClockCmd(FunctionalState NewState);
689 void RTC_BypassShadowCmd(FunctionalState NewState);
690 
691 /* Time and Date configuration functions **************************************/
692 ErrorStatus RTC_SetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
693 void RTC_TimeStructInit(RTC_TimeTypeDef* RTC_TimeStruct);
694 void RTC_GetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
695 uint32_t RTC_GetSubSecond(void);
696 ErrorStatus RTC_SetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
697 void RTC_DateStructInit(RTC_DateTypeDef* RTC_DateStruct);
698 void RTC_GetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
699 
700 /* Alarms (Alarm A) configuration functions **********************************/
701 void RTC_SetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
702 void RTC_AlarmStructInit(RTC_AlarmTypeDef* RTC_AlarmStruct);
703 void RTC_GetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
704 ErrorStatus RTC_AlarmCmd(uint32_t RTC_Alarm, FunctionalState NewState);
705 void RTC_AlarmSubSecondConfig(uint32_t RTC_Alarm, uint32_t RTC_AlarmSubSecondValue, uint8_t RTC_AlarmSubSecondMask);
706 uint32_t RTC_GetAlarmSubSecond(uint32_t RTC_Alarm);
707 
708 /* Daylight Saving configuration functions ************************************/
709 void RTC_DayLightSavingConfig(uint32_t RTC_DayLightSaving, uint32_t RTC_StoreOperation);
710 uint32_t RTC_GetStoreOperation(void);
711 
712 /* Output pin Configuration function ******************************************/
713 void RTC_OutputConfig(uint32_t RTC_Output, uint32_t RTC_OutputPolarity);
714 
715 /* Digital Calibration configuration functions ********************************/
716 void RTC_CalibOutputCmd(FunctionalState NewState);
717 void RTC_CalibOutputConfig(uint32_t RTC_CalibOutput);
718 ErrorStatus RTC_SmoothCalibConfig(uint32_t RTC_SmoothCalibPeriod,
719  uint32_t RTC_SmoothCalibPlusPulses,
720  uint32_t RTC_SmouthCalibMinusPulsesValue);
721 
722 /* TimeStamp configuration functions ******************************************/
723 void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState);
724 void RTC_GetTimeStamp(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_StampTimeStruct, RTC_DateTypeDef* RTC_StampDateStruct);
725 uint32_t RTC_GetTimeStampSubSecond(void);
726 
727 /* Tampers configuration functions ********************************************/
728 void RTC_TamperTriggerConfig(uint32_t RTC_Tamper, uint32_t RTC_TamperTrigger);
729 void RTC_TamperCmd(uint32_t RTC_Tamper, FunctionalState NewState);
730 void RTC_TamperFilterConfig(uint32_t RTC_TamperFilter);
731 void RTC_TamperSamplingFreqConfig(uint32_t RTC_TamperSamplingFreq);
732 void RTC_TamperPinsPrechargeDuration(uint32_t RTC_TamperPrechargeDuration);
733 void RTC_TimeStampOnTamperDetectionCmd(FunctionalState NewState);
734 void RTC_TamperPullUpCmd(FunctionalState NewState);
735 
736 /* Backup Data Registers configuration functions ******************************/
737 void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data);
738 uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR);
739 
740 /* Output Type Config configuration functions *********************************/
741 void RTC_OutputTypeConfig(uint32_t RTC_OutputType);
742 
743 /* RTC_Shift_control_synchonisation_functions *********************************/
744 ErrorStatus RTC_SynchroShiftConfig(uint32_t RTC_ShiftAdd1S, uint32_t RTC_ShiftSubFS);
745 
746 /* Interrupts and flags management functions **********************************/
747 void RTC_ITConfig(uint32_t RTC_IT, FunctionalState NewState);
748 FlagStatus RTC_GetFlagStatus(uint32_t RTC_FLAG);
749 void RTC_ClearFlag(uint32_t RTC_FLAG);
750 ITStatus RTC_GetITStatus(uint32_t RTC_IT);
751 void RTC_ClearITPendingBit(uint32_t RTC_IT);
752 
753 #ifdef __cplusplus
754 }
755 #endif
756 
757 #endif /*__STM32F0XX_RTC_H */
758 
767 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/