mikroSDK Reference Manual

Macros

#define __HAL_RCC_SYSCLK_CONFIG(__SYSCLKSOURCE__)    MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__SYSCLKSOURCE__))
 Macro to configure the system clock source.
 
#define __HAL_RCC_GET_SYSCLK_SOURCE()   ((uint32_t)(READ_BIT(RCC->CFGR,RCC_CFGR_SWS)))
 Macro to get the clock source used as system clock.
 
#define __HAL_RCC_SYSCLK_CONFIG(__RCC_SYSCLKSOURCE__)   MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
 Macro to configure the system clock source.
 
#define __HAL_RCC_GET_SYSCLK_SOURCE()   (RCC->CFGR & RCC_CFGR_SWS)
 Macro to get the clock source used as system clock.
 
#define __HAL_RCC_GET_PLL_OSCSOURCE()   ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
 Macro to get the oscillator used as PLL clock source.
 
#define __HAL_RCC_SYSCLK_CONFIG(__RCC_SYSCLKSOURCE__)   MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
 Macro to configure the system clock source.
 
#define __HAL_RCC_GET_SYSCLK_SOURCE()   (RCC->CFGR & RCC_CFGR_SWS)
 Macro to get the clock source used as system clock.
 
#define __HAL_RCC_GET_PLL_OSCSOURCE()   ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
 Macro to get the oscillator used as PLL clock source.
 
#define __HAL_RCC_SYSCLK_CONFIG(__RCC_SYSCLKSOURCE__)   MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
 Macro to configure the system clock source.
 
#define __HAL_RCC_GET_SYSCLK_SOURCE()   (RCC->CFGR & RCC_CFGR_SWS)
 Macro to get the clock source used as system clock.
 
#define __HAL_RCC_LSEDRIVE_CONFIG(__RCC_LSEDRIVE__)    (MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (uint32_t)(__RCC_LSEDRIVE__) ))
 Macro to configures the External Low Speed oscillator (LSE) drive capability.
 
#define __HAL_RCC_GET_PLL_OSCSOURCE()   ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
 Macro to get the oscillator used as PLL clock source.
 

Macro Definition Documentation

◆ __HAL_RCC_GET_PLL_OSCSOURCE [1/3]

#define __HAL_RCC_GET_PLL_OSCSOURCE ( )    ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
Return values
Theoscillator used as PLL clock source. The returned value can be one of the following:
  • RCC_PLLSOURCE_HSI: HSI oscillator is used as PLL clock source.
  • RCC_PLLSOURCE_HSE: HSE oscillator is used as PLL clock source.

◆ __HAL_RCC_GET_PLL_OSCSOURCE [2/3]

#define __HAL_RCC_GET_PLL_OSCSOURCE ( )    ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
Return values
Theoscillator used as PLL clock source. The returned value can be one of the following:
  • RCC_PLLSOURCE_HSI: HSI oscillator is used as PLL clock source.
  • RCC_PLLSOURCE_HSE: HSE oscillator is used as PLL clock source.

◆ __HAL_RCC_GET_PLL_OSCSOURCE [3/3]

#define __HAL_RCC_GET_PLL_OSCSOURCE ( )    ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
Return values
Theoscillator used as PLL clock source. The returned value can be one of the following:
  • RCC_PLLSOURCE_HSI: HSI oscillator is used as PLL clock source.
  • RCC_PLLSOURCE_HSE: HSE oscillator is used as PLL clock source.

◆ __HAL_RCC_GET_SYSCLK_SOURCE [1/4]

#define __HAL_RCC_GET_SYSCLK_SOURCE ( )    ((uint32_t)(READ_BIT(RCC->CFGR,RCC_CFGR_SWS)))
Return values
Theclock source used as system clock. The returned value can be one of the following:
Theclock source used as system clock. The returned value can be one of the following:
  • RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.
Theclock source used as system clock. The returned value can be one of the following:
  • RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLRCLK: PLLR used as system clock. This parameter is available only for STM32F446xx devices.

◆ __HAL_RCC_GET_SYSCLK_SOURCE [2/4]

#define __HAL_RCC_GET_SYSCLK_SOURCE ( )    (RCC->CFGR & RCC_CFGR_SWS)
Return values
Theclock source used as system clock. The returned value can be one of the following:
  • RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.
Theclock source used as system clock. The returned value can be one of the following:
  • RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLRCLK: PLLR used as system clock. This parameter is available only for STM32F446xx devices.

◆ __HAL_RCC_GET_SYSCLK_SOURCE [3/4]

#define __HAL_RCC_GET_SYSCLK_SOURCE ( )    (RCC->CFGR & RCC_CFGR_SWS)
Return values
Theclock source used as system clock. The returned value can be one of the following:
  • RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLRCLK: PLLR used as system clock. This parameter is available only for STM32F446xx devices.
Theclock source used as system clock. The returned value can be one of the following:
  • RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.

◆ __HAL_RCC_GET_SYSCLK_SOURCE [4/4]

#define __HAL_RCC_GET_SYSCLK_SOURCE ( )    (RCC->CFGR & RCC_CFGR_SWS)
Return values
Theclock source used as system clock. The returned value can be one of the following:
  • RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
  • RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.

◆ __HAL_RCC_LSEDRIVE_CONFIG

#define __HAL_RCC_LSEDRIVE_CONFIG ( __RCC_LSEDRIVE__)     (MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (uint32_t)(__RCC_LSEDRIVE__) ))
Note
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).
Parameters
__RCC_LSEDRIVE__specifies the new state of the LSE drive capability. This parameter can be one of the following values:
  • RCC_LSEDRIVE_LOW: LSE oscillator low drive capability.
  • RCC_LSEDRIVE_MEDIUMLOW: LSE oscillator medium low drive capability.
  • RCC_LSEDRIVE_MEDIUMHIGH: LSE oscillator medium high drive capability.
  • RCC_LSEDRIVE_HIGH: LSE oscillator high drive capability.
Return values
None

◆ __HAL_RCC_SYSCLK_CONFIG [1/4]

#define __HAL_RCC_SYSCLK_CONFIG ( __RCC_SYSCLKSOURCE__)    MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
Parameters
__RCC_SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
  • RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
__RCC_SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
  • RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLRCLK: PLLR output is used as system clock source. This parameter is available only for STM32F446xx devices.

◆ __HAL_RCC_SYSCLK_CONFIG [2/4]

#define __HAL_RCC_SYSCLK_CONFIG ( __RCC_SYSCLKSOURCE__)    MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
Parameters
__RCC_SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
  • RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLRCLK: PLLR output is used as system clock source. This parameter is available only for STM32F446xx devices.
__RCC_SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
  • RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.

◆ __HAL_RCC_SYSCLK_CONFIG [3/4]

#define __HAL_RCC_SYSCLK_CONFIG ( __RCC_SYSCLKSOURCE__)    MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
Parameters
__RCC_SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
  • RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.

◆ __HAL_RCC_SYSCLK_CONFIG [4/4]

#define __HAL_RCC_SYSCLK_CONFIG ( __SYSCLKSOURCE__)     MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__SYSCLKSOURCE__))
Parameters
__SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
__RCC_SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
  • RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
__RCC_SYSCLKSOURCE__specifies the system clock source. This parameter can be one of the following values:
  • RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
  • RCC_SYSCLKSOURCE_PLLRCLK: PLLR output is used as system clock source. This parameter is available only for STM32F446xx devices.