Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Initialization and de-initialization functions
[RTC Exported Functions]
Initialization and Configuration functions. More...
Functions | |
| HAL_StatusTypeDef | HAL_RTC_Init (RTC_HandleTypeDef *hrtc) |
| Initialize the RTC according to the specified parameters in the RTC_InitTypeDef structure and initialize the associated handle. | |
| 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. | |
Detailed Description
Initialization and Configuration functions.
===============================================================================
##### Initialization and de-initialization functions #####
===============================================================================
[..] This section provide 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_StatusTypeDef HAL_RTC_DeInit | ( | RTC_HandleTypeDef * | hrtc ) |
DeInitialize the RTC peripheral.
- Parameters:
-
hrtc,: RTC handle
- Note:
- This function doesn't reset the RTC Backup Data registers.
- Return values:
-
HAL status
Definition at line 263 of file stm32l4xx_hal_rtc.c.
| HAL_StatusTypeDef HAL_RTC_Init | ( | RTC_HandleTypeDef * | hrtc ) |
Initialize the RTC according to the specified parameters in the RTC_InitTypeDef structure and initialize the associated handle.
- Parameters:
-
hrtc,: RTC handle
- Return values:
-
HAL status
Definition at line 186 of file stm32l4xx_hal_rtc.c.
| __weak void HAL_RTC_MspDeInit | ( | RTC_HandleTypeDef * | hrtc ) |
DeInitialize the RTC MSP.
- Parameters:
-
hrtc,: RTC handle
- Return values:
-
None
Definition at line 381 of file stm32l4xx_hal_rtc.c.
| __weak void HAL_RTC_MspInit | ( | RTC_HandleTypeDef * | hrtc ) |
Initialize the RTC MSP.
- Parameters:
-
hrtc,: RTC handle
- Return values:
-
None
Definition at line 366 of file stm32l4xx_hal_rtc.c.
Generated on Tue Jul 12 2022 11:00:05 by
1.7.2