MG32L003 Standard Peripherals Firmware Library

函数
RCC_Private_Functions
MG32L003_StdPeriph_Driver » RCC

## 函数
void | RCC_DeInit (void)
| Resets the RCC clock configuration to the default reset state. 更多...
void | RCC_HSIConfig (const uint32_t HSI_Value, FunctionalState NewState)
| Configures the Internal High Speed oscillator (HSI). 更多...
void | RCC_LSIConfig (uint32_t LSI_Value, uint32_t LSI_StartUPTime, FunctionalState NewState)
| Configures the Internal low Speed oscillator (LSI). 更多...
void | RCC_HSEConfig (uint32_t RCC_HSE)
| Configures the External High Speed oscillator (HSE). 更多...
void | RCC_LSEConfig (uint32_t RCC_LSE)
| Configures the External Low Speed oscillator (LSE). 更多...
void | RCC_HSEDriveCurrentConfig (uint32_t Current)
| Configures the drive current of High Speed oscillator (HSE). 更多...
void | RCC_HSEStartTimeConfig (uint32_t Time)
| Configures the start time of High Speed oscillator (HSE). 更多...
void | RCC_LSEDriveCurrentConfig (uint32_t Current)
| Configures the drive current of Low Speed oscillator (LSE). 更多...
void | RCC_LSEStartTimeConfig (uint32_t Time)
| Configures the start time of Low Speed oscillator (LSE). 更多...
void | RCC_SYSCLKConfig (uint32_t RCC_SYSCLKSource)
| Configures the SYS Clock (SYSCLK). 更多...
void | RCC_AHBCLKConfig (uint32_t RCC_AHBCLKDiv)
| Configures the AHB clock (AHBCLK). 更多...
void | RCC_APBCLKConfig (uint32_t RCC_APBCLKDiv)
| Configures the APB clock (APBCLK). 更多...
void | RCC_MCOConfig (uint32_t RCC_MCOSource, uint32_t RCC_MCOHCLKDiv)
| Selects the clock source to output on MCO pin. 更多...
void | RCC_MCOCmd (FunctionalState NewState)
| Enable or Disable the MCO Clock output. 更多...
void | RCC_GetClocksFreq (RCC_ClocksTypeDef *RCC_Clocks)
| Returns the frequencies of different on chip clocks. 更多...
void | RCC_AHBPeriphClockCmd (uint32_t RCC_AHBPeriph, FunctionalState NewState)
| Enables or disables the AHB peripheral clock. 更多...
void | RCC_APBPeriphClockCmd (uint32_t RCC_APBPeriph, FunctionalState NewState)
| Enables or disables the APB peripheral clock. 更多...
void | RCC_AHBPeriphResetCmd (uint32_t RCC_AHBPeriph, FunctionalState NewState)
| Forces or releases AHB peripheral reset. 更多...
void | RCC_APBPeriphResetCmd (uint32_t RCC_APBPeriph, FunctionalState NewState)
| Forces or releases APB peripheral reset. 更多...
void | RCC_RTCPeriphResetCmd (FunctionalState NewState)
| Forces or releases RTC peripheral reset. 更多...
FlagStatus | RCC_GetResetFlagStatus (uint32_t RCC_RSTFLAG)
| Checks whether the specified RCC reset flag is set or not. 更多...
void | RCC_ClearResetFlags (uint32_t RCC_RSTFLAG)
| Clear the specified RCC reset flag. 更多...

## 详细描述

## 函数说明

## ◆ RCC_AHBCLKConfig()

void RCC_AHBCLKConfig | ( | uint32_t | RCC_AHBCLKDiv | ) |

Configures the AHB clock (AHBCLK).

参数

  RCC_AHBCLKDiv | defines the AHB clock divider. This clock is derived from the system clock (SYSCLK). This parameter can be a value of 1-510, The allowed values are an even number from 2 to 510 and 1.

返回值

  None |

## ◆ RCC_AHBPeriphClockCmd()

void RCC_AHBPeriphClockCmd | ( | uint32_t | RCC_AHBPeriph,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the AHB peripheral clock.

参数

  RCC_AHBPeriph | specifies the AHB peripheral to gates its clock. This parameter can be any combination of the following values: RCC_AHBPeriph_GPIOA RCC_AHBPeriph_GPIOB RCC_AHBPeriph_GPIOC RCC_AHBPeriph_GPIOD RCC_AHBPeriph_CRC RCC_AHBPeriph_FLASH
  NewState | new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ RCC_AHBPeriphResetCmd()

void RCC_AHBPeriphResetCmd | ( | uint32_t | RCC_AHBPeriph,
|  | FunctionalState | NewState
| ) |  |

Forces or releases AHB peripheral reset.

参数

  RCC_AHBPeriph | specifies the AHB peripheral to reset. This parameter can be any combination of the following values: RCC_AHBPeriph_GPIOA RCC_AHBPeriph_GPIOB RCC_AHBPeriph_GPIOC RCC_AHBPeriph_GPIOD RCC_AHBPeriph_CRC
  NewState | new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ RCC_APBCLKConfig()

void RCC_APBCLKConfig | ( | uint32_t | RCC_APBCLKDiv | ) |

Configures the APB clock (APBCLK).

参数

  RCC_APBCLKDiv | defines the APB clock divider. This clock is derived from the AHB clock (HCLK). This parameter can be a value of 1-510, The allowed values are an even number from 2 to 510 and 1.

返回值

  None |

## ◆ RCC_APBPeriphClockCmd()

void RCC_APBPeriphClockCmd | ( | uint32_t | RCC_APBPeriph,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the APB peripheral clock.

参数

  RCC_APBPeriph | specifies the APB peripheral to gates its clock. This parameter can be any combination of the following values: RCC_APBPeriph_UART1 RCC_APBPeriph_UART2 RCC_APBPeriph_I2C RCC_APBPeriph_LPUART RCC_APBPeriph_SPI RCC_APBPeriph_LPTIM RCC_APBPeriph_BASETIM RCC_APBPeriph_SYSCON RCC_APBPeriph_PCA RCC_APBPeriph_OWIRE RCC_APBPeriph_TIM1 RCC_APBPeriph_TIM2 RCC_APBPeriph_WWDG RCC_APBPeriph_ADC RCC_APBPeriph_AWK RCC_APBPeriph_RTC RCC_APBPeriph_CLKTRIM RCC_APBPeriph_IWDG RCC_APBPeriph_LVDVC RCC_APBPeriph_BEEP RCC_APBPeriph_DBG
  NewState | new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ RCC_APBPeriphResetCmd()

void RCC_APBPeriphResetCmd | ( | uint32_t | RCC_APBPeriph,
|  | FunctionalState | NewState
| ) |  |

Forces or releases APB peripheral reset.

参数

  RCC_APBPeriph | specifies the APB peripheral to reset. This parameter can be any combination of the following values: RCC_APBPeriph_UART1 RCC_APBPeriph_UART2 RCC_APBPeriph_I2C RCC_APBPeriph_LPUART RCC_APBPeriph_SPI RCC_APBPeriph_LPTIM RCC_APBPeriph_BASETIM RCC_APBPeriph_SYSCON RCC_APBPeriph_PCA RCC_APBPeriph_OWIRE RCC_APBPeriph_TIM1 RCC_APBPeriph_TIM2 RCC_APBPeriph_WWDG RCC_APBPeriph_ADC RCC_APBPeriph_AWK RCC_APBPeriph_CLKTRIM RCC_APBPeriph_LVDVC RCC_APBPeriph_BEEP RCC_APBPeriph_DBG
  NewState | new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ RCC_ClearResetFlags()

void RCC_ClearResetFlags | ( | uint32_t | RCC_RSTFLAG | ) |

Clear the specified RCC reset flag.

参数

  RCC_RSTFLAG | specifies the flag to check. This parameter can be one of the following values: RCC_RSTFLAG_MCURST: MCU reset-option byte reload. RCC_RSTFLAG_CPURST: CPU reset-no option byte reload. RCC_RSTFLAG_WWDGRST: Window Watchdog reset. RCC_RSTFLAG_IWDGRST: Independent Watchdog reset. RCC_RSTFLAG_LVDRST: Low Voltage Detect reset. RCC_RSTFLAG_PORRST: PowerON reset. RCC_RSTFLAG_LOCKUPRST: CPU Lockup reset. RCC_RSTFLAG_PADRST: Pad reset. RCC_RSTFLAG_SFTRST: Software reset.

返回值

  None. |

## ◆ RCC_DeInit()

void RCC_DeInit | ( | void |  | ) |

Resets the RCC clock configuration to the default reset state.

注解
  The default reset state of the clock configuration is given below:
  - HSI ON and used as system clock source
  - HSE are OFF
  - AHB, APB prescaler set to 1.
  - MCO OFF
  This function does not modify the configuration of the
  - Peripheral clocks
  - LSI, LSE clocks

返回值

  None |

## ◆ RCC_GetClocksFreq()

void RCC_GetClocksFreq | ( | RCC_ClocksTypeDef * | RCC_Clocks | ) |

Returns the frequencies of different on chip clocks.

参数

  RCC_Clocks | pointer to a RCC_ClocksTypeDef structure which will hold the clocks frequencies.

返回值

  None |

## ◆ RCC_GetResetFlagStatus()

FlagStatus RCC_GetResetFlagStatus | ( | uint32_t | RCC_RSTFLAG | ) |

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

参数

  RCC_RSTFLAG | specifies the flag to check. This parameter can be one of the following values: RCC_RSTFLAG_MCURST: MCU reset-option byte reload. RCC_RSTFLAG_CPURST: CPU reset-no option byte reload. RCC_RSTFLAG_WWDGRST: Window Watchdog reset. RCC_RSTFLAG_IWDGRST: Independent Watchdog reset. RCC_RSTFLAG_LVDRST: Low Voltage Detect reset. RCC_RSTFLAG_PORRST: PowerON reset. RCC_RSTFLAG_LOCKUPRST: CPU Lockup reset. RCC_RSTFLAG_PADRST: Pad reset. RCC_RSTFLAG_SFTRST: Software reset.

返回值

  The | new state of RCC_RSTFLAG (SET or RESET).

## ◆ RCC_HSEConfig()

void RCC_HSEConfig | ( | uint32_t | RCC_HSE | ) |

Configures the External High Speed oscillator (HSE).

参数

  RCC_HSE | Specifies the new state of the HSE. This parameter can be one of the following values: RCC_HSE_OFF RCC_HSE_ON RCC_HSE_BYPASS RCC_HSE_DEFAULT

注解
  The SYSTEM register write-protection function should be disabled before using this function.

返回值

  None |

## ◆ RCC_HSEDriveCurrentConfig()

void RCC_HSEDriveCurrentConfig | ( | uint32_t | Current | ) |

Configures the drive current of High Speed oscillator (HSE).

参数

  Current | specifies the drive current.

注解
  The SYSTEM register write-protection function should be disabled before using this function. This parameter can be a value of 0-7.

返回值

  None |

## ◆ RCC_HSEStartTimeConfig()

void RCC_HSEStartTimeConfig | ( | uint32_t | Time | ) |

Configures the start time of High Speed oscillator (HSE).

参数

  Time | specifies the start time.

注解
  The SYSTEM register write-protection function should be disabled before using this function. This parameter can be a value of 0-3.

返回值

  None |

## ◆ RCC_HSIConfig()

void RCC_HSIConfig | ( | const uint32_t | HSI_Value,
|  | FunctionalState | NewState
| ) |  |

Configures the Internal High Speed oscillator (HSI).

参数

  HSI_Value | The HSI frequency value. This parameter can be one of the following values: HSI_VALUE_24M HSI_VALUE_22M HSI_VALUE_16M HSI_VALUE_8M HSI_VALUE_4M
  NewState | new state of the HSI. This parameter can be: ENABLE or DISABLE.

注解
  The SYSTEM register write-protection function should be disabled before using this function.

返回值

  None |

## ◆ RCC_LSEConfig()

void RCC_LSEConfig | ( | uint32_t | RCC_LSE | ) |

Configures the External Low Speed oscillator (LSE).

参数

  RCC_LSE | Specifies the new state of the LSE. This parameter can be one of the following values: RCC_LSE_OFF RCC_LSE_ON RCC_LSE_BYPASS RCC_LSE_DEFAULT

注解
  The SYSTEM register write-protection function should be disabled before using this function.

返回值

  None |

## ◆ RCC_LSEDriveCurrentConfig()

void RCC_LSEDriveCurrentConfig | ( | uint32_t | Current | ) |

Configures the drive current of Low Speed oscillator (LSE).

参数

  Current | specifies the drive current.

注解
  The SYSTEM register write-protection function should be disabled before using this function. This parameter can be a value of 0-15.

返回值

  None |

## ◆ RCC_LSEStartTimeConfig()

void RCC_LSEStartTimeConfig | ( | uint32_t | Time | ) |

Configures the start time of Low Speed oscillator (LSE).

参数

  Time | specifies the start time.

注解
  The SYSTEM register write-protection function should be disabled before using this function. This parameter can be a value of 0-3.

返回值

  None |

## ◆ RCC_LSIConfig()

void RCC_LSIConfig | ( | uint32_t | LSI_Value,
|  | uint32_t | LSI_StartUPTime,
|  | FunctionalState | NewState
| ) |  |

Configures the Internal low Speed oscillator (LSI).

参数

  LSI_Value | The LSI frequency value. This parameter can be one of the following values: LSI_VALUE_38K LSI_VALUE_32K
  LSI_StartUPTime | The LSI startup time. This parameter can be one of the following values: RCC_LSI_STARTUP_4CYCLE RCC_LSI_STARTUP_16CYCLE RCC_LSI_STARTUP_64CYCLE RCC_LSI_STARTUP_256CYCLE
  NewState | new state of the LSI. This parameter can be: ENABLE or DISABLE.

注解
  The SYSTEM register write-protection function should be disabled before using this function.

返回值

  None |

## ◆ RCC_MCOCmd()

void RCC_MCOCmd | ( | FunctionalState | NewState | ) |

Enable or Disable the MCO Clock output.

参数

  NewState | new state of the MCO. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ RCC_MCOConfig()

void RCC_MCOConfig | ( | uint32_t | RCC_MCOSource,
|  | uint32_t | RCC_MCOHCLKDiv
| ) |  |

Selects the clock source to output on MCO pin.

参数

  RCC_MCOSource | specifies the clock source to output. This parameter can be one of the following values: RCC_MCOSOURCE_HSI: HSI selected as MCO clock RCC_MCOSOURCE_HSE: HSE selected as MCO clock RCC_MCOSOURCE_LSI: LSI selected as MCO clock RCC_MCOSOURCE_LSE: LSE selected as MCO clock RCC_MCOSOURCE_SYSCLK: SYSCLK selected as MCO clock RCC_MCOSOURCE_HCLK: HCLK selected as MCO clock
  RCC_MCOHCLKDiv | specifies the MCO DIV. This parameter can be a value of 1-510, The allowed values are an even number from 2 to 510 and 1.

注解
  MCO pin should be configured in alternate function mode.

返回值

  None |

## ◆ RCC_RTCPeriphResetCmd()

void RCC_RTCPeriphResetCmd | ( | FunctionalState | NewState | ) |

Forces or releases RTC peripheral reset.

参数

  NewState | new state of the RTC peripheral reset. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ RCC_SYSCLKConfig()

void RCC_SYSCLKConfig | ( | uint32_t | RCC_SYSCLKSource | ) |

Configures the SYS Clock (SYSCLK).

参数

  RCC_SYSCLKSource | specifies the clock source used as system clock. This parameter can be one of the following values: RCC_SYSCLKSource_HSI: HSI selected as system clock. RCC_SYSCLKSource_HSE: HSE selected as system clock. RCC_SYSCLKSource_LSI: LSI selected as system clock. RCC_SYSCLKSource_LSE: LSE selected as system clock.

返回值

  None |