STM32F103将IIC1 remap成串口1

从datasheet上看到PB6、PB7默认功能是IIC1,有时候为了将它remap成串口,只需要增加2步即可: 1、时钟初始化,注意顺序不能乱 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_USART1|RCC_APB2Periph_AFIO,ENABLE); 2、调用remap函数 GPIO_PinRemapConfig(
相关文章
相关标签/搜索