STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
|
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. | |
void | HAL_RTC_MspInit (RTC_HandleTypeDef *hrtc) |
Initializes the RTC MSP. | |
void | HAL_RTC_MspDeInit (RTC_HandleTypeDef *hrtc) |
DeInitializes the RTC MSP. | |
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).
HAL_StatusTypeDef HAL_RTC_Init | ( | RTC_HandleTypeDef * | hrtc | ) |
#include <stm32f4xx_hal_rtc.h>
Initializes the RTC peripheral.
hrtc | pointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC. |
HAL | status |
Definition at line 249 of file stm32f4xx_hal_rtc.c.
References __HAL_RTC_IS_CALENDAR_INITIALIZED, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, assert_param, RTC_InitTypeDef::AsynchPrediv, HAL_ERROR, HAL_OK, HAL_RTC_AlarmAEventCallback(), HAL_RTC_MspDeInit(), HAL_RTC_MspInit(), HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, HAL_RTC_STATE_RESET, HAL_RTCEx_AlarmBEventCallback(), HAL_RTCEx_Tamper1EventCallback(), HAL_RTCEx_TimeStampEventCallback(), HAL_RTCEx_WakeUpTimerEventCallback(), HAL_UNLOCKED, RTC_InitTypeDef::HourFormat, RTC_HandleTypeDef::Init, RTC_HandleTypeDef::Instance, IS_RTC_ASYNCH_PREDIV, IS_RTC_HOUR_FORMAT, IS_RTC_OUTPUT, IS_RTC_OUTPUT_POL, IS_RTC_OUTPUT_TYPE, IS_RTC_SYNCH_PREDIV, RTC_HandleTypeDef::Lock, RTC_InitTypeDef::OutPut, RTC_InitTypeDef::OutPutPolarity, RTC_InitTypeDef::OutPutType, RTC_EnterInitMode(), RTC_ExitInitMode(), RTC_OUTPUT_TYPE_PUSHPULL, RTC_HandleTypeDef::State, and RTC_InitTypeDef::SynchPrediv.
Referenced by HAL_InitTick().
HAL_StatusTypeDef HAL_RTC_DeInit | ( | RTC_HandleTypeDef * | hrtc | ) |
#include <stm32f4xx_hal_rtc.h>
DeInitializes the RTC peripheral.
hrtc | pointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC. |
HAL | status |
Definition at line 363 of file stm32f4xx_hal_rtc.c.
References __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, __HAL_UNLOCK, assert_param, HAL_ERROR, HAL_OK, HAL_RTC_MspDeInit(), HAL_RTC_STATE_BUSY, HAL_RTC_STATE_RESET, RTC_HandleTypeDef::Instance, RTC_EnterInitMode(), RTC_ExitInitMode(), and RTC_HandleTypeDef::State.
__weak void HAL_RTC_MspInit | ( | RTC_HandleTypeDef * | hrtc | ) |
#include <stm32f4xx_hal_rtc.h>
Initializes the RTC MSP.
hrtc | pointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC. |
None |
Definition at line 641 of file stm32f4xx_hal_rtc.c.
References UNUSED.
Referenced by HAL_RTC_Init().
__weak void HAL_RTC_MspDeInit | ( | RTC_HandleTypeDef * | hrtc | ) |
#include <stm32f4xx_hal_rtc.h>
DeInitializes the RTC MSP.
hrtc | pointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC. |
None |
Definition at line 657 of file stm32f4xx_hal_rtc.c.
References UNUSED.
Referenced by HAL_RTC_DeInit(), and HAL_RTC_Init().