My Project
Loading...
Searching...
No Matches
RCC RTC Clock Configuration


More...

Macros

#define __HAL_RCC_RTC_CONFIG(__RTC_CLKSOURCE__)   MODIFY_REG(RCC->BDCR, RCC_BDCR_RTCSEL, (__RTC_CLKSOURCE__))
 Macro to configure the RTC clock (RTCCLK).
 
#define __HAL_RCC_GET_RTC_SOURCE()   (READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL))
 Macro to get the RTC clock source.
 
#define __HAL_RCC_RTC_ENABLE()   (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = ENABLE)
 Macro to enable the the RTC clock.
 
#define __HAL_RCC_RTC_DISABLE()   (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = DISABLE)
 Macro to disable the the RTC clock.
 
#define __HAL_RCC_BACKUPRESET_FORCE()   (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = ENABLE)
 Macro to force the Backup domain reset.
 
#define __HAL_RCC_BACKUPRESET_RELEASE()   (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = DISABLE)
 Macros to release the Backup domain reset.
 

Detailed Description


Macro Definition Documentation

◆ __HAL_RCC_BACKUPRESET_FORCE

#define __HAL_RCC_BACKUPRESET_FORCE ( )    (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = ENABLE)

Macro to force the Backup domain reset.

Note
This function resets the RTC peripheral (including the backup registers) and the RTC clock source selection in RCC_BDCR register.

◆ __HAL_RCC_BACKUPRESET_RELEASE

#define __HAL_RCC_BACKUPRESET_RELEASE ( )    (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = DISABLE)

Macros to release the Backup domain reset.

◆ __HAL_RCC_GET_RTC_SOURCE

#define __HAL_RCC_GET_RTC_SOURCE ( )    (READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL))

Macro to get the RTC clock source.

Return values
Theclock source can be one of the following values:

◆ __HAL_RCC_RTC_CONFIG

#define __HAL_RCC_RTC_CONFIG (   __RTC_CLKSOURCE__)    MODIFY_REG(RCC->BDCR, RCC_BDCR_RTCSEL, (__RTC_CLKSOURCE__))

Macro to configure the RTC clock (RTCCLK).

Note
As the RTC clock configuration bits are in the Backup domain and write access is denied to this domain after reset, you have to enable write access using the Power Backup Access macro before to configure the RTC clock source (to be done once after reset).
Once the RTC clock is configured it cannot be changed unless the
Backup domain is reset using __HAL_RCC_BACKUPRESET_FORCE() macro, or by a Power On Reset (POR).
Parameters
__RTC_CLKSOURCE__specifies the RTC clock source. This parameter can be one of the following values:
Note
If the LSE or LSI is used as RTC clock source, the RTC continues to work in STOP and STANDBY modes, and can be used as wakeup source. However, when the LSI clock and HSE clock divided by 32 is used as RTC clock source, the RTC cannot be used in STOP and STANDBY modes.
The system must always be configured so as to get a PCLK frequency greater than or equal to the RTCCLK frequency for a proper operation of the RTC.

◆ __HAL_RCC_RTC_DISABLE

#define __HAL_RCC_RTC_DISABLE ( )    (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = DISABLE)

Macro to disable the the RTC clock.

Note
These macros must be used only after the RTC clock source was selected.

◆ __HAL_RCC_RTC_ENABLE

#define __HAL_RCC_RTC_ENABLE ( )    (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = ENABLE)

Macro to enable the the RTC clock.

Note
These macros must be used only after the RTC clock source was selected.