From 16517b9f553195589f63d696b36c6b534cfdc683 Mon Sep 17 00:00:00 2001 From: jzlv Date: Mon, 12 Jul 2021 16:55:26 +0800 Subject: [PATCH] [feat][gpio] add gpio hz mode --- drivers/bl702_driver/hal_drv/inc/hal_gpio.h | 1 + drivers/bl702_driver/hal_drv/src/hal_gpio.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bl702_driver/hal_drv/inc/hal_gpio.h b/drivers/bl702_driver/hal_drv/inc/hal_gpio.h index b7eaf904..4afe8355 100644 --- a/drivers/bl702_driver/hal_drv/inc/hal_gpio.h +++ b/drivers/bl702_driver/hal_drv/inc/hal_gpio.h @@ -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; diff --git a/drivers/bl702_driver/hal_drv/src/hal_gpio.c b/drivers/bl702_driver/hal_drv/src/hal_gpio.c index c33edca5..eef5dc9c 100644 --- a/drivers/bl702_driver/hal_drv/src/hal_gpio.c +++ b/drivers/bl702_driver/hal_drv/src/hal_gpio.c @@ -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);