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

HAL RCC Extension Driver

UM1725

 

uint32_t RCC_PeriphCLKInitTypeDef::SdioClockSelection

 

 

Specifies SDIO Clock Source Selection. This parameter can be a value of

 

 

RCCEx_SDIO_Clock_Source

 

 

uint32_t RCC_PeriphCLKInitTypeDef::CecClockSelection

 

 

Specifies CEC Clock Source Selection. This parameter can be a value of

 

 

RCCEx_CEC_Clock_Source

 

 

uint32_t RCC_PeriphCLKInitTypeDef::Fmpi2c1ClockSelection

 

 

Specifies FMPI2C1 Clock Source Selection. This parameter can be a value of

 

RCCEx_FMPI2C1_Clock_Source

 

 

uint32_t RCC_PeriphCLKInitTypeDef::SpdifClockSelection

 

 

Specifies SPDIFRX Clock Source Selection. This parameter can be a value of

 

RCCEx_SPDIFRX_Clock_Source

 

 

uint32_t RCC_PeriphCLKInitTypeDef::Clk48ClockSelection

 

 

Specifies CK48 Clock Selection this clock used OTG FS, SDIO and RNG clocks. This

 

parameter can be a value of RCCEx_CK48_Clock_Source

 

 

uint8_t RCC_PeriphCLKInitTypeDef::TIMPresSelection

 

Specifies TIM Clock Source Selection. This parameter can be a value of

RCCEx_TIM_PRescaler_Selection

46.2RCCEx Firmware driver API description

46.2.1Extended Peripheral Control functions

This subsection provides a set of functions allowing to control the RCC Clocks frequencies.

Important note: Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select the RTC clock source; in this case the Backup domain will be reset in order to modify the RTC Clock source, as consequence RTC registers (including the backup registers) and RCC_BDCR register are set to their reset values.

This section contains the following APIs:

HAL_RCCEx_PeriphCLKConfig()

HAL_RCCEx_GetPeriphCLKConfig()

HAL_RCCEx_GetPeriphCLKFreq()

HAL_RCCEx_SelectLSEMode()

HAL_RCC_OscConfig()

HAL_RCC_GetOscConfig()

HAL_RCC_GetSysClockFreq()

46.2.2HAL_RCCEx_PeriphCLKConfig

Function Name

HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig

 

(RCC_PeriphCLKInitTypeDef * PeriphClkInit)

Function Description

Initializes the RCC extended peripherals clocks according to the

 

specified parameters in the RCC_PeriphCLKInitTypeDef.

Parameters

PeriphClkInit: pointer to an RCC_PeriphCLKInitTypeDef

 

structure that contains the configuration information for the

 

Extended Peripherals clocks(I2S, SAI, LTDC RTC and TIM).

582/900

DOCID025834 Rev 2

UM1725

HAL RCC Extension Driver

Return values

HAL status

Notes

Care must be taken when HAL_RCCEx_PeriphCLKConfig() is

 

used to select the RTC clock source; in this case the Backup

 

domain will be reset in order to modify the RTC Clock source,

 

as consequence RTC registers (including the backup

 

registers) and RCC_BDCR register are set to their reset

 

values.

46.2.3HAL_RCCEx_GetPeriphCLKConfig

Function Name

void HAL_RCCEx_GetPeriphCLKConfig

 

(RCC_PeriphCLKInitTypeDef * PeriphClkInit)

Function Description

Get the RCC_PeriphCLKInitTypeDef according to the internal RCC

 

configuration registers.

Parameters

 

PeriphClkInit: pointer to an RCC_PeriphCLKInitTypeDef

 

 

structure that will be configured.

Return values

 

None

46.2.4HAL_RCCEx_GetPeriphCLKFreq

Function Name

uint32_t HAL_RCCEx_GetPeriphCLKFreq (uint32_t PeriphClk)

Function Description

Return the peripheral clock frequency for a given peripheral(SAI..)

Parameters

 

PeriphClk: Peripheral clock identifier This parameter can be

 

 

one of the following values: RCC_PERIPHCLK_SAI1: SAI1

 

 

peripheral clockRCC_PERIPHCLK_SAI2: SAI2 peripheral

 

 

clock

Return values

 

Frequency in KHz

Notes

Return 0 if peripheral clock identifier not managed by this API

46.2.5HAL_RCCEx_SelectLSEMode

Function Name

void HAL_RCCEx_SelectLSEMode (uint8_t Mode)

Function Description

Select LSE mode.

Parameters

 

Mode: specifies the LSE mode. This parameter can be one

 

 

of the following values: RCC_LSE_LOWPOWER_MODE:

 

 

LSE oscillator in low power mode

 

 

selectionRCC_LSE_HIGHDRIVE_MODE: LSE oscillator in

 

 

High Drive mode selection

Return values

 

None

Notes

This mode is only available for STM32F411xx devices.

46.2.6HAL_RCC_OscConfig

Function Name

HAL_StatusTypeDef HAL_RCC_OscConfig

 

 

(RCC_OscInitTypeDef * RCC_OscInitStruct)

 

Function Description

Initializes the RCC Oscillators according to the specified

 

 

parameters in the RCC_OscInitTypeDef.

 

 

DOCID025834 Rev 2

583/900

HAL RCC Extension Driver

 

UM1725

Parameters

 

RCC_OscInitStruct: pointer to an RCC_OscInitTypeDef

 

 

structure that contains the configuration information for the

 

 

RCC Oscillators.

Return values

 

HAL status

Notes

The PLL is not disabled when used as system clock.

46.2.7HAL_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.

Parameters

 

RCC_OscInitStruct: pointer to an RCC_OscInitTypeDef

 

 

structure that will be configured.

Return values

 

None

46.2.8HAL_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.

 

 

(**) 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.

584/900

DOCID025834 Rev 2

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