RCC_OscInitTypeDef为设置系统各时钟的来源
typedef struct
{
uint32_t OscillatorType; //选定将被配置的振荡器
uint32_t HSEState; //HSE状态
uint32_t LSEState; //LSE状态
uint32_t HSIState; //HSI状态
uint32_t HSICalibrationValue; //HSI校准调整值
uint32_t LSIState; //LSI状态
RCC_PLLInitTypeDef PLL; //PLL结构体参数
} RCC_OscInitTypeDef;
RCC_ClkInitTypeDef设置AHB和APB总线时钟配置
typedef struct
{
uint32_t ClockType; //选定将被配置的时钟
uint32_t SYSCLKSource; //用作系统时钟的时钟源选择
uint32_t AHBCLKDivider; //AHB时钟(HCLK)分频器,该时钟由SYSCLK而来
uint32_t APB1CLKDivider; //APB1时钟(PCLK1)分频器,该时钟由HCLK而来
uint32_t APB2CLKDivider; //APB2时钟(PCLK2)分频器,该时钟由HCLK而来
} RCC_ClkInitTypeDef;
RCC_PLLInitTypeDef设置PLL的相关参数
typedef struct
{
uint32_t PLLState; //PLL状态
uint32_t PLLSource;//PLL输入时钟
uint32_t PLLM; //PLL
uint32_t PLLN;
uint32_t PLLP;
uint32_t PLLQ;
}RCC_PLLInitTypeDef;