[][src]Function esp_idf_sys::esp_sleep_enable_ext0_wakeup

pub unsafe extern "C" fn esp_sleep_enable_ext0_wakeup(
    gpio_num: gpio_num_t,
    level: c_int
) -> esp_err_t

@brief Enable wakeup using a pin

This function uses external wakeup feature of RTC_IO peripheral. It will work only if RTC peripherals are kept on during sleep.

This feature can monitor any pin which is an RTC IO. Once the pin transitions into the state given by level argument, the chip will be woken up.

@note This function does not modify pin configuration. The pin is configured in esp_sleep_start, immediately before entering sleep mode.

@note In revisions 0 and 1 of the ESP32, ext0 wakeup source can not be used together with touch or ULP wakeup sources.

@param gpio_num GPIO number used as wakeup source. Only GPIOs which are have RTC functionality can be used: 0,2,4,12-15,25-27,32-39. @param level input level which will trigger wakeup (0=low, 1=high) @return - ESP_OK on success - ESP_ERR_INVALID_ARG if the selected GPIO is not an RTC GPIO, or the mode is invalid - ESP_ERR_INVALID_STATE if wakeup triggers conflict