有关STM32 使用结构体来配置GPIO口的一些总结
下面代码如下typedef struct{uint16_t GPIO_Pin; /*! Specifies the GPIO pins to be configured.This parameter can be any value of ref GPIO_pins_define */GPIOSpeed_TypeDef GPIO_Speed; /*! Specifies the speed for the selected pins.This parameter can be a value of ref GPIOSpeed_TypeDef */GPIOMode_TypeDef GPIO_Mode; /*! Specifies the operating mode for the selected pins.This parameter can be a value of ref GPIOMode_TypeDef */}GPIO_InitTypeDef;用标准的typedef来把typedef struct和后面的{uint16_t GPIO_Pin; /*! Specifies the GPIO pins to be configured.This parameter can be any value of ref GPIO_pins_define */GPIOSpeed_TypeDef GPIO_Speed; /*! Specifies the speed for the selected pins.This parameter can be a value of ref GPIOSpeed_TypeDef */GPIOMode_TypeDef GPIO_Mode; /*! Specifies the operating mode for the selected pins.This parameter can be a value of ref GPIOMode_TypeDef */}定义成一个新的GPIO_InitTypeDef;与define有区别typedef 只能给变量类型换名字