EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
STM32定时器重映射
3 Q7 c% ?) q0 F! `
[: m6 B& c9 x" {1 ` 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); } ( c: `' }. E$ A4 y5 i) S3 N
|