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(GPIO_Remap_USART1,ENABLE);
当然其他的初始化步骤照常写就好了。

相关文章:

  • 2021-09-12
  • 2021-10-25
  • 2021-06-26
  • 2021-07-06
  • 2021-11-29
  • 2021-04-25
  • 2021-12-18
  • 2021-08-05
猜你喜欢
  • 2021-04-10
  • 2021-05-23
  • 2021-04-03
  • 2021-12-04
  • 2022-01-01
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案