2 ******************************************************************************
3 * @file stm32l1xx_hal_rtc.h
4 * @author MCD Application Team
6 * @date 5-September-2014
7 * @brief Header file of RTC HAL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32L1xx_HAL_RTC_H
40 #define __STM32L1xx_HAL_RTC_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32l1xx_hal_def.h"
49 /** @addtogroup STM32L1xx_HAL_Driver
57 /* Exported types ------------------------------------------------------------*/
58 /** @defgroup RTC_Exported_Types RTC Exported Types
63 * @brief HAL State structures definition
67 HAL_RTC_STATE_RESET = 0x00, /*!< RTC not yet initialized or disabled */
68 HAL_RTC_STATE_READY = 0x01, /*!< RTC initialized and ready for use */
69 HAL_RTC_STATE_BUSY = 0x02, /*!< RTC process is ongoing */
70 HAL_RTC_STATE_TIMEOUT = 0x03, /*!< RTC timeout state */
71 HAL_RTC_STATE_ERROR = 0x04 /*!< RTC error state */
76 * @brief RTC Configuration Structure definition
80 uint32_t HourFormat; /*!< Specifies the RTC Hour Format.
81 This parameter can be a value of @ref RTC_Hour_Formats */
83 uint32_t AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value.
84 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F */
86 uint32_t SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value.
87 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF */
89 uint32_t OutPut; /*!< Specifies which signal will be routed to the RTC output.
90 This parameter can be a value of @ref RTCEx_Output_selection_Definitions */
92 uint32_t OutPutPolarity; /*!< Specifies the polarity of the output signal.
93 This parameter can be a value of @ref RTC_Output_Polarity_Definitions */
95 uint32_t OutPutType; /*!< Specifies the RTC Output Pin mode.
96 This parameter can be a value of @ref RTC_Output_Type_ALARM_OUT */
100 * @brief RTC Date structure definition
104 uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay.
105 This parameter can be a value of @ref RTC_WeekDay_Definitions */
107 uint8_t Month; /*!< Specifies the RTC Date Month (in BCD format).
108 This parameter can be a value of @ref RTC_Month_Date_Definitions */
110 uint8_t Date; /*!< Specifies the RTC Date.
111 This parameter must be a number between Min_Data = 1 and Max_Data = 31 */
113 uint8_t Year; /*!< Specifies the RTC Date Year.
114 This parameter must be a number between Min_Data = 0 and Max_Data = 99 */
119 * @brief Time Handle Structure definition
123 RTC_TypeDef *Instance; /*!< Register base address */
125 RTC_InitTypeDef Init; /*!< RTC required parameters */
127 HAL_LockTypeDef Lock; /*!< RTC locking object */
129 __IO HAL_RTCStateTypeDef State; /*!< Time communication state */
137 /* Exported constants --------------------------------------------------------*/
138 /** @defgroup RTC_Exported_Constants RTC Exported Constants
142 /** @defgroup RTC_Timeout_Value Default Timeout Value
145 #define RTC_TIMEOUT_VALUE 1000
150 /** @defgroup RTC_Hour_Formats Hour Formats
153 #define RTC_HOURFORMAT_24 ((uint32_t)0x00000000)
154 #define RTC_HOURFORMAT_12 ((uint32_t)0x00000040)
156 #define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HOURFORMAT_12) || \
157 ((FORMAT) == RTC_HOURFORMAT_24))
162 /** @defgroup RTC_Output_Polarity_Definitions Outpout Polarity
165 #define RTC_OUTPUT_POLARITY_HIGH ((uint32_t)0x00000000)
166 #define RTC_OUTPUT_POLARITY_LOW ((uint32_t)0x00100000)
168 #define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OUTPUT_POLARITY_HIGH) || \
169 ((POL) == RTC_OUTPUT_POLARITY_LOW))
174 /** @defgroup RTC_Output_Type_ALARM_OUT Alarm Output Type
177 #define RTC_OUTPUT_TYPE_OPENDRAIN ((uint32_t)0x00000000)
178 #define RTC_OUTPUT_TYPE_PUSHPULL ((uint32_t)0x00040000)
180 #define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OUTPUT_TYPE_OPENDRAIN) || \
181 ((TYPE) == RTC_OUTPUT_TYPE_PUSHPULL))
187 /** @defgroup RTC_Asynchronous_Predivider Asynchronous Predivider
190 #define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7F)
195 /** @defgroup RTC_Time_Definitions Time Definitions
198 #define IS_RTC_HOUR12(HOUR) (((HOUR) > (uint32_t)0) && ((HOUR) <= (uint32_t)12))
199 #define IS_RTC_HOUR24(HOUR) ((HOUR) <= (uint32_t)23)
200 #define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= (uint32_t)59)
201 #define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= (uint32_t)59)
206 /** @defgroup RTC_AM_PM_Definitions AM PM Definitions
209 #define RTC_HOURFORMAT12_AM ((uint8_t)0x00)
210 #define RTC_HOURFORMAT12_PM ((uint8_t)0x40)
212 #define IS_RTC_HOURFORMAT12(PM) (((PM) == RTC_HOURFORMAT12_AM) || ((PM) == RTC_HOURFORMAT12_PM))
217 /** @defgroup RTC_DayLightSaving_Definitions DayLightSaving
220 #define RTC_DAYLIGHTSAVING_SUB1H ((uint32_t)0x00020000)
221 #define RTC_DAYLIGHTSAVING_ADD1H ((uint32_t)0x00010000)
222 #define RTC_DAYLIGHTSAVING_NONE ((uint32_t)0x00000000)
224 #define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DAYLIGHTSAVING_SUB1H) || \
225 ((SAVE) == RTC_DAYLIGHTSAVING_ADD1H) || \
226 ((SAVE) == RTC_DAYLIGHTSAVING_NONE))
231 /** @defgroup RTC_StoreOperation_Definitions StoreOperation
234 #define RTC_STOREOPERATION_RESET ((uint32_t)0x00000000)
235 #define RTC_STOREOPERATION_SET ((uint32_t)0x00040000)
237 #define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_STOREOPERATION_RESET) || \
238 ((OPERATION) == RTC_STOREOPERATION_SET))
243 /** @defgroup RTC_Input_parameter_format_definitions Input Parameter Format
246 #define FORMAT_BIN ((uint32_t)0x000000000)
247 #define FORMAT_BCD ((uint32_t)0x000000001)
249 #define IS_RTC_FORMAT(FORMAT) (((FORMAT) == FORMAT_BIN) || ((FORMAT) == FORMAT_BCD))
254 /** @defgroup RTC_Year_Date_Definitions Year Definitions
257 #define IS_RTC_YEAR(YEAR) ((YEAR) <= (uint32_t)99)
262 /** @defgroup RTC_Month_Date_Definitions Month Definitions
266 /* Coded in BCD format */
267 #define RTC_MONTH_JANUARY ((uint8_t)0x01)
268 #define RTC_MONTH_FEBRUARY ((uint8_t)0x02)
269 #define RTC_MONTH_MARCH ((uint8_t)0x03)
270 #define RTC_MONTH_APRIL ((uint8_t)0x04)
271 #define RTC_MONTH_MAY ((uint8_t)0x05)
272 #define RTC_MONTH_JUNE ((uint8_t)0x06)
273 #define RTC_MONTH_JULY ((uint8_t)0x07)
274 #define RTC_MONTH_AUGUST ((uint8_t)0x08)
275 #define RTC_MONTH_SEPTEMBER ((uint8_t)0x09)
276 #define RTC_MONTH_OCTOBER ((uint8_t)0x10)
277 #define RTC_MONTH_NOVEMBER ((uint8_t)0x11)
278 #define RTC_MONTH_DECEMBER ((uint8_t)0x12)
280 #define IS_RTC_MONTH(MONTH) (((MONTH) >= (uint32_t)1) && ((MONTH) <= (uint32_t)12))
281 #define IS_RTC_DATE(DATE) (((DATE) >= (uint32_t)1) && ((DATE) <= (uint32_t)31))
286 /** @defgroup RTC_WeekDay_Definitions WeekDay Definitions
289 #define RTC_WEEKDAY_MONDAY ((uint8_t)0x01)
290 #define RTC_WEEKDAY_TUESDAY ((uint8_t)0x02)
291 #define RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03)
292 #define RTC_WEEKDAY_THURSDAY ((uint8_t)0x04)
293 #define RTC_WEEKDAY_FRIDAY ((uint8_t)0x05)
294 #define RTC_WEEKDAY_SATURDAY ((uint8_t)0x06)
295 #define RTC_WEEKDAY_SUNDAY ((uint8_t)0x07)
297 #define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \
298 ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \
299 ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \
300 ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \
301 ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \
302 ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \
303 ((WEEKDAY) == RTC_WEEKDAY_SUNDAY))
308 /** @defgroup RTC_Alarm_Definitions Alarm Definitions
311 #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) >(uint32_t) 0) && ((DATE) <= (uint32_t)31))
312 #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \
313 ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \
314 ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \
315 ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \
316 ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \
317 ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \
318 ((WEEKDAY) == RTC_WEEKDAY_SUNDAY))
324 /** @defgroup RTC_AlarmDateWeekDay_Definitions AlarmDateWeekDay Definitions
327 #define RTC_ALARMDATEWEEKDAYSEL_DATE ((uint32_t)0x00000000)
328 #define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY ((uint32_t)0x40000000)
330 #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \
331 ((SEL) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY))
337 /** @defgroup RTC_AlarmMask_Definitions Alarm Mask Definitions
340 #define RTC_ALARMMASK_NONE ((uint32_t)0x00000000)
341 #define RTC_ALARMMASK_DATEWEEKDAY RTC_ALRMAR_MSK4
342 #define RTC_ALARMMASK_HOURS RTC_ALRMAR_MSK3
343 #define RTC_ALARMMASK_MINUTES RTC_ALRMAR_MSK2
344 #define RTC_ALARMMASK_SECONDS RTC_ALRMAR_MSK1
345 #define RTC_ALARMMASK_ALL ((uint32_t)0x80808080)
347 #define IS_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET)
352 /** @defgroup RTC_Alarms_Definitions Alarms Definitions
355 #define RTC_ALARM_A RTC_CR_ALRAE
356 #define RTC_ALARM_B RTC_CR_ALRBE
358 #define IS_ALARM(ALARM) (((ALARM) == RTC_ALARM_A) || ((ALARM) == RTC_ALARM_B))
367 /* Exported macro ------------------------------------------------------------*/
368 /** @defgroup RTC_Exported_macros RTC Exported Macros
372 /** @brief Reset RTC handle state
373 * @param __HANDLE__: RTC handle.
376 #define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RTC_STATE_RESET)
379 * @brief Disable the write protection for RTC registers.
380 * @param __HANDLE__: specifies the RTC handle.
383 #define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__) \
385 (__HANDLE__)->Instance->WPR = 0xCA; \
386 (__HANDLE__)->Instance->WPR = 0x53; \
390 * @brief Enable the write protection for RTC registers.
391 * @param __HANDLE__: specifies the RTC handle.
394 #define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__) \
396 (__HANDLE__)->Instance->WPR = 0xFF; \
400 * @brief Enable the RTC ALARMA peripheral.
401 * @param __HANDLE__: specifies the RTC handle.
404 #define __HAL_RTC_ALARMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRAE))
407 * @brief Disable the RTC ALARMA peripheral.
408 * @param __HANDLE__: specifies the RTC handle.
411 #define __HAL_RTC_ALARMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRAE))
414 * @brief Enable the RTC ALARMB peripheral.
415 * @param __HANDLE__: specifies the RTC handle.
418 #define __HAL_RTC_ALARMB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRBE))
421 * @brief Disable the RTC ALARMB peripheral.
422 * @param __HANDLE__: specifies the RTC handle.
425 #define __HAL_RTC_ALARMB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRBE))
428 * @brief Enable the RTC Alarm interrupt.
429 * @param __HANDLE__: specifies the RTC handle.
430 * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled.
431 * This parameter can be any combination of the following values:
432 * @arg RTC_IT_ALRA: Alarm A interrupt
433 * @arg RTC_IT_ALRB: Alarm B interrupt
436 #define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
439 * @brief Disable the RTC Alarm interrupt.
440 * @param __HANDLE__: specifies the RTC handle.
441 * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled.
442 * This parameter can be any combination of the following values:
443 * @arg RTC_IT_ALRA: Alarm A interrupt
444 * @arg RTC_IT_ALRB: Alarm B interrupt
447 #define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
450 * @brief Check whether the specified RTC Alarm interrupt has occurred or not.
451 * @param __HANDLE__: specifies the RTC handle.
452 * @param __FLAG__: specifies the RTC Alarm interrupt sources to be enabled or disabled.
453 * This parameter can be:
454 * @arg RTC_IT_ALRA: Alarm A interrupt
455 * @arg RTC_IT_ALRB: Alarm B interrupt
458 #define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __FLAG__) ((((((__HANDLE__)->Instance->ISR)& ((__FLAG__)>> 4)) & 0x0000FFFF) != RESET)? SET : RESET)
461 * @brief Get the selected RTC Alarm's flag status.
462 * @param __HANDLE__: specifies the RTC handle.
463 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
464 * This parameter can be:
465 * @arg RTC_FLAG_ALRAF
466 * @arg RTC_FLAG_ALRBF
467 * @arg RTC_FLAG_ALRAWF
468 * @arg RTC_FLAG_ALRBWF
471 #define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
474 * @brief Clear the RTC Alarm's pending flags.
475 * @param __HANDLE__: specifies the RTC handle.
476 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
477 * This parameter can be:
478 * @arg RTC_FLAG_ALRAF
479 * @arg RTC_FLAG_ALRBF
482 #define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
485 #define RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)0x00020000) /*!< External interrupt line 17 Connected to the RTC Alarm event */
486 #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)0x00080000) /*!< External interrupt line 19 Connected to the RTC Tamper and Time Stamp events */
487 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the RTC Wakeup event */
490 * @brief Enable the RTC Exti line.
491 * @param __EXTILINE__: specifies the RTC Exti sources to be enabled or disabled.
492 * This parameter can be:
493 * @arg RTC_EXTI_LINE_ALARM_EVENT
494 * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT
495 * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT
498 #define __HAL_RTC_EXTI_ENABLE_IT(__EXTILINE__) (EXTI->IMR |= (__EXTILINE__))
500 /* alias define maintained for legacy */
501 #define __HAL_RTC_ENABLE_IT __HAL_RTC_EXTI_ENABLE_IT
504 * @brief Disable the RTC Exti line.
505 * @param __EXTILINE__: specifies the RTC Exti sources to be enabled or disabled.
506 * This parameter can be:
507 * @arg RTC_EXTI_LINE_ALARM_EVENT
508 * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT
509 * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT
512 #define __HAL_RTC_EXTI_DISABLE_IT(__EXTILINE__) (EXTI->IMR &= ~(__EXTILINE__))
514 /* alias define maintained for legacy */
515 #define __HAL_RTC_DISABLE_IT __HAL_RTC_EXTI_DISABLE_IT
518 * @brief Generates a Software interrupt on selected EXTI line.
519 * @param __EXTILINE__: specifies the RTC Exti sources to be enabled or disabled.
520 * This parameter can be:
521 * @arg RTC_EXTI_LINE_ALARM_EVENT
522 * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT
523 * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT
526 #define __HAL_RTC_EXTI_GENERATE_SWIT(__EXTILINE__) (EXTI->SWIER |= (__EXTILINE__))
529 * @brief Clear the RTC Exti flags.
530 * @param __FLAG__: specifies the RTC Exti sources to be enabled or disabled.
531 * This parameter can be:
532 * @arg RTC_EXTI_LINE_ALARM_EVENT
533 * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT
534 * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT
537 #define __HAL_RTC_EXTI_CLEAR_FLAG(__FLAG__) (EXTI->PR = (__FLAG__))
539 /* alias define maintained for legacy */
540 #define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG
546 /* Include RTC HAL Extension module */
547 #include "stm32l1xx_hal_rtc_ex.h"
549 /* Exported functions --------------------------------------------------------*/
550 /** @addtogroup RTC_Exported_Functions
555 /* Initialization and de-initialization functions ****************************/
556 /** @addtogroup RTC_Exported_Functions_Group1
559 HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc);
560 HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc);
561 void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc);
562 void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc);
567 /* RTC Time and Date functions ************************************************/
568 /** @addtogroup RTC_Exported_Functions_Group1
571 HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format);
572 HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format);
573 HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format);
574 HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format);
579 /* RTC Alarm functions ********************************************************/
580 /** @addtogroup RTC_Exported_Functions_Group2
583 HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format);
584 HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format);
585 HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alarm);
586 HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format);
587 void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc);
588 HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
589 void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc);
594 /* Peripheral Control functions ***********************************************/
595 /** @addtogroup RTC_Exported_Functions_Group3
598 HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef* hrtc);
603 /* Peripheral State functions *************************************************/
604 /** @addtogroup RTC_Exported_Functions_Group5
607 HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc);
615 /* Private functions **********************************************************/
616 /** @addtogroup RTC_Internal_Functions
619 HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef* hrtc);
620 uint8_t RTC_ByteToBcd2(uint8_t Value);
621 uint8_t RTC_Bcd2ToByte(uint8_t Value);
639 #endif /* __STM32L1xx_HAL_RTC_H */
641 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/