fix(esp_driver_gpio): manage lp_io module clock by driver

Closes https://github.com/espressif/esp-idf/issues/13683
This commit is contained in:
wuzhenghui
2024-05-20 20:18:25 +08:00
parent 78c40fd19a
commit cca222948a
14 changed files with 153 additions and 80 deletions
@@ -1,13 +1,17 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdbool.h>
#include "esp_err.h"
#include "soc/clk_tree_defs.h"
#include "soc/gpio_num.h"
#include "soc/soc_caps.h"
#include "soc/io_mux_reg.h"
#ifdef __cplusplus
extern "C" {
@@ -26,6 +30,20 @@ extern "C" {
*/
esp_err_t io_mux_set_clock_source(soc_module_clk_t clk_src);
#if SOC_LP_IO_CLOCK_IS_INDEPENDENT
typedef struct {
uint8_t rtc_io_enabled_cnt[MAX_RTC_GPIO_NUM];
uint32_t rtc_io_using_mask;
} rtc_io_status_t;
/**
* Enable/Disable LP_IO peripheral clock.
* @param gpio_num GPIO number
* @param enable true to enable the clock / false to disable the clock
*/
void io_mux_enable_lp_io_clock(gpio_num_t gpio_num, bool enable);
#endif
#ifdef __cplusplus
}
#endif