gpio.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #pragma once
  15. #include "sdkconfig.h"
  16. #include <esp_types.h>
  17. #include "soc/soc_caps.h"
  18. #include "driver/gpio.h"
  19. #if SOC_GPIO_SUPPORT_SLP_SWITCH
  20. #if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
  21. /**
  22. * @brief Emulate ESP32S2 behaviour to backup FUN_PU, FUN_PD information
  23. *
  24. * @note Need to be called before sleep.
  25. *
  26. * @return
  27. * - ESP_OK Success
  28. */
  29. esp_err_t gpio_sleep_pupd_config_apply(gpio_num_t gpio_num);
  30. /**
  31. * @brief Emulate ESP32S2 behaviour to restore FUN_PU, FUN_PD information
  32. *
  33. * @note Need to be called after sleep.
  34. *
  35. * @return
  36. * - ESP_OK Success
  37. */
  38. esp_err_t gpio_sleep_pupd_config_unapply(gpio_num_t gpio_num);
  39. #endif
  40. #endif