MG32F10x Standard Peripherals Firmware Library
Modules | Data Structures | Functions

RCC driver modules. More...

Modules

 RCC_Exported_Constants
 
 RCC_Private_Functions
 

Data Structures

struct  RCC_ClocksTypeDef
 

Functions

void RCC_PLLSourceConfig (uint32_t RCC_PLLSource, FunctionalState NewState)
 Configures the PLL clock source. More...
 
void RCC_MAINCLKConfig (uint32_t RCC_MAINCLKSource)
 Configures the main clock (MAINCLK). More...
 
void RCC_USBCLKConfig (uint32_t RCC_USBCLKSource, FunctionalState NewState)
 Configures the USB clock (USBCLK). More...
 
void RCC_AHBCLKConfig (uint32_t RCC_MAINCLK)
 Configures the AHB clock (AHBCLK). More...
 
void RCC_APB1CLKConfig (uint32_t RCC_MAINCLK, FunctionalState NewState)
 Configures the APB1 clock (APB1CLK). More...
 
void RCC_APB2CLKConfig (uint32_t RCC_MAINCLK, FunctionalState NewState)
 Configures the APB2 clock (APB2CLK). More...
 
void RCC_MCLKConfig (uint32_t RCC_MCLKSource, FunctionalState NewState)
 Configures the I2S MCLK clock (MCLK). More...
 
void RCC_I2SCLKConfig (uint32_t RCC_MCLK, FunctionalState NewState)
 Configures the I2S SCLK clock (I2SCLK). More...
 
void RCC_I2SCLKResetCmd (FunctionalState NewState)
 Forces or releases the I2S SCLK clock domain reset. More...
 
void RCC_RNGCLKCmd (FunctionalState NewState)
 Enables or disables the RNG clock (RNGCLK). More...
 
void RCC_IWDGCLKCmd (FunctionalState NewState)
 Enables or disables the IWDG clock (IWDGCLK). More...
 
void RCC_DCSSCLKCmd (FunctionalState NewState)
 Enables or disables the DCSS clock. More...
 
void RCC_SPIS1CLKCmd (FunctionalState NewState)
 Enables or disables the SPIS1 clock (SPIS1CLK). More...
 
void RCC_SPIS2CLKCmd (FunctionalState NewState)
 Enables or disables the SPIS2 clock (SPIS2CLK). More...
 
void RCC_USBFIFOCLKConfig (uint32_t RCC_USBFIFOCLKSource)
 Configures the USB FIFO clock (USBFIFOCLK). More...
 
void RCC_USBFIFOCLKCmd (FunctionalState NewState)
 Enables or disables the USB FIFO clock (USBFIFOCLK). More...
 
void RCC_MCOConfig (uint32_t RCC_MCO)
 Selects the clock source to output on MCO pin. More...
 
void RCC_GetClocksFreq (RCC_ClocksTypeDef *RCC_Clocks)
 Returns the frequencies of different on chip clocks. More...
 
void RCC_AHBPeriphClockCmd (uint32_t RCC_AHBPeriph, FunctionalState NewState)
 Enables or disables the AHB peripheral clock. More...
 
void RCC_APB1PeriphClockCmd (uint32_t RCC_APB1Periph, FunctionalState NewState)
 Enables or disables the APB1 peripheral clock. More...
 
void RCC_APB2PeriphClockCmd (uint32_t RCC_APB2Periph, FunctionalState NewState)
 Enables or disables the APB2 peripheral clock. More...
 
void RCC_AHBPeriphResetCmd (uint32_t RCC_AHBPeriph, FunctionalState NewState)
 Forces or releases AHB peripheral reset. More...
 
void RCC_APB1PeriphResetCmd (uint32_t RCC_APB1Periph, FunctionalState NewState)
 Forces or releases APB1 peripheral reset. More...
 
void RCC_APB2PeriphResetCmd (uint32_t RCC_APB2Periph, FunctionalState NewState)
 Forces or releases APB2 peripheral reset. More...
 
void RCC_BackupResetCmd (FunctionalState NewState)
 Forces or releases the Backup domain reset. More...
 
FlagStatus RCC_GetResetFlagStatus (uint32_t RCC_RSTFLAG)
 Checks whether the specified RCC reset flag is set or not. More...
 
void RCC_ClearResetFlags (void)
 Clears the RCC reset flags. More...
 

Detailed Description

RCC driver modules.

Function Documentation

◆ RCC_AHBCLKConfig()

void RCC_AHBCLKConfig ( uint32_t  RCC_MAINCLK)

Configures the AHB clock (AHBCLK).

Parameters
RCC_MAINCLKdefines the AHB clock divider. This clock is derived from the main clock (MAINCLK). This parameter can be RCC_MAINCLK_Divx where x:[1, 64]
Returns
None

◆ RCC_AHBPeriphClockCmd()

void RCC_AHBPeriphClockCmd ( uint32_t  RCC_AHBPeriph,
FunctionalState  NewState 
)

Enables or disables the AHB peripheral clock.

Parameters
RCC_AHBPeriphspecifies the AHB peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHBPeriph_IWDG
  • RCC_AHBPeriph_USB
  • RCC_AHBPeriph_ISO
  • RCC_AHBPeriph_FLASH
  • RCC_AHBPeriph_CACHE
  • RCC_AHBPeriph_SYS
  • RCC_AHBPeriph_DMAC1Bridge
  • RCC_AHBPeriph_DMAC2Bridge
  • RCC_AHBPeriph_CRC_SFM
  • RCC_AHBPeriph_BKP
NewStatenew state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_AHBPeriphResetCmd()

void RCC_AHBPeriphResetCmd ( uint32_t  RCC_AHBPeriph,
FunctionalState  NewState 
)

Forces or releases AHB peripheral reset.

Parameters
RCC_AHBPeriphspecifies the AHB peripheral to reset. This parameter can be any combination of the following values:
  • RCC_AHBPeriph_USB
  • RCC_AHBPeriph_ISO
  • RCC_AHBPeriph_FLASH
  • RCC_AHBPeriph_CACHE
  • RCC_AHBPeriph_SYS
  • RCC_AHBPeriph_CRC_SFM
NewStatenew state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_APB1CLKConfig()

void RCC_APB1CLKConfig ( uint32_t  RCC_MAINCLK,
FunctionalState  NewState 
)

Configures the APB1 clock (APB1CLK).

Parameters
RCC_MAINCLKdefines the APB1 clock divider. This clock is derived from the main clock (MAINCLK). This parameter can be RCC_MAINCLK_Divx where x:[1, 64]
NewStatenew state of the APB1 clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_APB1PeriphClockCmd()

void RCC_APB1PeriphClockCmd ( uint32_t  RCC_APB1Periph,
FunctionalState  NewState 
)

Enables or disables the APB1 peripheral clock.

Parameters
RCC_APB1Periphspecifies the APB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB1Periph_DMAC1
  • RCC_APB1Periph_TIM1
  • RCC_APB1Periph_TIM2
  • RCC_APB1Periph_TIM3
  • RCC_APB1Periph_TIM4
  • RCC_APB1Periph_GPIOA
  • RCC_APB1Periph_GPIOB
  • RCC_APB1Periph_GPIOC
  • RCC_APB1Periph_GPIOD
  • RCC_APB1Periph_EXTI
  • RCC_APB1Periph_AFIO
  • RCC_APB1Periph_ADC
  • RCC_APB1Periph_QSPI
  • RCC_APB1Periph_SPIS1
  • RCC_APB1Periph_UART1
  • RCC_APB1Periph_BMX1
NewStatenew state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_APB1PeriphResetCmd()

void RCC_APB1PeriphResetCmd ( uint32_t  RCC_APB1Periph,
FunctionalState  NewState 
)

Forces or releases APB1 peripheral reset.

Parameters
RCC_APB1Periphspecifies the APB1 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_APB1Periph_DMAC1
  • RCC_APB1Periph_TIM1
  • RCC_APB1Periph_TIM2
  • RCC_APB1Periph_TIM3
  • RCC_APB1Periph_TIM4
  • RCC_APB1Periph_GPIOA
  • RCC_APB1Periph_GPIOB
  • RCC_APB1Periph_GPIOC
  • RCC_APB1Periph_GPIOD
  • RCC_APB1Periph_EXTI
  • RCC_APB1Periph_AFIO
  • RCC_APB1Periph_ADC
  • RCC_APB1Periph_QSPI
  • RCC_APB1Periph_SPIS1
  • RCC_APB1Periph_UART1
  • RCC_APB1Periph_BMX1
NewStatenew state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_APB2CLKConfig()

void RCC_APB2CLKConfig ( uint32_t  RCC_MAINCLK,
FunctionalState  NewState 
)

Configures the APB2 clock (APB2CLK).

Parameters
RCC_MAINCLKdefines the APB2 clock divider. This clock is derived from the main clock (MAINCLK). This parameter can be RCC_MAINCLK_Divx where x:[1, 64]
NewStatenew state of the APB2 clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_APB2PeriphClockCmd()

void RCC_APB2PeriphClockCmd ( uint32_t  RCC_APB2Periph,
FunctionalState  NewState 
)

Enables or disables the APB2 peripheral clock.

Parameters
RCC_APB2Periphspecifies the APB2 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB2Periph_DMAC2
  • RCC_APB2Periph_WWDG
  • RCC_APB2Periph_UART2
  • RCC_APB2Periph_UART3
  • RCC_APB2Periph_SPIM2
  • RCC_APB2Periph_SPIS2
  • RCC_APB2Periph_I2S
  • RCC_APB2Periph_I2C1
  • RCC_APB2Periph_I2C2
  • RCC_APB2Periph_RNG
  • RCC_APB2Periph_LED
  • RCC_APB2Periph_BMX2
NewStatenew state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_APB2PeriphResetCmd()

void RCC_APB2PeriphResetCmd ( uint32_t  RCC_APB2Periph,
FunctionalState  NewState 
)

Forces or releases APB2 peripheral reset.

Parameters
RCC_APB2Periphspecifies the APB2 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_APB2Periph_DMAC2
  • RCC_APB2Periph_WWDG
  • RCC_APB2Periph_UART2
  • RCC_APB2Periph_UART3
  • RCC_APB2Periph_SPIM2
  • RCC_APB2Periph_SPIS2
  • RCC_APB2Periph_I2S
  • RCC_APB2Periph_I2C1
  • RCC_APB2Periph_I2C2
  • RCC_APB2Periph_RNG
  • RCC_APB2Periph_LED
  • RCC_APB2Periph_BMX2
NewStatenew state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_BackupResetCmd()

void RCC_BackupResetCmd ( FunctionalState  NewState)

Forces or releases the Backup domain reset.

Parameters
NewStatenew state of the Backup domain reset. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_ClearResetFlags()

void RCC_ClearResetFlags ( void  )

Clears the RCC reset flags.

Note
The reset flags are RCC_RSTFLAG_LPWRRST, RCC_RSTFLAG_WWDGRST, RCC_RSTFLAG_IWDGRST RCC_RSTFLAG_SFTRST, RCC_RSTFLAG_PORRST, RCC_RSTFLAG_PINRST
Parameters
None
Returns
None.

◆ RCC_DCSSCLKCmd()

void RCC_DCSSCLKCmd ( FunctionalState  NewState)

Enables or disables the DCSS clock.

Parameters
NewStatenew state of the DCSS clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_GetClocksFreq()

void RCC_GetClocksFreq ( RCC_ClocksTypeDef RCC_Clocks)

Returns the frequencies of different on chip clocks.

Parameters
RCC_Clockspointer to a RCC_ClocksTypeDef structure which will hold the clocks frequencies.
Returns
None

◆ RCC_GetResetFlagStatus()

FlagStatus RCC_GetResetFlagStatus ( uint32_t  RCC_RSTFLAG)

Checks whether the specified RCC reset flag is set or not.

Parameters
RCC_RSTFLAGspecifies the flag to check. This parameter can be one of the following values:
  • RCC_RSTFLAG_LPWRRST: Low Power reset
  • RCC_RSTFLAG_WWDGRST: Window Watchdog reset
  • RCC_RSTFLAG_IWDGRST: Independent Watchdog reset
  • RCC_RSTFLAG_SFTRST: Software reset
  • RCC_RSTFLAG_PORRST: POR/PDR reset
  • RCC_RSTFLAG_PINRST: Pin reset
Returns
The new state of RCC_RSTFLAG (SET or RESET).

◆ RCC_I2SCLKConfig()

void RCC_I2SCLKConfig ( uint32_t  RCC_MCLK,
FunctionalState  NewState 
)

Configures the I2S SCLK clock (I2SCLK).

Parameters
RCC_MCLKdefines the I2S SCLK clock divider. This clock is derived from the MCLK clock (MCLK). This parameter can be RCC_MCLK_Divx where x:[1, 512]
NewStatenew state of the I2S SCLK clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_I2SCLKResetCmd()

void RCC_I2SCLKResetCmd ( FunctionalState  NewState)

Forces or releases the I2S SCLK clock domain reset.

Parameters
NewStatenew state of the I2S SCLK clock domain reset. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_IWDGCLKCmd()

void RCC_IWDGCLKCmd ( FunctionalState  NewState)

Enables or disables the IWDG clock (IWDGCLK).

Note
This switch is invalid if the IWDG is running.
Parameters
NewStatenew state of the IWDG clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_MAINCLKConfig()

void RCC_MAINCLKConfig ( uint32_t  RCC_MAINCLKSource)

Configures the main clock (MAINCLK).

Parameters
RCC_MAINCLKSourcespecifies the clock source used as main clock. This parameter can be one of the following values:
  • RCC_MAINCLKSource_MHSI: MHSI selected as main clock
  • RCC_MAINCLKSource_FHSI: FHSI selected as main clock
  • RCC_MAINCLKSource_PLLCLK: PLL selected as main clock
  • RCC_MAINCLKSource_HSE: HSE selected as main clock
Returns
None

◆ RCC_MCLKConfig()

void RCC_MCLKConfig ( uint32_t  RCC_MCLKSource,
FunctionalState  NewState 
)

Configures the I2S MCLK clock (MCLK).

Parameters
RCC_MCLKSourcespecifies the I2S MCLK clock source.. This parameter can be RCC_MCLKSource_MAINCLK_Divx or RCC_MCLKSource_FHSI_Divx where x:[1, 64]
NewStatenew state of the I2S MCLK clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_MCOConfig()

void RCC_MCOConfig ( uint32_t  RCC_MCO)

Selects the clock source to output on MCO pin.

Parameters
RCC_MCOspecifies the clock source to output. This parameter can be one of the following values:
  • RCC_MCO_NoClock: No clock selected
  • RCC_MCO_AHBCLK: AHB clock selected
  • RCC_MCO_HSE: HSE oscillator clock selected
  • RCC_MCO_MHSI: MHSI oscillator clock selected
  • RCC_MCO_PLLCLK_Div2: PLL clock divided by 2 selected
  • RCC_MCO_MCLK: I2S MCLK clock selected
Returns
None

◆ RCC_PLLSourceConfig()

void RCC_PLLSourceConfig ( uint32_t  RCC_PLLSource,
FunctionalState  NewState 
)

Configures the PLL clock source.

Parameters
RCC_PLLSourcespecifies the PLL entry clock source. This parameter can be RCC_PLLSource_HSE_Divx or RCC_PLLSource_MHSI_Divx where x:[1, 16]
NewStatenew state of the PLL source clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_RNGCLKCmd()

void RCC_RNGCLKCmd ( FunctionalState  NewState)

Enables or disables the RNG clock (RNGCLK).

Parameters
NewStatenew state of the RNG clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_SPIS1CLKCmd()

void RCC_SPIS1CLKCmd ( FunctionalState  NewState)

Enables or disables the SPIS1 clock (SPIS1CLK).

Parameters
NewStatenew state of the SPIS1 clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_SPIS2CLKCmd()

void RCC_SPIS2CLKCmd ( FunctionalState  NewState)

Enables or disables the SPIS2 clock (SPIS2CLK).

Parameters
NewStatenew state of the SPIS2 clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_USBCLKConfig()

void RCC_USBCLKConfig ( uint32_t  RCC_USBCLKSource,
FunctionalState  NewState 
)

Configures the USB clock (USBCLK).

Parameters
RCC_USBCLKSourcespecifies the USB clock source.. This parameter can be one of the following values:
  • RCC_USBCLKSource_MAINCLK_Div1: main clock selected as USB clock source
  • RCC_USBCLKSource_MAINCLK_1Div5: main clock divided by 1.5 selected as USB clock source
  • RCC_USBCLKSource_MAINCLK_Div2: main clock divided by 2 selected as USB clock source
  • RCC_USBCLKSource_MAINCLK_Div3: main clock divided by 3 selected as USB clock source
NewStatenew state of the USB clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_USBFIFOCLKCmd()

void RCC_USBFIFOCLKCmd ( FunctionalState  NewState)

Enables or disables the USB FIFO clock (USBFIFOCLK).

Parameters
NewStatenew state of the USB FIFO clock. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ RCC_USBFIFOCLKConfig()

void RCC_USBFIFOCLKConfig ( uint32_t  RCC_USBFIFOCLKSource)

Configures the USB FIFO clock (USBFIFOCLK).

Parameters
RCC_USBFIFOCLKSourcespecifies the USB FIFO clock source. This parameter can be one of the following values:
  • RCC_USBFIFOCLKSource_AHBCLK: AHB clock selected as USB FIFO clock source
  • RCC_USBFIFOCLKSource_USBCLK: USB clock selected as USB FIFO clock source
Returns
None