EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
STM32定时器重映射
* ]& I. l! }4 }4 z
8 l" n2 m+ n3 g void TIM3_GPIOB5_Config(void) { GPIO_InitTypeDef GPIO_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO , ENABLE); GPIO_AFIODeInit(); //将重映射恢复为初始值 //在程序中只可以调用一次,不然之前的设置就取消了 GPIO_PinRemapConfig(GPIO_PartialRemap_TIM3 ,ENABLE ); //重映射相应的外设 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; //配置引脚 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); } 9 |7 O, K, t* x
|