gpio.h 795 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include "sdkconfig.h"
  8. #include <esp_types.h>
  9. #include "soc/soc_caps.h"
  10. #include "driver/gpio.h"
  11. #if SOC_GPIO_SUPPORT_SLP_SWITCH
  12. #if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
  13. /**
  14. * @brief Emulate ESP32S2 behaviour to backup FUN_PU, FUN_PD information
  15. *
  16. * @note Need to be called before sleep.
  17. *
  18. * @return
  19. * - ESP_OK Success
  20. */
  21. esp_err_t gpio_sleep_pupd_config_apply(gpio_num_t gpio_num);
  22. /**
  23. * @brief Emulate ESP32S2 behaviour to restore FUN_PU, FUN_PD information
  24. *
  25. * @note Need to be called after sleep.
  26. *
  27. * @return
  28. * - ESP_OK Success
  29. */
  30. esp_err_t gpio_sleep_pupd_config_unapply(gpio_num_t gpio_num);
  31. #endif
  32. #endif