SYS_INIT(); ---> 这里面将外设时钟都disable了 /* GPIO Configuration */ GPIO_Configuration();
RCCU_Div2Config(ENABLE); // Enable DIV2 RCCU_MCLKConfig(RCCU_DEFAULT); // Configure MCLK = RCLK RCCU_FCLKConfig(RCCU_DEFAULT); // Configure FCLK = RCLK RCCU_PCLKConfig(RCCU_DEFAULT); // Configure PCLK = RCLK RCCU_PLL1Config(RCCU_Mul_12, RCCU_Div_2) ; // Configure the PLL1 ( * 12 , / 2 ) while(RCCU_FlagStatus(RCCU_PLL1_LOCK) == RESET);// Wait PLL to lock RCCU_RCLKSourceConfig(RCCU_PLL1_Output) ; // Select PLL1_Output as RCLK clock // at this step the CKOUT signal should be equal to 48 Mhz
/* Enable RTC and EIC clocks on APB1 */ APB_ClockConfig (APB1, ENABLE, UART0_Periph ); /* Enable RTC and EIC clocks on APB2 */ APB_ClockConfig (APB2, ENABLE, //RTC_Periph | --> RTC 仍然可以跑 EIC_Periph | // TIM0_Periph | --> T0仍然可以跑 TIM1_Periph | GPIO0_Periph | GPIO1_Periph | GPIO2_Periph); /* Enable the CKOUT clock for debug purpose*/ APB_ClockConfig (APB2, ENABLE, CKOUT_Periph);
请教怎么实现外设功能的时钟势能与关闭 |