在stm32英文参考手册有对应的寄存器配置方式
以下是在官方库函数中复制的代码
typedef enum
{ GPIO_Mode_AIN = 0x0,// 0000
GPIO_Mode_IN_FLOATING = 0x04,// 0100
GPIO_Mode_IPD = 0x28,//0010 1000
GPIO_Mode_IPU = 0x48,//0100 1000
GPIO_Mode_Out_OD = 0x14, //0001 0100
GPIO_Mode_Out_PP = 0x10, //0001 0000
GPIO_Mode_AF_OD = 0x1C, //0001 1100
GPIO_Mode_AF_PP = 0x18 //0001 1000
}GPIOMode_TypeDef;