STM32F103xB HAL User Manual
Functions
Initialization and de-initialization functions
RTC Exported Functions

Initialization and Configuration functions. More...

Functions

HAL_StatusTypeDef HAL_RTC_Init (RTC_HandleTypeDef *hrtc)
 Initializes the RTC peripheral.
HAL_StatusTypeDef HAL_RTC_DeInit (RTC_HandleTypeDef *hrtc)
 DeInitializes the RTC peripheral.
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 callabck is redirected to the weak predefined callback.
__weak void HAL_RTC_MspInit (RTC_HandleTypeDef *hrtc)
 Initializes the RTC MSP.
__weak void HAL_RTC_MspDeInit (RTC_HandleTypeDef *hrtc)
 DeInitializes the RTC MSP.

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
   [..] This section provides functions allowing to initialize and configure the
         RTC Prescaler (Asynchronous), disable RTC registers Write protection,
         enter and exit the RTC initialization mode,
         RTC registers synchronization check and reference clock detection enable.
         (#) The RTC Prescaler should be programmed to generate the RTC 1Hz time base.
         (#) All RTC registers are Write protected. Writing to the RTC registers
             is enabled by setting the CNF bit in the RTC_CRL register.
         (#) To read the calendar after wakeup from low power modes (Standby or Stop)
             the software must first wait for the RSF bit (Register Synchronized Flag)
             in the RTC_CRL register to be set by hardware.
             The HAL_RTC_WaitForSynchro() function implements the above software
             sequence (RSF clear and RSF check).


Function Documentation

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 411 of file stm32f1xx_hal_rtc.c.

References assert_param, HAL_RTC_MspDeInit(), HAL_RTC_STATE_BUSY, HAL_RTC_STATE_ERROR, HAL_RTC_STATE_RESET, HAL_RTC_WaitForSynchro(), __RTC_HandleTypeDef::Instance, __RTC_HandleTypeDef::MspDeInitCallback, RTC_EnterInitMode(), RTC_ExitInitMode(), RTC_FLAG_RSF, and __RTC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_RTC_Init ( 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 665 of file stm32f1xx_hal_rtc.c.

Referenced by HAL_RTC_DeInit(), HAL_RTC_Init(), and HAL_RTC_UnRegisterCallback().

Initializes the RTC MSP.

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

Definition at line 650 of file stm32f1xx_hal_rtc.c.

Referenced by HAL_RTC_Init(), and HAL_RTC_UnRegisterCallback().

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.

Parameters:
hrtcRTC handle
CallbackIDID of the callback to be registered This parameter can be one of the following values:
pCallbackpointer to the Callback function
Return values:
HALstatus

Definition at line 500 of file stm32f1xx_hal_rtc.c.

References __RTC_HandleTypeDef::AlarmAEventCallback, HAL_RTC_ALARM_A_EVENT_CB_ID, HAL_RTC_MSPDEINIT_CB_ID, HAL_RTC_MSPINIT_CB_ID, HAL_RTC_STATE_READY, HAL_RTC_STATE_RESET, HAL_RTC_TAMPER1_EVENT_CB_ID, __RTC_HandleTypeDef::MspDeInitCallback, __RTC_HandleTypeDef::MspInitCallback, __RTC_HandleTypeDef::State, and __RTC_HandleTypeDef::Tamper1EventCallback.

HAL_StatusTypeDef HAL_RTC_UnRegisterCallback ( RTC_HandleTypeDef hrtc,
HAL_RTC_CallbackIDTypeDef  CallbackID 
)

Unregister an RTC Callback RTC callabck is redirected to the weak predefined callback.

Parameters:
hrtcRTC handle
CallbackIDID of the callback to be unregistered This parameter can be one of the following values:
Return values:
HALstatus

Definition at line 580 of file stm32f1xx_hal_rtc.c.

References __RTC_HandleTypeDef::AlarmAEventCallback, HAL_RTC_ALARM_A_EVENT_CB_ID, HAL_RTC_AlarmAEventCallback(), HAL_RTC_MspDeInit(), HAL_RTC_MSPDEINIT_CB_ID, HAL_RTC_MspInit(), HAL_RTC_MSPINIT_CB_ID, HAL_RTC_STATE_READY, HAL_RTC_STATE_RESET, HAL_RTC_TAMPER1_EVENT_CB_ID, HAL_RTCEx_Tamper1EventCallback(), __RTC_HandleTypeDef::MspDeInitCallback, __RTC_HandleTypeDef::MspInitCallback, __RTC_HandleTypeDef::State, and __RTC_HandleTypeDef::Tamper1EventCallback.