STM32时钟代码的解析,以及启动函数的指针跳转 |
您所在的位置:网站首页 › pllp什么意思 › STM32时钟代码的解析,以及启动函数的指针跳转 |
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; //HSE表示使用外部时钟,HSI表示使用的是内部时钟 RCC_OscInitStruct.HSEState = RCC_HSE_ON; // 打开外部时钟 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; //时钟源设置 RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; //表示6倍频率,如果外部时钟源是8MHZ,那么6倍的倍频就是48MHZ RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1; // 对时钟源的分频 如果是48MHZ,,2分频就是24MHZ HAL_RCC_OscConfig(&RCC_OscInitStruct);
#define RCC_OSCILLATORTYPE_NONE ((uint32_t)0x00000000) #define RCC_OSCILLATORTYPE_HSE ((uint32_t)0x00000001) #define RCC_OSCILLATORTYPE_HSI ((uint32_t)0x00000002) #define RCC_OSCILLATORTYPE_LSE ((uint32_t)0x00000004) //低频外部时钟 #define RCC_OSCILLATORTYPE_LSI ((uint32_t)0x00000008)//低频内部时钟 #define RCC_OSCILLATORTYPE_HSI14 ((uint32_t)0x00000010)
低频时钟只是用于RTC,RTC主要用来做低功耗
void IAP_Set(void) { uint32_t i = 0; /* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/ /* Copy the vector table from the Flash (mapped at the base of the application load address 0x08003000) to the base address of the SRAM at 0x20000000. */ for(i = 0; i < 48; i++) { *((uint32_t*)(0x20000000 + (i |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |