STM32F4xx_HAL_Driver  1.8.3
Initialization and de-initialization functions

Initialization and Configuration functions. More...

+ Collaboration diagram for Initialization and de-initialization functions:

Functions

HAL_StatusTypeDef HAL_RTC_Init (RTC_HandleTypeDef *hrtc)
 Initializes the RTC peripheral. More...
 
HAL_StatusTypeDef HAL_RTC_DeInit (RTC_HandleTypeDef *hrtc)
 DeInitializes the RTC peripheral. More...
 
void HAL_RTC_MspInit (RTC_HandleTypeDef *hrtc)
 Initializes the RTC MSP. More...
 
void HAL_RTC_MspDeInit (RTC_HandleTypeDef *hrtc)
 DeInitializes the RTC MSP. More...
 
HAL_StatusTypeDef HAL_RTC_RegisterCallback (RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID, pRTC_CallbackTypeDef pCallback)
 Registers a User RTC Callback To be used instead of the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_RTC_UnRegisterCallback (RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID)
 Unregisters an RTC Callback RTC callback is redirected to the weak predefined callback. More...
 

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
   [..] This section provides functions allowing to initialize and configure the
         RTC Prescaler (Synchronous and Asynchronous), RTC Hour format, disable
         RTC registers Write protection, enter and exit the RTC initialization mode,
         RTC registers synchronization check and reference clock detection enable.
         (#) The RTC Prescaler is programmed to generate the RTC 1Hz time base.
             It is split into 2 programmable prescalers to minimize power consumption.
             (++) A 7-bit asynchronous prescaler and a 15-bit synchronous prescaler.
             (++) When both prescalers are used, it is recommended to configure the
                 asynchronous prescaler to a high value to minimize power consumption.
         (#) All RTC registers are Write protected. Writing to the RTC registers
             is enabled by writing a key into the Write Protection register, RTC_WPR.
         (#) To configure the RTC Calendar, user application should enter
             initialization mode. In this mode, the calendar counter is stopped
             and its value can be updated. When the initialization sequence is
             complete, the calendar restarts counting after 4 RTCCLK cycles.
         (#) To read the calendar through the shadow registers after Calendar
             initialization, calendar update or after wakeup from low power modes
             the software must first clear the RSF flag. The software must then
             wait until it is set again before reading the calendar, which means
             that the calendar registers have been correctly copied into the
             RTC_TR and RTC_DR shadow registers. The HAL_RTC_WaitForSynchro() function
             implements the above software sequence (RSF clear and RSF check).

Function Documentation

◆ HAL_RTC_DeInit()

HAL_StatusTypeDef HAL_RTC_DeInit ( RTC_HandleTypeDef hrtc)

DeInitializes the RTC peripheral.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Note
This function does not reset the RTC Backup Data registers.
Return values
HALstatus

Definition at line 363 of file stm32f4xx_hal_rtc.c.

◆ HAL_RTC_Init()

HAL_StatusTypeDef HAL_RTC_Init ( RTC_HandleTypeDef hrtc)

Initializes the RTC peripheral.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Return values
HALstatus

Definition at line 249 of file stm32f4xx_hal_rtc.c.

◆ HAL_RTC_MspDeInit()

__weak void HAL_RTC_MspDeInit ( RTC_HandleTypeDef hrtc)

DeInitializes the RTC MSP.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Return values
None

Definition at line 657 of file stm32f4xx_hal_rtc.c.

◆ HAL_RTC_MspInit()

__weak void HAL_RTC_MspInit ( RTC_HandleTypeDef hrtc)

Initializes the RTC MSP.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Return values
None

Definition at line 641 of file stm32f4xx_hal_rtc.c.

◆ HAL_RTC_RegisterCallback()

HAL_StatusTypeDef HAL_RTC_RegisterCallback ( RTC_HandleTypeDef hrtc,
HAL_RTC_CallbackIDTypeDef  CallbackID,
pRTC_CallbackTypeDef  pCallback 
)

Registers a User RTC Callback To be used instead of the weak predefined callback.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
CallbackIDID of the callback to be registered This parameter can be one of the following values:
Note
HAL_RTC_TAMPER2_EVENT_CB_ID is not applicable to all devices.
Parameters
pCallbackpointer to the Callback function
Return values
HALstatus

Definition at line 449 of file stm32f4xx_hal_rtc.c.

◆ HAL_RTC_UnRegisterCallback()

HAL_StatusTypeDef HAL_RTC_UnRegisterCallback ( RTC_HandleTypeDef hrtc,
HAL_RTC_CallbackIDTypeDef  CallbackID 
)

Unregisters an RTC Callback RTC callback is redirected to the weak predefined callback.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
CallbackIDID of the callback to be unregistered This parameter can be one of the following values:
Note
HAL_RTC_TAMPER2_EVENT_CB_ID is not applicable to all devices.
Return values
HALstatus

Definition at line 553 of file stm32f4xx_hal_rtc.c.