Function esp_idf_sys::esp_deep_sleep_enable_gpio_wakeup
source · pub unsafe extern "C" fn esp_deep_sleep_enable_gpio_wakeup(
gpio_pin_mask: u64,
mode: esp_deepsleep_gpio_wake_up_mode_t,
) -> esp_err_t
Expand description
@brief Enable wakeup using specific gpio pins
This function enables an IO pin to wake up the chip from deep sleep.
@note This function does not modify pin configuration. The pins are configured inside esp_deep_sleep_start, immediately before entering sleep mode.
@note You don’t need to worry about pull-up or pull-down resistors before using this function because the ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS option is enabled by default. It will automatically set pull-up or pull-down resistors internally in esp_deep_sleep_start based on the wakeup mode. However, when using external pull-up or pull-down resistors, please be sure to disable the ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS option, as the combination of internal and external resistors may cause interference. BTW, when you use low level to wake up the chip, we strongly recommend you to add external resistors (pull-up).
@param gpio_pin_mask Bit mask of GPIO numbers which will cause wakeup. Only GPIOs which have RTC functionality (pads that powered by VDD3P3_RTC) can be used in this bit map. @param mode Select logic function used to determine wakeup condition: - ESP_GPIO_WAKEUP_GPIO_LOW: wake up when the gpio turn to low. - ESP_GPIO_WAKEUP_GPIO_HIGH: wake up when the gpio turn to high. @return - ESP_OK on success - ESP_ERR_INVALID_ARG if the mask contains any invalid deep sleep wakeup pin or wakeup mode is invalid