STM32L443xx HAL User Manual
Data Structures | Defines | Typedefs | Enumerations | Functions
stm32l4xx_hal_rtc.h File Reference

Header file of RTC HAL module. More...

#include "stm32l4xx_hal_def.h"
#include "stm32l4xx_hal_rtc_ex.h"

Go to the source code of this file.

Data Structures

struct  RTC_InitTypeDef
 RTC Configuration Structure definition. More...
struct  RTC_TimeTypeDef
 RTC Time structure definition. More...
struct  RTC_DateTypeDef
 RTC Date structure definition. More...
struct  RTC_AlarmTypeDef
 RTC Alarm structure definition. More...
struct  __RTC_HandleTypeDef
 RTC Handle Structure definition. More...

Defines

#define RTC_HOURFORMAT_24   0x00000000u
#define RTC_HOURFORMAT_12   RTC_CR_FMT
#define RTC_OUTPUT_DISABLE   0x00000000u
#define RTC_OUTPUT_ALARMA   RTC_CR_OSEL_0
#define RTC_OUTPUT_ALARMB   RTC_CR_OSEL_1
#define RTC_OUTPUT_WAKEUP   RTC_CR_OSEL
#define RTC_OUTPUT_POLARITY_HIGH   0x00000000u
#define RTC_OUTPUT_POLARITY_LOW   RTC_CR_POL
#define RTC_OUTPUT_TYPE_PUSHPULL   RTC_OR_ALARMOUTTYPE
#define RTC_OUTPUT_TYPE_OPENDRAIN   0x00000000u
#define RTC_OUTPUT_REMAP_NONE   0x00000000u
#define RTC_OUTPUT_REMAP_POS1   RTC_OR_OUT_RMP
#define RTC_HOURFORMAT12_AM   ((uint8_t)0x00)
#define RTC_HOURFORMAT12_PM   ((uint8_t)0x01)
#define RTC_DAYLIGHTSAVING_SUB1H   RTC_CR_SUB1H
#define RTC_DAYLIGHTSAVING_ADD1H   RTC_CR_ADD1H
#define RTC_DAYLIGHTSAVING_NONE   0x00000000u
#define RTC_STOREOPERATION_RESET   0x00000000u
#define RTC_STOREOPERATION_SET   RTC_CR_BKP
#define RTC_FORMAT_BIN   0x00000000u
#define RTC_FORMAT_BCD   0x00000001u
#define RTC_MONTH_JANUARY   ((uint8_t)0x01U)
#define RTC_MONTH_FEBRUARY   ((uint8_t)0x02U)
#define RTC_MONTH_MARCH   ((uint8_t)0x03U)
#define RTC_MONTH_APRIL   ((uint8_t)0x04U)
#define RTC_MONTH_MAY   ((uint8_t)0x05U)
#define RTC_MONTH_JUNE   ((uint8_t)0x06U)
#define RTC_MONTH_JULY   ((uint8_t)0x07U)
#define RTC_MONTH_AUGUST   ((uint8_t)0x08U)
#define RTC_MONTH_SEPTEMBER   ((uint8_t)0x09U)
#define RTC_MONTH_OCTOBER   ((uint8_t)0x10U)
#define RTC_MONTH_NOVEMBER   ((uint8_t)0x11U)
#define RTC_MONTH_DECEMBER   ((uint8_t)0x12U)
#define RTC_WEEKDAY_MONDAY   ((uint8_t)0x01U)
#define RTC_WEEKDAY_TUESDAY   ((uint8_t)0x02U)
#define RTC_WEEKDAY_WEDNESDAY   ((uint8_t)0x03U)
#define RTC_WEEKDAY_THURSDAY   ((uint8_t)0x04U)
#define RTC_WEEKDAY_FRIDAY   ((uint8_t)0x05U)
#define RTC_WEEKDAY_SATURDAY   ((uint8_t)0x06U)
#define RTC_WEEKDAY_SUNDAY   ((uint8_t)0x07U)
#define RTC_ALARMDATEWEEKDAYSEL_DATE   0x00000000u
#define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY   RTC_ALRMAR_WDSEL
#define RTC_ALARMMASK_NONE   0x00000000u
#define RTC_ALARMMASK_DATEWEEKDAY   RTC_ALRMAR_MSK4
#define RTC_ALARMMASK_HOURS   RTC_ALRMAR_MSK3
#define RTC_ALARMMASK_MINUTES   RTC_ALRMAR_MSK2
#define RTC_ALARMMASK_SECONDS   RTC_ALRMAR_MSK1
#define RTC_ALARMMASK_ALL
#define RTC_ALARM_A   RTC_CR_ALRAE
#define RTC_ALARM_B   RTC_CR_ALRBE
#define RTC_ALARMSUBSECONDMASK_ALL   0x00000000u
#define RTC_ALARMSUBSECONDMASK_SS14_1   RTC_ALRMASSR_MASKSS_0
#define RTC_ALARMSUBSECONDMASK_SS14_2   RTC_ALRMASSR_MASKSS_1
#define RTC_ALARMSUBSECONDMASK_SS14_3   (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_1)
#define RTC_ALARMSUBSECONDMASK_SS14_4   RTC_ALRMASSR_MASKSS_2
#define RTC_ALARMSUBSECONDMASK_SS14_5   (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_2)
#define RTC_ALARMSUBSECONDMASK_SS14_6   (RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_2)
#define RTC_ALARMSUBSECONDMASK_SS14_7   (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_2)
#define RTC_ALARMSUBSECONDMASK_SS14_8   RTC_ALRMASSR_MASKSS_3
#define RTC_ALARMSUBSECONDMASK_SS14_9   (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_3)
#define RTC_ALARMSUBSECONDMASK_SS14_10   (RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_3)
#define RTC_ALARMSUBSECONDMASK_SS14_11   (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_3)
#define RTC_ALARMSUBSECONDMASK_SS14_12   (RTC_ALRMASSR_MASKSS_2 | RTC_ALRMASSR_MASKSS_3)
#define RTC_ALARMSUBSECONDMASK_SS14_13   (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_2 | RTC_ALRMASSR_MASKSS_3)
#define RTC_ALARMSUBSECONDMASK_SS14   (RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_2 | RTC_ALRMASSR_MASKSS_3)
#define RTC_ALARMSUBSECONDMASK_NONE   RTC_ALRMASSR_MASKSS
#define RTC_IT_TS   RTC_CR_TSIE
#define RTC_IT_WUT   RTC_CR_WUTIE
#define RTC_IT_ALRA   RTC_CR_ALRAIE
#define RTC_IT_ALRB   RTC_CR_ALRBIE
#define RTC_FLAG_RECALPF   RTC_ISR_RECALPF
#define RTC_FLAG_TSOVF   RTC_ISR_TSOVF
#define RTC_FLAG_TSF   RTC_ISR_TSF
#define RTC_FLAG_ITSF   RTC_ISR_ITSF
#define RTC_FLAG_WUTF   RTC_ISR_WUTF
#define RTC_FLAG_ALRBF   RTC_ISR_ALRBF
#define RTC_FLAG_ALRAF   RTC_ISR_ALRAF
#define RTC_FLAG_INITF   RTC_ISR_INITF
#define RTC_FLAG_RSF   RTC_ISR_RSF
#define RTC_FLAG_INITS   RTC_ISR_INITS
#define RTC_FLAG_SHPF   RTC_ISR_SHPF
#define RTC_FLAG_WUTWF   RTC_ISR_WUTWF
#define RTC_FLAG_ALRBWF   RTC_ISR_ALRBWF
#define RTC_FLAG_ALRAWF   RTC_ISR_ALRAWF
#define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__)
 Reset RTC handle state.
#define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__)
 Disable the write protection for RTC registers.
#define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__)
 Enable the write protection for RTC registers.
#define __HAL_RTC_DAYLIGHT_SAVING_TIME_ADD1H(__HANDLE__, __BKP__)
 Add 1 hour (summer time change).
#define __HAL_RTC_DAYLIGHT_SAVING_TIME_SUB1H(__HANDLE__, __BKP__)
 Subtract 1 hour (winter time change).
#define __HAL_RTC_ALARMA_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRAE))
 Enable the RTC ALARMA peripheral.
#define __HAL_RTC_ALARMA_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRAE))
 Disable the RTC ALARMA peripheral.
#define __HAL_RTC_ALARMB_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRBE))
 Enable the RTC ALARMB peripheral.
#define __HAL_RTC_ALARMB_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRBE))
 Disable the RTC ALARMB peripheral.
#define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
 Enable the RTC Alarm interrupt.
#define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
 Disable the RTC Alarm interrupt.
#define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__)   (((((__HANDLE__)->Instance->ISR)& (__INTERRUPT__ >> 4)) != 0U)? 1U : 0U)
 Check whether the specified RTC Alarm interrupt has occurred or not.
#define __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)   (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != 0U) ? 1U : 0U)
 Check whether the specified RTC Alarm interrupt has been enabled or not.
#define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__)   (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U)
 Get the selected RTC Alarm's flag status.
#define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__)   ((__HANDLE__)->Instance->ISR = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)))
 Clear the RTC Alarm's pending flags.
#define __HAL_RTC_ALARM_EXTI_ENABLE_IT()   (EXTI->IMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
 Enable interrupt on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_DISABLE_IT()   (EXTI->IMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
 Disable interrupt on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT()   (EXTI->EMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
 Enable event on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT()   (EXTI->EMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
 Disable event on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE()   (EXTI->FTSR1 |= RTC_EXTI_LINE_ALARM_EVENT)
 Enable falling edge trigger on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE()   (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
 Disable falling edge trigger on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE()   (EXTI->RTSR1 |= RTC_EXTI_LINE_ALARM_EVENT)
 Enable rising edge trigger on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE()   (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
 Disable rising edge trigger on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE()
 Enable rising & falling edge trigger on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE()
 Disable rising & falling edge trigger on the RTC Alarm associated Exti line.
#define __HAL_RTC_ALARM_EXTI_GET_FLAG()   (EXTI->PR1 & RTC_EXTI_LINE_ALARM_EVENT)
 Check whether the RTC Alarm associated Exti line interrupt flag is set or not.
#define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG()   (EXTI->PR1 = RTC_EXTI_LINE_ALARM_EVENT)
 Clear the RTC Alarm associated Exti line flag.
#define __HAL_RTC_ALARM_EXTI_GENERATE_SWIT()   (EXTI->SWIER1 |= RTC_EXTI_LINE_ALARM_EVENT)
 Generate a Software interrupt on RTC Alarm associated Exti line.
#define RTC_TR_RESERVED_MASK
#define RTC_DR_RESERVED_MASK
#define RTC_INIT_MASK   0xFFFFFFFFu
#define RTC_RSF_MASK   (~(RTC_ISR_INIT | RTC_ISR_RSF))
#define RTC_TIMEOUT_VALUE   1000u
#define RTC_EXTI_LINE_ALARM_EVENT   EXTI_IMR1_IM18
#define IS_RTC_OUTPUT(OUTPUT)
#define IS_RTC_HOUR_FORMAT(FORMAT)
#define IS_RTC_OUTPUT_POL(POL)
#define IS_RTC_OUTPUT_TYPE(TYPE)
#define IS_RTC_OUTPUT_REMAP(REMAP)
#define IS_RTC_HOURFORMAT12(PM)
#define IS_RTC_DAYLIGHT_SAVING(SAVE)
#define IS_RTC_STORE_OPERATION(OPERATION)
#define IS_RTC_FORMAT(FORMAT)
#define IS_RTC_YEAR(YEAR)   ((YEAR) <= 99u)
#define IS_RTC_MONTH(MONTH)   (((MONTH) >= 1u) && ((MONTH) <= 12u))
#define IS_RTC_DATE(DATE)   (((DATE) >= 1u) && ((DATE) <= 31u))
#define IS_RTC_WEEKDAY(WEEKDAY)
#define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE)   (((DATE) >0u) && ((DATE) <= 31u))
#define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY)
#define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL)
#define IS_RTC_ALARM_MASK(MASK)   (((MASK) & ~(RTC_ALARMMASK_ALL)) == 0U)
#define IS_RTC_ALARM(ALARM)
#define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE)   ((VALUE) <= RTC_ALRMASSR_SS)
#define IS_RTC_ALARM_SUB_SECOND_MASK(MASK)
#define IS_RTC_ASYNCH_PREDIV(PREDIV)   ((PREDIV) <= (RTC_PRER_PREDIV_A >> RTC_PRER_PREDIV_A_Pos))
#define IS_RTC_SYNCH_PREDIV(PREDIV)   ((PREDIV) <= (RTC_PRER_PREDIV_S >> RTC_PRER_PREDIV_S_Pos))
#define IS_RTC_HOUR12(HOUR)   (((HOUR) > 0u) && ((HOUR) <= 12u))
#define IS_RTC_HOUR24(HOUR)   ((HOUR) <= 23u)
#define IS_RTC_MINUTES(MINUTES)   ((MINUTES) <= 59u)
#define IS_RTC_SECONDS(SECONDS)   ((SECONDS) <= 59u)

Typedefs

typedef struct __RTC_HandleTypeDef RTC_HandleTypeDef
 RTC Handle Structure definition.
typedef void(* pRTC_CallbackTypeDef )(RTC_HandleTypeDef *hrtc)
 HAL RTC Callback pointer definition.

Enumerations

enum  HAL_RTCStateTypeDef {
  HAL_RTC_STATE_RESET = 0x00U, HAL_RTC_STATE_READY = 0x01U, HAL_RTC_STATE_BUSY = 0x02U, HAL_RTC_STATE_TIMEOUT = 0x03U,
  HAL_RTC_STATE_ERROR = 0x04U
}
 HAL State structures definition. More...
enum  HAL_RTC_CallbackIDTypeDef {
  HAL_RTC_ALARM_A_EVENT_CB_ID = 0u, HAL_RTC_ALARM_B_EVENT_CB_ID = 1u, HAL_RTC_TIMESTAMP_EVENT_CB_ID = 2u, HAL_RTC_WAKEUPTIMER_EVENT_CB_ID = 3u,
  HAL_RTC_TAMPER1_EVENT_CB_ID = 4u, HAL_RTC_TAMPER2_EVENT_CB_ID = 5u, HAL_RTC_TAMPER3_EVENT_CB_ID = 6u, HAL_RTC_MSPINIT_CB_ID = 7u,
  HAL_RTC_MSPDEINIT_CB_ID = 8u
}
 HAL RTC Callback ID enumeration definition. More...

Functions

HAL_StatusTypeDef HAL_RTC_Init (RTC_HandleTypeDef *hrtc)
 Initialize the RTC peripheral.
HAL_StatusTypeDef HAL_RTC_DeInit (RTC_HandleTypeDef *hrtc)
 DeInitialize the RTC peripheral.
__weak void HAL_RTC_MspInit (RTC_HandleTypeDef *hrtc)
 Initialize the RTC MSP.
__weak void HAL_RTC_MspDeInit (RTC_HandleTypeDef *hrtc)
 DeInitialize the RTC MSP.
HAL_StatusTypeDef HAL_RTC_RegisterCallback (RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID, pRTC_CallbackTypeDef pCallback)
 Register a User RTC Callback To be used instead of the weak predefined callback.
HAL_StatusTypeDef HAL_RTC_UnRegisterCallback (RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID)
 Unregister an RTC Callback RTC callback is redirected to the weak predefined callback.
HAL_StatusTypeDef HAL_RTC_SetTime (RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format)
 Set RTC current time.
HAL_StatusTypeDef HAL_RTC_GetTime (RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format)
 Get RTC current time.
HAL_StatusTypeDef HAL_RTC_SetDate (RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format)
 Set RTC current date.
HAL_StatusTypeDef HAL_RTC_GetDate (RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format)
 Get RTC current date.
void HAL_RTC_DST_Add1Hour (RTC_HandleTypeDef *hrtc)
 Daylight Saving Time, Add one hour to the calendar in one single operation without going through the initialization procedure.
void HAL_RTC_DST_Sub1Hour (RTC_HandleTypeDef *hrtc)
 Daylight Saving Time, Substract one hour from the calendar in one single operation without going through the initialization procedure.
void HAL_RTC_DST_SetStoreOperation (RTC_HandleTypeDef *hrtc)
 Daylight Saving Time, Set the store operation bit.
void HAL_RTC_DST_ClearStoreOperation (RTC_HandleTypeDef *hrtc)
 Daylight Saving Time, Clear the store operation bit.
uint32_t HAL_RTC_DST_ReadStoreOperation (RTC_HandleTypeDef *hrtc)
 Daylight Saving Time, Read the store operation bit.
HAL_StatusTypeDef HAL_RTC_SetAlarm (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
 Set the specified RTC Alarm.
HAL_StatusTypeDef HAL_RTC_SetAlarm_IT (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
 Set the specified RTC Alarm with Interrupt.
HAL_StatusTypeDef HAL_RTC_DeactivateAlarm (RTC_HandleTypeDef *hrtc, uint32_t Alarm)
 Deactivate the specified RTC Alarm.
HAL_StatusTypeDef HAL_RTC_GetAlarm (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format)
 Get the RTC Alarm value and masks.
void HAL_RTC_AlarmIRQHandler (RTC_HandleTypeDef *hrtc)
 Handle Alarm interrupt request.
__weak void HAL_RTC_AlarmAEventCallback (RTC_HandleTypeDef *hrtc)
 Alarm A callback.
HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent (RTC_HandleTypeDef *hrtc, uint32_t Timeout)
 Handle AlarmA Polling request.
HAL_StatusTypeDef HAL_RTC_WaitForSynchro (RTC_HandleTypeDef *hrtc)
 Wait until the RTC Time and Date registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock.
HAL_RTCStateTypeDef HAL_RTC_GetState (RTC_HandleTypeDef *hrtc)
 Return the RTC handle state.
HAL_StatusTypeDef RTC_EnterInitMode (RTC_HandleTypeDef *hrtc)
 Enter the RTC Initialization mode.
HAL_StatusTypeDef RTC_ExitInitMode (RTC_HandleTypeDef *hrtc)
 Exit the RTC Initialization mode.
uint8_t RTC_ByteToBcd2 (uint8_t Value)
 Convert a 2 digit decimal to BCD format.
uint8_t RTC_Bcd2ToByte (uint8_t Value)
 Convert from 2 digit BCD to Binary.

Detailed Description

Header file of RTC HAL module.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32l4xx_hal_rtc.h.