Function esp_idf_sys::esp_sleep_enable_ext0_wakeup
source ยท pub unsafe extern "C" fn esp_sleep_enable_ext0_wakeup(
gpio_num: gpio_num_t,
level: c_int,
) -> esp_err_t
Expand description
@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_deep_sleep_start/esp_light_sleep_start, immediately before entering sleep mode.
@note 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 with the RTC functionality can be used. For different SoCs, the related GPIOs are: - ESP32: 0, 2, 4, 12-15, 25-27, 32-39; - ESP32-S2: 0-21; - ESP32-S3: 0-21. @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