From bbb12e0d527008d5872acc373c9d11f0d903c21b Mon Sep 17 00:00:00 2001 From: Ihor Nehrutsa Date: Wed, 27 Nov 2024 11:14:37 +0300 Subject: [PATCH] Update gpio.c --- components/esp_driver_gpio/src/gpio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/esp_driver_gpio/src/gpio.c b/components/esp_driver_gpio/src/gpio.c index 9659a907b9ee..0256993de0e5 100644 --- a/components/esp_driver_gpio/src/gpio.c +++ b/components/esp_driver_gpio/src/gpio.c @@ -1065,3 +1065,10 @@ void gpio_get_io_config(uint32_t gpio_num, { gpio_hal_get_io_config(gpio_context.gpio_hal, gpio_num, pu, pd, ie, oe, od, drv, fun_sel, sig_out, slp_sel); } + +esp_err_t gpio_func_sel(gpio_num_t gpio_num, uint32_t func) +{ + GPIO_CHECK(GPIO_IS_VALID_GPIO(gpio_num), "GPIO number error", ESP_ERR_INVALID_ARG); + gpio_hal_func_sel(gpio_context.gpio_hal, gpio_num, func); + return ESP_OK; +}