2021-05-23 19:50:04 -04:00
|
|
|
/*
|
2024-02-23 02:22:29 -05:00
|
|
|
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
2021-05-23 19:50:04 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2021-02-07 05:49:05 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
#include <esp_types.h>
|
|
|
|
|
|
|
|
#include "soc/soc_caps.h"
|
|
|
|
#include "driver/gpio.h"
|
|
|
|
|
2024-02-23 02:22:29 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-02-07 05:49:05 -05:00
|
|
|
#if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
|
|
|
|
/**
|
|
|
|
* @brief Emulate ESP32S2 behaviour to backup FUN_PU, FUN_PD information
|
|
|
|
*
|
|
|
|
* @note Need to be called before sleep.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK Success
|
2024-02-23 02:22:29 -05:00
|
|
|
* - ESP_ERR_INVALID_ARG GPIO number error
|
2021-02-07 05:49:05 -05:00
|
|
|
*/
|
|
|
|
esp_err_t gpio_sleep_pupd_config_apply(gpio_num_t gpio_num);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Emulate ESP32S2 behaviour to restore FUN_PU, FUN_PD information
|
|
|
|
*
|
|
|
|
* @note Need to be called after sleep.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK Success
|
2024-02-23 02:22:29 -05:00
|
|
|
* - ESP_ERR_INVALID_ARG GPIO number error
|
2021-02-07 05:49:05 -05:00
|
|
|
*/
|
|
|
|
esp_err_t gpio_sleep_pupd_config_unapply(gpio_num_t gpio_num);
|
|
|
|
#endif
|
2024-02-23 02:22:29 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Configure a pin to perform GPIO function or an IOMUX function
|
|
|
|
*
|
|
|
|
* @param gpio_num GPIO number.
|
|
|
|
* @param func Function to assign to the pin. see "io_mux_reg.h"
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK Success
|
|
|
|
* - ESP_ERR_INVALID_ARG GPIO number error
|
|
|
|
*/
|
|
|
|
esp_err_t gpio_func_sel(gpio_num_t gpio_num, uint32_t func);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|