GPIO的翻转操作方法

STM32在进行IO翻转操作的时候可以使用以下方法:以PE.5为例

GPIO_WriteBit(GPIOE,GPIO_Pin_5,(BitAction)(1-(GPIO_ReadOutputDataBit(GPIOE,GPIO_Pin_5))));
GPIO_WriteBit(GPIOE, GPIO_Pin_5, (BitAction)!GPIO_ReadOutputDataBit(GPIOE, GPIO_Pin_5))
GPIOE->ODR ^= GPIO_Pin_5
GPIO_ToggleBits(GPIOE, GPIO_Pin_5)/*有的版本不存在*/

原文地址:https://www.cnblogs.com/jieruishu/p/6340712.html