DIY Logging Volt/Ampmeter

Macros

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

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)

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
<strong>STATE</strong>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

Definition at line 752 of file stm32f1xx_hal_rcc.h.

RCC_CR_HSEON
#define RCC_CR_HSEON
Definition: stm32f103xb.h:915
RCC_HSE_OFF
#define RCC_HSE_OFF
Definition: stm32f1xx_hal_rcc.h:117
RCC_HSE_BYPASS
#define RCC_HSE_BYPASS
Definition: stm32f1xx_hal_rcc.h:119
RCC_HSE_ON
#define RCC_HSE_ON
Definition: stm32f1xx_hal_rcc.h:118
RCC
#define RCC
Definition: stm32f103xb.h:684
RCC_CR_HSEBYP
#define RCC_CR_HSEBYP
Definition: stm32f103xb.h:921