代码如下:
//FUNCKTION: LED取反
//PARAMATER: GPIOx : Select the GPIO peripheral number (x = A to I).
// GPIO_Pin : Specifies the pins to be toggled.
//RETURN : 无
//
//取自库函数原型:void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin)
void LED_Toggle(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
GPIOx->ODR ^= GPIO_Pin;
}