1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| #ifndef _GPIO_H_
| #define _GPIO_H_
|
| #include "HIDO_TypeDef.h"
| #include "stm32l0xx_hal.h"
|
| typedef struct
| {
| GPIO_TypeDef* m_pstGPIOx;
| HIDO_UINT16 m_u16GPIOPin;
| }ST_GPIO;
|
| #define GPIO_SET(gpio) HAL_GPIO_WritePin((gpio)->m_pstGPIOx, (gpio)->m_u16GPIOPin, GPIO_PIN_SET)
| #define GPIO_RESET(gpio) HAL_GPIO_WritePin((gpio)->m_pstGPIOx, (gpio)->m_u16GPIOPin, GPIO_PIN_RESET)
| #define GPIO_TOGGLE(gpio) HAL_GPIO_TogglePin((gpio)->m_pstGPIOx, (gpio)->m_u16GPIOPin)
| #define GPIO_IS_SET(gpio) (HAL_GPIO_ReadPin((gpio)->m_pstGPIOx, (gpio)->m_u16GPIOPin) == GPIO_PIN_SET ? HIDO_TRUE : HIDO_FALSE)
|
| #endif /* _GPIO_H_ */
|
|