54 #ifdef HAL_RCC_MODULE_ENABLED 62 #define PLLI2S_TIMEOUT_VALUE 100 63 #define PLLSAI_TIMEOUT_VALUE 100 128 uint32_t tickstart = 0;
129 uint32_t tmpreg0 = 0;
130 uint32_t tmpreg1 = 0;
131 uint32_t plli2sused = 0;
132 uint32_t pllsaiused = 0;
415 #if defined(STM32F746xx) || defined(STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) 442 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) 447 assert_param(IS_RCC_SDMMC2CLKSOURCE(PeriphClkInit->Sdmmc2ClockSelection));
450 __HAL_RCC_SDMMC2_CONFIG(PeriphClkInit->Sdmmc2ClockSelection);
457 assert_param(IS_RCC_DFSDM1CLKSOURCE(PeriphClkInit->Dfsdm1ClockSelection));
460 __HAL_RCC_DFSDM1_CONFIG(PeriphClkInit->Dfsdm1ClockSelection);
464 if(((PeriphClkInit->
PeriphClockSelection) & RCC_PERIPHCLK_DFSDM1_AUDIO) == RCC_PERIPHCLK_DFSDM1_AUDIO)
467 assert_param(IS_RCC_DFSDM1AUDIOCLKSOURCE(PeriphClkInit->Dfsdm1AudioClockSelection));
470 __HAL_RCC_DFSDM1AUDIO_CONFIG(PeriphClkInit->Dfsdm1AudioClockSelection);
487 if((
HAL_GetTick() - tickstart) > PLLI2S_TIMEOUT_VALUE)
572 if((
HAL_GetTick() - tickstart) > PLLI2S_TIMEOUT_VALUE)
593 if((
HAL_GetTick() - tickstart) > PLLSAI_TIMEOUT_VALUE)
640 #if defined(STM32F746xx) || defined(STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) 670 if((
HAL_GetTick() - tickstart) > PLLSAI_TIMEOUT_VALUE)
688 uint32_t tempreg = 0;
691 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) 702 RCC_PERIPHCLK_CLK48 | RCC_PERIPHCLK_SDMMC2 |\
703 RCC_PERIPHCLK_DFSDM1 | RCC_PERIPHCLK_DFSDM1_AUDIO;
792 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) 794 PeriphClkInit->Sdmmc2ClockSelection = __HAL_RCC_GET_SDMMC2_SOURCE();
797 PeriphClkInit->Dfsdm1ClockSelection = __HAL_RCC_GET_DFSDM1_SOURCE();
800 PeriphClkInit->Dfsdm1AudioClockSelection = __HAL_RCC_GET_DFSDM1AUDIO_SOURCE();
831 uint32_t frequency = 0;
833 uint32_t vcoinput = 0;
835 uint32_t saiclocksource = 0;
839 saiclocksource =
RCC->DCKCFGR1;
841 switch (saiclocksource)
864 frequency = frequency/(tmpreg);
889 frequency = frequency/(tmpreg);
897 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) 922 saiclocksource =
RCC->DCKCFGR1;
924 switch (saiclocksource)
947 frequency = frequency/(tmpreg);
972 frequency = frequency/(tmpreg);
980 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) 1006 #if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx) 1023 uint32_t tickstart = 0;
1279 RCC_OscInitStruct->
PLL.PLLR);
#define RCC_DBP_TIMEOUT_VALUE
#define RCC_TIMPRES_ACTIVATED
#define LSI_TIMEOUT_VALUE
#define __HAL_RCC_GET_SAI2_SOURCE()
Macro to get the SAI2 clock source.
#define IS_RCC_USART1CLKSOURCE(SOURCE)
#define IS_RCC_USART6CLKSOURCE(SOURCE)
uint32_t PeriphClockSelection
uint32_t Uart4ClockSelection
#define __HAL_RCC_I2C3_CONFIG(__I2C3_CLKSOURCE__)
Macro to configure the I2C3 clock (I2C3CLK).
#define __HAL_RCC_LSI_ENABLE()
Macros to enable or disable the Internal Low Speed oscillator (LSI).
uint32_t I2sClockSelection
RCC_PLLI2SInitTypeDef PLLI2S
uint32_t HSICalibrationValue
#define RCC_PERIPHCLK_I2S
#define __HAL_RCC_GET_I2C1_SOURCE()
Macro to get the I2C1 clock source.
#define IS_RCC_TIMPRES(VALUE)
#define PLL_TIMEOUT_VALUE
#define RCC_PLLSAICFGR_PLLSAIN
#define assert_param(expr)
Include module's header file.
#define __HAL_RCC_USART6_CONFIG(__USART6_CLKSOURCE__)
Macro to configure the USART6 clock (USART6CLK).
#define RCC_DCKCFGR1_TIMPRE
#define HSI_VALUE
Internal High Speed oscillator (HSI) value. This value is used by the RCC HAL module to compute the s...
#define __HAL_RCC_I2S_CONFIG(__SOURCE__)
Macro to configure the I2S clock source (I2SCLK).
#define __HAL_RCC_UART7_CONFIG(__UART7_CLKSOURCE__)
Macro to configure the UART7 clock (UART7CLK).
#define __HAL_RCC_SAI2_CONFIG(__SOURCE__)
Macro to configure SAI2 clock source selection.
#define IS_RCC_UART8CLKSOURCE(SOURCE)
#define __HAL_RCC_GET_UART7_SOURCE()
macro to get the UART7 clock source.
#define RCC_PERIPHCLK_RTC
#define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICALIBRATIONVALUE__)
Macro to adjust the Internal High Speed oscillator (HSI) calibration value.
#define __HAL_RCC_I2C2_CONFIG(__I2C2_CLKSOURCE__)
Macro to configure the I2C2 clock (I2C2CLK).
#define __HAL_RCC_PLLI2S_PLLSAICLKDIVQ_CONFIG(__PLLI2SDivQ__)
Macro to configure the SAI clock Divider coming from PLLI2S.
#define RCC_PLLSOURCE_HSI
#define __HAL_RCC_GET_USART6_SOURCE()
macro to get the USART6 clock source.
#define __HAL_RCC_CLK48_CONFIG(__CLK48_SOURCE__)
Macro to configure the CLK48 source (CLK48CLK).
HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit)
#define __HAL_RCC_UART8_CONFIG(__UART8_CLKSOURCE__)
Macro to configure the UART8 clock (UART8CLK).
#define __HAL_RCC_USART1_CONFIG(__USART1_CLKSOURCE__)
Macro to configure the USART1 clock (USART1CLK).
#define RCC_PERIPHCLK_I2C4
#define __HAL_RCC_TIMCLKPRESCALER(__PRESC__)
Macro to configure the Timers clocks prescalers.
#define IS_RCC_PLLSAIQ_VALUE(VALUE)
#define __HAL_RCC_HSI_DISABLE()
#define __HAL_RCC_I2C4_CONFIG(__I2C4_CLKSOURCE__)
Macro to configure the I2C4 clock (I2C4CLK).
#define __HAL_RCC_PLLSAI_CONFIG(__PLLSAIN__, __PLLSAIP__, __PLLSAIQ__, __PLLSAIR__)
Macro to configure the PLLSAI clock multiplication and division factors.
#define RCC_PERIPHCLK_SDMMC1
#define RCC_SAI2CLKSOURCE_PLLSAI
#define RCC_PLLSAICFGR_PLLSAIP
#define __HAL_RCC_GET_USART3_SOURCE()
macro to get the USART3 clock source.
#define RCC_PERIPHCLK_I2C3
#define RCC_PERIPHCLK_UART7
#define IS_RCC_USART2CLKSOURCE(SOURCE)
#define RCC_DCKCFGR1_SAI2SEL_0
#define IS_RCC_PLLP_VALUE(VALUE)
#define __HAL_RCC_GET_SAI1_SOURCE()
Macro to get the SAI1 clock source.
#define RCC_PERIPHCLK_CLK48
uint32_t I2c2ClockSelection
uint32_t I2c1ClockSelection
#define RCC_OSCILLATORTYPE_LSI
#define IS_RCC_PLLN_VALUE(VALUE)
uint32_t TIMPresSelection
#define __HAL_RCC_PLLI2S_DISABLE()
#define __HAL_RCC_UART5_CONFIG(__UART5_CLKSOURCE__)
Macro to configure the UART5 clock (UART5CLK).
uint32_t Usart1ClockSelection
#define IS_RCC_CLK48SOURCE(SOURCE)
#define RCC_PERIPHCLK_USART3
#define IS_RCC_PLLI2SQ_VALUE(VALUE)
uint32_t CecClockSelection
#define RCC_PERIPHCLK_USART1
#define RCC_CLK48SOURCE_PLLSAIP
#define POSITION_VAL(VAL)
#define RCC_FLAG_PLLI2SRDY
#define __HAL_RCC_BACKUPRESET_FORCE()
Macros to force or release the Backup domain reset.
#define RCC_SAI1CLKSOURCE_PLLSAI
uint32_t Uart5ClockSelection
#define __HAL_RCC_LSE_CONFIG(__STATE__)
Macro to configure the External Low Speed oscillator (LSE).
#define __HAL_RCC_PWR_CLK_ENABLE()
#define IS_RCC_USART3CLKSOURCE(SOURCE)
#define IS_RCC_PLLI2SR_VALUE(VALUE)
#define RCC_PLLSAICFGR_PLLSAIR
#define RCC_PERIPHCLK_UART4
#define IS_RCC_PLLSAI_DIVR_VALUE(VALUE)
#define RCC_SYSCLKSOURCE_STATUS_PLLCLK
#define __HAL_RCC_PLL_DISABLE()
#define HSE_VALUE
Adjust the value of External High Speed oscillator (HSE) used in your application. This value is used by the RCC HAL module to compute the system frequency (when HSE is used as system clock source, directly or through the PLL).
#define RCC_DCKCFGR1_SAI2SEL_1
#define RCC_PLLCFGR_PLLSRC_HSE
#define IS_RCC_LPTIM1CLK(SOURCE)
#define IS_RCC_UART5CLKSOURCE(SOURCE)
#define RCC_DCKCFGR1_PLLSAIDIVR
uint32_t Uart7ClockSelection
#define EXTERNAL_CLOCK_VALUE
External clock source for I2S peripheral This value is used by the I2S HAL module to compute the I2S ...
#define __HAL_RCC_LPTIM1_CONFIG(__LPTIM1_CLKSOURCE__)
Macro to configure the LPTIM1 clock (LPTIM1CLK).
#define __HAL_RCC_GET_CLK48_SOURCE()
macro to get the CLK48 source.
#define IS_RCC_PLLSAIN_VALUE(VALUE)
#define __HAL_RCC_PLL_ENABLE()
Macros to enable or disable the main PLL.
#define __HAL_RCC_BACKUPRESET_RELEASE()
#define RCC_PERIPHCLK_I2C1
#define IS_RCC_RTCCLKSOURCE(SOURCE)
#define __HAL_RCC_HSI_ENABLE()
Macros to enable or disable the Internal High Speed oscillator (HSI).
#define RCC_PLLSAICFGR_PLLSAIQ
#define RCC_DCKCFGR1_PLLI2SDIVQ
#define RCC_DCKCFGR1_SAI2SEL
#define HSI_TIMEOUT_VALUE
#define __HAL_RCC_GET_FLAG(__FLAG__)
RCC extended clocks structure definition.
#define RCC_PLLCFGR_PLLSRC
#define RCC_PLLI2SCFGR_PLLI2SN
#define IS_RCC_I2C4CLKSOURCE(SOURCE)
#define RCC_OSCILLATORTYPE_HSI
#define RCC_SAI2CLKSOURCE_PLLI2S
#define IS_RCC_I2SCLKSOURCE(SOURCE)
This file contains all the functions prototypes for the HAL module driver.
uint32_t Sdmmc1ClockSelection
#define IS_RCC_UART4CLKSOURCE(SOURCE)
#define __HAL_RCC_GET_CEC_SOURCE()
macro to get the CEC clock source.
#define RCC_PERIPHCLK_UART8
#define __HAL_RCC_GET_UART8_SOURCE()
macro to get the UART8 clock source.
#define __HAL_RCC_GET_I2C3_SOURCE()
macro to get the I2C3 clock source.
uint32_t Usart3ClockSelection
#define RCC_DCKCFGR1_SAI1SEL_0
#define RCC_DCKCFGR1_SAI1SEL_1
uint32_t Clk48ClockSelection
void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit)
#define RCC_PERIPHCLK_UART5
#define RCC_PERIPHCLK_SPDIFRX
uint32_t I2c4ClockSelection
#define IS_RCC_CALIBRATION_VALUE(VALUE)
#define __HAL_RCC_PLLI2S_ENABLE()
Macros to enable or disable the PLLI2S.
#define __HAL_RCC_CEC_CONFIG(__CEC_CLKSOURCE__)
Macro to configure the CEC clock (CECCLK).
uint32_t Sai1ClockSelection
#define RCC_PERIPHCLK_CEC
#define IS_RCC_PLLQ_VALUE(VALUE)
#define __HAL_RCC_RTC_CONFIG(__RTCCLKSource__)
#define __HAL_RCC_I2C1_CONFIG(__I2C1_CLKSOURCE__)
Macro to configure the I2C1 clock (I2C1CLK).
#define IS_RCC_CECCLKSOURCE(SOURCE)
#define RCC_SYSCLKSOURCE_STATUS_HSI
#define IS_RCC_SDMMC1CLKSOURCE(SOURCE)
#define HSE_TIMEOUT_VALUE
#define RCC_PLLI2SCFGR_PLLI2SQ
#define RCC_OSCILLATORTYPE_HSE
#define __HAL_RCC_GET_USART2_SOURCE()
macro to get the USART2 clock source.
#define RCC_PLLI2SCFGR_PLLI2SP
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
#define IS_RCC_PLLSAI_DIVQ_VALUE(VALUE)
uint32_t Lptim1ClockSelection
#define IS_RCC_I2C2CLKSOURCE(SOURCE)
RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition.
#define RCC_PERIPHCLK_PLLI2S
#define RCC_DCKCFGR1_PLLSAIDIVQ
#define RCC_PERIPHCLK_SAI2
#define __HAL_RCC_GET_I2C2_SOURCE()
Macro to get the I2C2 clock source.
#define __HAL_RCC_GET_UART5_SOURCE()
macro to get the UART5 clock source.
#define __HAL_RCC_USART3_CONFIG(__USART3_CLKSOURCE__)
Macro to configure the USART3 clock (USART3CLK).
#define RCC_DCKCFGR1_SAI1SEL
#define IS_RCC_PLLSAIP_VALUE(VALUE)
#define __HAL_RCC_SDMMC1_CONFIG(__SDMMC1_CLKSOURCE__)
Macro to configure the SDMMC1 clock (SDMMC1CLK).
#define HAL_IS_BIT_SET(REG, BIT)
#define RCC_PERIPHCLK_I2C2
#define __HAL_RCC_GET_USART1_SOURCE()
macro to get the USART1 clock source.
#define IS_RCC_UART7CLKSOURCE(SOURCE)
#define __HAL_RCC_USART2_CONFIG(__USART2_CLKSOURCE__)
Macro to configure the USART2 clock (USART2CLK).
uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
#define IS_RCC_PLLM_VALUE(VALUE)
uint32_t Sai2ClockSelection
#define __HAL_RCC_PLLSAI_PLLSAICLKDIVR_CONFIG(__PLLSAIDivR__)
Macro to configure the LTDC clock Divider coming from PLLSAI.
#define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__)
Macro to configure the main PLL clock source, multiplication and division factors.
#define __HAL_RCC_GET_LPTIM1_SOURCE()
macro to get the LPTIM1 clock source.
#define __HAL_RCC_GET_I2C4_SOURCE()
macro to get the I2C4 clock source.
#define RCC_PERIPHCLK_LPTIM1
#define IS_RCC_PLLI2SP_VALUE(VALUE)
#define RCC_I2SCLKSOURCE_PLLI2S
uint32_t I2c3ClockSelection
#define RCC_PERIPHCLK_TIM
#define IS_RCC_PLLSOURCE(SOURCE)
#define __HAL_RCC_GET_SDMMC1_SOURCE()
macro to get the SDMMC1 clock source.
#define IS_RCC_OSCILLATORTYPE(OSCILLATOR)
uint32_t RTCClockSelection
#define RCC_TIMPRES_DESACTIVATED
#define __HAL_RCC_GET_UART4_SOURCE()
macro to get the UART4 clock source.
uint32_t Uart8ClockSelection
#define __HAL_RCC_UART4_CONFIG(__UART4_CLKSOURCE__)
Macro to configure the UART4 clock (UART4CLK).
#define IS_RCC_PLLI2SN_VALUE(VALUE)
#define RCC_PERIPHCLK_USART2
#define RCC_PERIPHCLK_SAI1
#define __HAL_RCC_HSE_CONFIG(__STATE__)
Macro to configure the External High Speed oscillator (HSE).
#define RCC_SAI1CLKSOURCE_PLLI2S
#define IS_RCC_I2C1CLKSOURCE(SOURCE)
HAL_StatusTypeDef
HAL Status structures definition.
#define IS_RCC_PLLSAIR_VALUE(VALUE)
#define RCC_OSCILLATORTYPE_LSE
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
uint32_t Usart2ClockSelection
#define RCC_SYSCLKSOURCE_STATUS_HSE
#define IS_RCC_PLLI2S_DIVQ_VALUE(VALUE)
#define RCC_LSE_TIMEOUT_VALUE
#define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SN__, __PLLI2SP__, __PLLI2SQ__, __PLLI2SR__)
Macro to configure the PLLI2S clock multiplication and division factors.
#define __HAL_RCC_PLLSAI_GET_FLAG()
Check PLLSAI RDY flag is set or not.
#define __HAL_RCC_LSI_DISABLE()
#define __HAL_RCC_SAI1_CONFIG(__SOURCE__)
Macro to configure SAI1 clock source selection.
#define RCC_PLLCFGR_PLLSRC_HSI
#define __HAL_RCC_PLLSAI_DISABLE()
#define __HAL_RCC_GET_I2SCLKSOURCE()
Macro to Get I2S clock source selection.
#define IS_RCC_I2C3CLKSOURCE(SOURCE)
#define __HAL_RCC_GET_SYSCLK_SOURCE()
Macro to get the clock source used as system clock.
#define RCC_PLLI2SCFGR_PLLI2SR
#define __HAL_RCC_PLLSAI_PLLSAICLKDIVQ_CONFIG(__PLLSAIDivQ__)
Macro to configure the SAI clock Divider coming from PLLSAI.
uint32_t Usart6ClockSelection
#define __HAL_RCC_PLLSAI_ENABLE()
Macros to Enable or Disable the PLLISAI.
RCC_PLLSAIInitTypeDef PLLSAI
#define RCC_PERIPHCLK_USART6