HAL
__HAL_RCC_LSE_CONFIG is only used within HAL.
 
Symbols
loading...
Files
loading...

__HAL_RCC_LSE_CONFIG macro

Macro to configure the External Low Speed oscillator (LSE).

Syntax

#define __HAL_RCC_LSE_CONFIG(__STATE__) \     do { \     if((__STATE__) == RCC_LSE_ON) \     { \     SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \     } \     else if((__STATE__) == RCC_LSE_BYPASS) \     { \     SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \     SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \     } \     else \     { \     CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \     CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \     } \     } while(0U)

Arguments

__STATE__

specifies the new state of the LSE. This parameter can be one of the following values: @arg RCC_LSE_OFF: turn OFF the LSE oscillator, LSERDY flag goes low after 6 LSE oscillator clock cycles. @arg RCC_LSE_ON: turn ON the LSE oscillator. @arg RCC_LSE_BYPASS: LSE oscillator bypassed with external clock.

Notes

Transition LSE Bypass to LSE On and LSE On to LSE Bypass are not supported by this macro. User should request a transition to LSE Off first and then LSE On or LSE Bypass. As the LSE is in the Backup domain and write access is denied to this domain after reset, you have to enable write access using HAL_PWR_EnableBkUpAccess() function before to configure the LSE (to be done once after reset). After enabling the LSE (RCC_LSE_ON or RCC_LSE_BYPASS), the application software should wait on LSERDY flag to be set indicating that LSE clock is stable and can be used to clock the RTC.

References

LocationText
stm32f4xx_hal_rcc.h:933
#define __HAL_RCC_LSE_CONFIG(__STATE__) \
stm32f4xx_hal_rcc.c:422
__HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState);
stm32f4xx_hal_rcc_ex.c:3572
__HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState);