前言
gpio输入模式也就是简单的读取gpio的电平
操作
1、首先在cube中将gpio设置为输入模式
2、函数讲解:
HAL_GPIO_ReadPin(KEY1_GPIO_Port,KEY1_Pin);//这个函数用来读取pin的高低电平值
/**
* @brief Read the specified input port pin.
* @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F0 family
* @param GPIO_Pin specifies the port bit to read.
* This parameter can be GPIO_PIN_x where x can be (0..15).
* @retval The input port pin value.
*/
GPIO_PinState HA