MG32L003 Standard Peripherals Firmware Library

结构体 | 宏定义 | 函数
mg32l003_rcc.h 文件参考

This file contains all the functions prototypes for the RCC firmware library. 更多...

`#include "mg32l003.h"`

浏览源代码.

## 结构体
struct | RCC_ClocksTypeDef

## 宏定义
#define | HSI_VALUE_24M ((uint32_t)24000000)
#define | HSI_VALUE_22M ((uint32_t)22120000)
#define | HSI_VALUE_16M ((uint32_t)16000000)
#define | HSI_VALUE_8M ((uint32_t)8000000)
#define | HSI_VALUE_4M ((uint32_t)4000000)
#define | LSI_VALUE_38K ((uint32_t)38400)
#define | LSI_VALUE_32K ((uint32_t)32768)
#define | RCC_LSI_STARTUP_4CYCLE ((uint32_t)(0x00U << RCC_LSICR_LSISTARTUP_Pos))
#define | RCC_LSI_STARTUP_16CYCLE ((uint32_t)(0x01U << RCC_LSICR_LSISTARTUP_Pos))
#define | RCC_LSI_STARTUP_64CYCLE ((uint32_t)(0x02U << RCC_LSICR_LSISTARTUP_Pos))
#define | RCC_LSI_STARTUP_256CYCLE ((uint32_t)(0x03U << RCC_LSICR_LSISTARTUP_Pos))
#define | RCC_HSE_OFF ((uint32_t)0x00)
#define | RCC_HSE_ON ((uint32_t)0x01)
#define | RCC_HSE_BYPASS ((uint32_t)0x02)
#define | RCC_HSE_DEFAULT ((uint32_t)0x03)
#define | RCC_LSE_OFF ((uint32_t)0x00)
#define | RCC_LSE_ON ((uint32_t)0x01)
#define | RCC_LSE_BYPASS ((uint32_t)0x02)
#define | RCC_LSE_DEFAULT ((uint32_t)0x03)
#define | RCC_SYSCLKSource_HSI ((uint32_t)(0x01U << RCC_SYSCLKSEL_CLKSW_Pos))
#define | RCC_SYSCLKSource_HSE ((uint32_t)(0x02U << RCC_SYSCLKSEL_CLKSW_Pos))
#define | RCC_SYSCLKSource_LSI ((uint32_t)(0x04U << RCC_SYSCLKSEL_CLKSW_Pos))
#define | RCC_SYSCLKSource_LSE ((uint32_t)(0x08U << RCC_SYSCLKSEL_CLKSW_Pos))
#define | RCC_AHBCLKDiv1 ((uint32_t)0x00)
#define | RCC_AHBCLKDiv2 ((uint32_t)0x01)
#define | RCC_APBCLKDiv1 ((uint32_t)0x00)
#define | RCC_APBCLKDiv2 ((uint32_t)0x01)
#define | RCC_MCOSOURCE_HSI ((uint32_t)(0x00U << RCC_MCOCR_MCOSEL_Pos))
#define | RCC_MCOSOURCE_HSE ((uint32_t)(0x01U << RCC_MCOCR_MCOSEL_Pos))
#define | RCC_MCOSOURCE_LSI ((uint32_t)(0x02U << RCC_MCOCR_MCOSEL_Pos))
#define | RCC_MCOSOURCE_LSE ((uint32_t)(0x03U << RCC_MCOCR_MCOSEL_Pos))
#define | RCC_MCOSOURCE_SYSCLK ((uint32_t)(0x04U << RCC_MCOCR_MCOSEL_Pos))
#define | RCC_MCOSOURCE_HCLK ((uint32_t)(0x05U << RCC_MCOCR_MCOSEL_Pos))
#define | RCC_MCOHCLkDiv1 ((uint32_t)0x00)
#define | RCC_MCOHCLkDiv2 ((uint32_t)0x01)
#define | RCC_AHBPeriph_GPIOA ((uint32_t)(0x01U << 0))
#define | RCC_AHBPeriph_GPIOB ((uint32_t)(0x01U << 1))
#define | RCC_AHBPeriph_GPIOC ((uint32_t)(0x01U << 2))
#define | RCC_AHBPeriph_GPIOD ((uint32_t)(0x01U << 3))
#define | RCC_AHBPeriph_CRC ((uint32_t)(0x01U << 4))
#define | RCC_AHBPeriph_FLASH ((uint32_t)(0x01U << 8))
#define | RCC_AHBPeriph_ALL ((uint32_t)0x0000011F)
#define | RCC_APBPeriph_UART1 ((uint32_t)(0x01U << 0))
#define | RCC_APBPeriph_UART2 ((uint32_t)(0x01U << 1))
#define | RCC_APBPeriph_I2C ((uint32_t)(0x01U << 2))
#define | RCC_APBPeriph_LPUART ((uint32_t)(0x01U << 3))
#define | RCC_APBPeriph_SPI ((uint32_t)(0x01U << 4))
#define | RCC_APBPeriph_LPTIM ((uint32_t)(0x01U << 5))
#define | RCC_APBPeriph_BASETIM ((uint32_t)(0x01U << 6))
#define | RCC_APBPeriph_SYSCON ((uint32_t)(0x01U << 7))
#define | RCC_APBPeriph_PCA ((uint32_t)(0x01U << 8))
#define | RCC_APBPeriph_OWIRE ((uint32_t)(0x01U << 9))
#define | RCC_APBPeriph_TIM1 ((uint32_t)(0x01U << 10))
#define | RCC_APBPeriph_TIM2 ((uint32_t)(0x01U << 11))
#define | RCC_APBPeriph_WWDG ((uint32_t)(0x01U << 12))
#define | RCC_APBPeriph_ADC ((uint32_t)(0x01U << 13))
#define | RCC_APBPeriph_AWK ((uint32_t)(0x01U << 14))
#define | RCC_APBPeriph_RTC ((uint32_t)(0x01U << 15))
#define | RCC_APBPeriph_CLKTRIM ((uint32_t)(0x01U << 16))
#define | RCC_APBPeriph_IWDG ((uint32_t)(0x01U << 17))
#define | RCC_APBPeriph_LVDVC ((uint32_t)(0x01U << 18))
#define | RCC_APBPeriph_BEEP ((uint32_t)(0x01U << 19))
#define | RCC_APBPeriph_DBG ((uint32_t)(0x01U << 20))
#define | RCC_APBPeriph_ALL ((uint32_t)0x001FFFFF)
#define | RCC_RSTFLAG_MCURST ((uint32_t)(0x01U << 0))
#define | RCC_RSTFLAG_CPURST ((uint32_t)(0x01U << 1))
#define | RCC_RSTFLAG_WWDGRST ((uint32_t)(0x01U << 2))
#define | RCC_RSTFLAG_IWDGRST ((uint32_t)(0x01U << 3))
#define | RCC_RSTFLAG_LVDRST ((uint32_t)(0x01U << 4))
#define | RCC_RSTFLAG_PORRST ((uint32_t)(0x01U << 5))
#define | RCC_RSTFLAG_LOCKUPRST ((uint32_t)(0x01U << 6))
#define | RCC_RSTFLAG_PADRST ((uint32_t)(0x01U << 7))
#define | RCC_RSTFLAG_SFTRST ((uint32_t)(0x01U << 8))
#define | HSI24M_TRIM_ADDR ((uint32_t)0x180000A0)
#define | HSI22M_TRIM_ADDR ((uint32_t)0x180000A2)
#define | HSI16M_TRIM_ADDR ((uint32_t)0x180000A4)
#define | HSI8M_TRIM_ADDR ((uint32_t)0x180000A6)
#define | HSI4M_TRIM_ADDR ((uint32_t)0x180000A8)
#define | HSI24M_TC_ADDR ((uint32_t)0x18000090)
#define | HSI22M_TC_ADDR ((uint32_t)0x18000092)
#define | HSI16M_TC_ADDR ((uint32_t)0x18000094)
#define | HSI8M_TC_ADDR ((uint32_t)0x18000096)
#define | HSI4M_TC_ADDR ((uint32_t)0x18000098)
#define | RCC_HSITRIM_24M (*(uint16_t *)(HSI24M_TRIM_ADDR))
#define | RCC_HSITRIM_22M (*(uint16_t *)(HSI22M_TRIM_ADDR))
#define | RCC_HSITRIM_16M (*(uint16_t *)(HSI16M_TRIM_ADDR))
#define | RCC_HSITRIM_8M (*(uint16_t *)(HSI8M_TRIM_ADDR))
#define | RCC_HSITRIM_4M (*(uint16_t *)(HSI4M_TRIM_ADDR))
#define | RCC_HSITC_24M (*(uint16_t *)(HSI24M_TC_ADDR))
#define | RCC_HSITC_22M (*(uint16_t *)(HSI22M_TC_ADDR))
#define | RCC_HSITC_16M (*(uint16_t *)(HSI16M_TC_ADDR))
#define | RCC_HSITC_8M (*(uint16_t *)(HSI8M_TC_ADDR))
#define | RCC_HSITC_4M (*(uint16_t *)(HSI4M_TC_ADDR))
#define | RCC_HSICALIBRATION_DEFAULT ((uint32_t)0x00000312)
#define | LSI38K_TRIM_ADDR ((uint32_t)0x180000B4)
#define | LSI32K_TRIM_ADDR ((uint32_t)0x180000B0)
#define | LSI38K_TC_ADDR ((uint32_t)0x180000BC)
#define | LSI32K_TC_ADDR ((uint32_t)0x180000B8)
#define | RCC_LSITRIM_38K (*(uint16_t *)(LSI38K_TRIM_ADDR))
#define | RCC_LSITRIM_32K (*(uint16_t *)(LSI32K_TRIM_ADDR))
#define | RCC_LSITC_38K (*(uint16_t *)(LSI38K_TC_ADDR))
#define | RCC_LSITC_32K (*(uint16_t *)(LSI32K_TC_ADDR))
#define | RCC_LSICALIBRATION_DEFAULT 0x0000007FU
#define | IS_HSI_VALUE(VALUE)
#define | IS_LSI_VALUE(VALUE)
#define | IS_RCC_LSI_STARTUP(TIME)
#define | IS_RCC_HSE(HSE)
#define | IS_RCC_LSE(LSE)
#define | IS_RCC_SYSCLK_SOURCE(SOURCE)
#define | IS_RCC_AHBCLKDiv(DIV) (((int32_t)(DIV) > 0) && ((DIV) <= 510))
#define | IS_RCC_APBCLKDiv(DIV) (((int32_t)(DIV) > 0) && ((DIV) <= 510))
#define | IS_RCC_MCO_HCLkDiv(DIV) (((int32_t)(DIV) > 0) && ((DIV) <= 510))
#define | IS_RCC_MCO_SOURCE(SOURCE)
#define | IS_RCC_AHB_PERIPH(PERIPH) ((((PERIPH) & RCC_AHBPeriph_ALL) != 0))
#define | IS_RCC_APB_PERIPH(PERIPH) ((((PERIPH) & RCC_APBPeriph_ALL) != 0))
#define | IS_RCC_RESET_FLAG(FLAG)

## 函数
void | RCC_DeInit (void)
| Resets the RCC clock configuration to the default reset state. 更多...
void | RCC_HSIConfig (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 contains all the functions prototypes for the RCC firmware library.

作者
  megawinTech Application Team

版本
  V0.0.5

日期
  13-August-2024