Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
110
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

HAL RCC Generic Driver

UM1725

 

clock selected as MCO2

 

sourceRCC_MCO2SOURCE_PLLCLK: main PLL clock

 

selected as MCO2 source

 

RCC_MCODiv: specifies the MCOx prescaler. This

 

parameter can be one of the following values:

 

RCC_MCODIV_1: no division applied to MCOx

 

clockRCC_MCODIV_2: division by 2 applied to MCOx

 

clockRCC_MCODIV_3: division by 3 applied to MCOx

 

clockRCC_MCODIV_4: division by 4 applied to MCOx

 

clockRCC_MCODIV_5: division by 5 applied to MCOx clock

Return values

None

Notes

PA8/PC9 should be configured in alternate function mode.

45.2.9HAL_RCC_EnableCSS

Function Name

void HAL_RCC_EnableCSS (void )

Function Description

Enables the Clock Security System.

Return values

None

Notes

If a failure is detected on the HSE oscillator clock, this

 

oscillator is automatically disabled and an interrupt is

 

generated to inform the software about the failure (Clock

 

Security System Interrupt, CSSI), allowing the MCU to

 

perform rescue operations. The CSSI is linked to the Cortex-

 

M4 NMI (Non-Maskable Interrupt) exception vector.

45.2.10HAL_RCC_DisableCSS

Function Name

void HAL_RCC_DisableCSS (void )

Function Description

Disables the Clock Security System.

Return values

None

45.2.11HAL_RCC_GetSysClockFreq

Function Name

uint32_t HAL_RCC_GetSysClockFreq (void )

Function Description

Returns the SYSCLK frequency.

Return values

SYSCLK frequency

Notes

The system frequency computed by this function is not the

 

real frequency in the chip. It is calculated based on the

 

predefined constant and the selected clock source:

 

If SYSCLK source is HSI, function returns values based on

 

HSI_VALUE(*)

 

If SYSCLK source is HSE, function returns values based on

 

HSE_VALUE(**)

 

If SYSCLK source is PLL, function returns values based on

 

HSE_VALUE(**) or HSI_VALUE(*) multiplied/divided by the

 

PLL factors.

 

(*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h

 

file (default value 16 MHz) but the real value may vary

 

depending on the variations in voltage and temperature.

556/900

DOCID025834 Rev 2

UM1725

HAL RCC Generic Driver

(**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value 25 MHz), user has to ensure that HSE_VALUE is same as the real frequency of the crystal used. Otherwise, this function may have wrong result.

The result of this function could be not correct when using fractional value for HSE crystal.

This function can be used by the user application to compute the baudrate for the communication peripherals or configure other parameters.

Each time SYSCLK changes, this function must be called to update the right SYSCLK value. Otherwise, any configuration based on this function will be incorrect.

45.2.12HAL_RCC_GetHCLKFreq

Function Name

uint32_t HAL_RCC_GetHCLKFreq (void )

Function Description

Returns the HCLK frequency.

Return values

HCLK frequency

Notes

Each time HCLK changes, this function must be called to

 

update the right HCLK value. Otherwise, any configuration

 

based on this function will be incorrect.

The SystemCoreClock CMSIS variable is used to store System Clock Frequency and updated within this function

45.2.13HAL_RCC_GetPCLK1Freq

Function Name

uint32_t HAL_RCC_GetPCLK1Freq (void )

Function Description

Returns the PCLK1 frequency.

Return values

PCLK1 frequency

Notes

Each time PCLK1 changes, this function must be called to

 

update the right PCLK1 value. Otherwise, any configuration

 

based on this function will be incorrect.

45.2.14HAL_RCC_GetPCLK2Freq

Function Name

uint32_t HAL_RCC_GetPCLK2Freq (void )

Function Description

Returns the PCLK2 frequency.

Return values

PCLK2 frequency

Notes

Each time PCLK2 changes, this function must be called to

 

update the right PCLK2 value. Otherwise, any configuration

 

based on this function will be incorrect.

45.2.15HAL_RCC_GetOscConfig

Function Name

void HAL_RCC_GetOscConfig (RCC_OscInitTypeDef *

 

 

RCC_OscInitStruct)

 

Function Description

Configures the RCC_OscInitStruct according to the internal RCC

 

configuration registers.

 

 

DOCID025834 Rev 2

557/900

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]