对STM8S单片机GPIO.C的理解

版权声明:版权所有,转载请与作者联系。 https://blog.csdn.net/pengjielun5873/article/details/86635697

一、STM8S单片机GPIO.C的组成

实际上,STM8S 系列单片机需要使用的stm8s_gpio.c由以下几个部分组成:

1.	void GPIO_DeInit(GPIO_TypeDef* GPIOx)
2.	void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode)
3.	void GPIO_Write(GPIO_TypeDef* GPIOx, uint8_t PortVal)
4.	void GPIO_WriteHigh(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins)
5.	void GPIO_WriteLow(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins)
6.	void GPIO_WriteReverse(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins)
7.	uint8_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
8.	uint8_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
9.	BitStatus GPIO_ReadInputPin(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin)
10.	void GPIO_ExternalPullUpConfig(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, FunctionalState NewState)

二、各部分功能详解

1. void GPIO_DeInit(GPIO_TypeDef* GPIOx)

31313465364456456232312

2. void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode)

3. void GPIO_Write(GPIO_TypeDef* GPIOx, uint8_t PortVal)

4. void GPIO_WriteHigh(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins)

5. void GPIO_WriteLow(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins)

6. void GPIO_WriteReverse(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef PortPins)

7. uint8_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)

8. uint8_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)

9. BitStatus GPIO_ReadInputPin(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin)

10. void GPIO_ExternalPullUpConfig(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, FunctionalState NewState)

三、典型应用

猜你喜欢

转载自blog.csdn.net/pengjielun5873/article/details/86635697