GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;:这行代码设置了GPIO结构体中的GPIO_Pin字段,指定要配置的引脚为12、13、14和15。
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;:这行代码设置了GPIO结构体中的GPIO_Mode字段,指定这些引脚的模式为上拉输入(IPU)。
GPIO_Init(GPIOB, &GPIO_InitStructure);:这行代码调用HAL库的GPIO_Init函数,它使用GPIO_InitStructure中的值来初始化GPIOB端口的指定引脚。 |