了解了相关STM32CubeMX相关使用后下面就是针对HAL库函数进行相关学习使用,如HAL_GPIO_ReadPin()函数,就是读取IO状态的函数;
HAL_GPIO_ReadPin
Function Name GPIO_PinState HAL_GPIO_ReadPin (GPIO_TypeDef * GPIOx,uint16_t GPIO_Pin)
Function Description Reads the specified input port pin.
Parameters GPIOx: where x can be (A..G depending on device used) to
select the GPIO peripheral
GPIO_Pin: specifies the port bit to read. This parameter can
be GPIO_PIN_x where x can be (0..15).
Return values The input port pin value.
下面就把HAL库GPIO库函数分享给大家!
GPIOAPI.pdf
(340.45 KB)
|