GPIOMode_TypeDef GPIO_Mode;

2019-07-21 01:31发布

typedef struct {   uint32_t GPIO_Pin;       GPIOMode_TypeDef GPIO_Mode;       GPIOSpeed_TypeDef GPIO_Speed;    GPIOOType_TypeDef GPIO_OType;     GPIOPuPd_TypeDef GPIO_PuPd;    }GPIO_InitTypeDef;
GPIOMode_TypeDef GPIO_Mode;中是不是就定义了和一下一样的结构体。 
typedef enum {   GPIO_Mode_IN   = 0x00, /*!< GPIO Input Mode */   GPIO_Mode_OUT  = 0x01, /*!< GPIO Output Mode */   GPIO_Mode_AF   = 0x02, /*!< GPIO Alternate function Mode */   GPIO_Mode_AN   = 0x03  /*!< GPIO Analog Mode */ }GPIOMode_TypeDef; GPIO_InitStruct.GPIO_Mode=GPIO_Mode_OUT就可以定义模式为0x01。如果是GPIO_InitStruct.GPIO_Mode.GPIO_Mode_OUT还是可以理解。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。