行业资讯
📅 2026/7/10 2:41:09
GPIO输入
比较常见的按键接法按下时是低电平松手是高电平char int8_tunsigned short uint8_tshort int16_tint int32_t宏定义#define ABC 12345 //用ABC去替换12345引用宏定义int aABC //int a12345typedef定义typedef :typedef unsigned char uint8_t;引用typedef: uint8_t a; // unsighned char atypedef 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;C语言的枚举:用来限制变量取值范围enum{MON1,TUE2,WES3}week;typedef与枚举的结合typedef enum{MON1,TUE 2,WES3} week_tint main{week_tweek;weekMONDAY //week1}