1 // Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #include "sdkconfig.h" 18 #include <esp_types.h> 19 20 #include "soc/soc_caps.h" 21 #include "driver/gpio.h" 22 23 #if SOC_GPIO_SUPPORT_SLP_SWITCH 24 #if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL 25 /** 26 * @brief Emulate ESP32S2 behaviour to backup FUN_PU, FUN_PD information 27 * 28 * @note Need to be called before sleep. 29 * 30 * @return 31 * - ESP_OK Success 32 */ 33 esp_err_t gpio_sleep_pupd_config_apply(gpio_num_t gpio_num); 34 35 /** 36 * @brief Emulate ESP32S2 behaviour to restore FUN_PU, FUN_PD information 37 * 38 * @note Need to be called after sleep. 39 * 40 * @return 41 * - ESP_OK Success 42 */ 43 esp_err_t gpio_sleep_pupd_config_unapply(gpio_num_t gpio_num); 44 #endif 45 #endif 46