[feat][gpio] add gpio hz mode

This commit is contained in:
jzlv 2021-07-12 16:55:26 +08:00
parent 91f7d9bc9f
commit 16517b9f55
2 changed files with 3 additions and 1 deletions

View File

@ -75,6 +75,7 @@ enum gpio_pin_type {
#define GPIO_SYNC_FALLING_TRIGER_INT_MODE 11
#define GPIO_SYNC_HIGH_LEVEL_INT_MODE 12
#define GPIO_SYNC_LOW_LEVEL_INT_MODE 13
#define GPIO_HZ_MODE 14
typedef struct gpio_device {
struct device parent;

View File

@ -82,7 +82,8 @@ void gpio_set_mode(uint32_t pin, uint32_t mode)
gpio_cfg.gpioMode = GPIO_MODE_INPUT;
gpio_cfg.pullType = GPIO_PULL_DOWN;
break;
case GPIO_HZ_MODE:
GLB_GPIO_Set_HZ(pin);
default:
NVIC_DisableIRQ(GPIO_INT0_IRQn);
GLB_GPIO_IntMask(pin, MASK);