STM32F4XX IO口時鐘複用功能
阿新 • • 發佈:2019-01-08
基於STM32F412,在PC9上輸出System Clock 。 同理,也可以在PA8上輸出其他的時鐘功能。
輸出的引數,可以通過呼叫RCC_MCO1Config( )和RCC_MCO2Config( ) 這兩個函式即可。庫函式的解釋已經很清晰了,也不用再複述了。GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_PinAFConfig(GPIOC,GPIO_PinSource9,GPIO_AF_MCO); RCC_MCO2Config(RCC_MCO2Source_SYSCLK, RCC_MCO2Div_4);