1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #pragma once 8 #include <stdint.h> 9 #include "sdkconfig.h" 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /** 16 * @file sleep_gpio.h 17 * 18 * This file contains declarations of GPIO related functions in sleep modes. 19 */ 20 21 #if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL 22 23 /** 24 * @brief Save GPIO pull-up and pull-down configuration information in the wake-up state 25 * 26 * In light sleep mode, the pull-up and pull-down resistors of GPIO will cause 27 * leakage current when the system sleeps. In order to reduce the power 28 * consumption of system sleep, it needs to save the configuration information 29 * of all GPIO pull-up and pull-down resistors and disable the pull-up and 30 * pull-down resistors of GPIO before the system enters sleep. 31 */ 32 void gpio_sleep_mode_config_apply(void); 33 34 /** 35 * @brief Restore GPIO pull-up and pull-down configuration information in the wake-up state 36 * 37 * In light sleep mode, after the system wakes up, it needs to restore all GPIO 38 * pull-up and pull-down configurations before the last sleep. 39 */ 40 void gpio_sleep_mode_config_unapply(void); 41 42 #endif // CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL 43 44 /** 45 * @brief Call once in startup to disable the wakeup IO pins and release their holding state after waking up from Deep-sleep 46 */ 47 void esp_deep_sleep_wakeup_io_reset(void); 48 49 #ifdef __cplusplus 50 } 51 #endif 52