My Project
Loading...
Searching...
No Matches


More...

Macros

#define __HAL_RCC_HSE_CONFIG(__STATE__)
 Macro to configure the External High Speed oscillator (HSE).
 

Detailed Description


Macro Definition Documentation

◆ __HAL_RCC_HSE_CONFIG

#define __HAL_RCC_HSE_CONFIG (   __STATE__)
Value:
do{ \
if ((__STATE__) == RCC_HSE_ON) \
{ \
SET_BIT(RCC->CR, RCC_CR_HSEON); \
} \
else if ((__STATE__) == RCC_HSE_OFF) \
{ \
CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
} \
else if ((__STATE__) == RCC_HSE_BYPASS) \
{ \
SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
SET_BIT(RCC->CR, RCC_CR_HSEON); \
} \
else \
{ \
CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
} \
}while(0U)
#define RCC_CR_HSEBYP
Definition: stm32f303xe.h:10743
#define RCC_CR_HSEON
Definition: stm32f303xe.h:10737
#define RCC
Definition: stm32f303xe.h:977
#define RCC_HSE_OFF
Definition: stm32f3xx_hal_rcc.h:360
#define RCC_HSE_BYPASS
Definition: stm32f3xx_hal_rcc.h:362
#define RCC_HSE_ON
Definition: stm32f3xx_hal_rcc.h:361

Macro to configure the External High Speed oscillator (HSE).

Note
Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not supported by this macro. User should request a transition to HSE Off first and then HSE On or HSE Bypass.
After enabling the HSE (RCC_HSE_ON or RCC_HSE_Bypass), the application software should wait on HSERDY flag to be set indicating that HSE clock is stable and can be used to clock the PLL and/or system clock.
HSE state can not be changed if it is used directly or through the PLL as system clock. In this case, you have to select another source of the system clock then change the HSE state (ex. disable it).
The HSE is stopped by hardware when entering STOP and STANDBY modes.
This function reset the CSSON bit, so if the clock security system(CSS) was previously enabled you have to enable it again after calling this function.
Parameters
__STATE__specifies the new state of the HSE. This parameter can be one of the following values:
  • RCC_HSE_OFF turn OFF the HSE oscillator, HSERDY flag goes low after 6 HSE oscillator clock cycles.
  • RCC_HSE_ON turn ON the HSE oscillator
  • RCC_HSE_BYPASS HSE oscillator bypassed with external clock