MG32L003 Standard Peripherals Firmware Library

宏定义 | 函数
mg32l003_rcc.c 文件参考

This file provides all the RCC firmware functions. 更多...

`#include "mg32l003_rcc.h"`

## 宏定义
#define | RCC_REGWR_LOCK() (RCC->UNLOCK = (0x2AD5334C << RCC_UNLOCK_KEY_Pos) & RCC_UNLOCK_KEY)
#define | RCC_REGWR_UNLOCK() (RCC->UNLOCK = RCC_UNLOCK_UNLOCK | (0x2AD5334C << RCC_UNLOCK_KEY_Pos))
#define | RCC_SYSTEMCR_UNLOCK_KEY ((uint32_t)0x5A69)
#define | RCC_SYSTEMCR_UNLOCK_Pos ((uint32_t)16)
#define | RCC_SET_KEYBIT(REG, BIT) ((REG) |= (BIT | (RCC_SYSTEMCR_UNLOCK_KEY << RCC_SYSTEMCR_UNLOCK_Pos)))
#define | RCC_MODIFY_KEYREG(REG, CLEARMASK, SETVALUE) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETVALUE | (RCC_SYSTEMCR_UNLOCK_KEY << RCC_SYSTEMCR_UNLOCK_Pos))))
#define | RCC_WRITE_KEYREG(REG, VAL) ((REG) = (VAL | (RCC_SYSTEMCR_UNLOCK_KEY << RCC_SYSTEMCR_UNLOCK_Pos)))
#define | RCC_CLEAR_KEYBIT(REG, CLEARMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (RCC_SYSTEMCR_UNLOCK_KEY << RCC_SYSTEMCR_UNLOCK_Pos)))

## 函数
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. 更多...

## 详细描述

This file provides all the RCC firmware functions.

作者
  megawin Application Team

版本
  V0.0.5

日期
  13-August-2024