@@ -105,21 +105,23 @@ typedef enum {
105105 * @brief Sleep wakeup cause
106106 */
107107typedef enum {
108- ESP_SLEEP_WAKEUP_UNDEFINED , //!< In case of deep sleep, reset was not caused by exit from deep sleep
109- ESP_SLEEP_WAKEUP_ALL , //!< Not a wakeup cause, used to disable all wakeup sources with esp_sleep_disable_wakeup_source
110- ESP_SLEEP_WAKEUP_EXT0 , //!< Wakeup caused by external signal using RTC_IO
111- ESP_SLEEP_WAKEUP_EXT1 , //!< Wakeup caused by external signal using RTC_CNTL
112- ESP_SLEEP_WAKEUP_TIMER , //!< Wakeup caused by timer
113- ESP_SLEEP_WAKEUP_TOUCHPAD , //!< Wakeup caused by touchpad
114- ESP_SLEEP_WAKEUP_ULP , //!< Wakeup caused by ULP program
115- ESP_SLEEP_WAKEUP_GPIO , //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3)
116- ESP_SLEEP_WAKEUP_UART , //!< Wakeup caused by UART (light sleep only)
108+ ESP_SLEEP_WAKEUP_UNDEFINED , //!< In case of deep sleep, reset was not caused by exit from deep sleep
109+ ESP_SLEEP_WAKEUP_ALL , //!< Not a wakeup cause, used to disable all wakeup sources with esp_sleep_disable_wakeup_source
110+ ESP_SLEEP_WAKEUP_EXT0 , //!< Wakeup caused by external signal using RTC_IO
111+ ESP_SLEEP_WAKEUP_EXT1 , //!< Wakeup caused by external signal using RTC_CNTL
112+ ESP_SLEEP_WAKEUP_TIMER , //!< Wakeup caused by timer
113+ ESP_SLEEP_WAKEUP_TOUCHPAD , //!< Wakeup caused by touchpad
114+ ESP_SLEEP_WAKEUP_ULP , //!< Wakeup caused by ULP program
115+ ESP_SLEEP_WAKEUP_GPIO , //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3)
116+ ESP_SLEEP_WAKEUP_UART , //!< Wakeup caused by UART0 (light sleep only)
117+ ESP_SLEEP_WAKEUP_UART1 , //!< Wakeup caused by UART1 (light sleep only)
118+ ESP_SLEEP_WAKEUP_UART2 , //!< Wakeup caused by UART2 (light sleep only)
117119 ESP_SLEEP_WAKEUP_WIFI , //!< Wakeup caused by WIFI (light sleep only)
118120 ESP_SLEEP_WAKEUP_COCPU , //!< Wakeup caused by COCPU int
119121 ESP_SLEEP_WAKEUP_COCPU_TRAP_TRIG , //!< Wakeup caused by COCPU crash
120- ESP_SLEEP_WAKEUP_BT , //!< Wakeup caused by BT (light sleep only)
121- ESP_SLEEP_WAKEUP_VAD , //!< Wakeup caused by VAD
122- ESP_SLEEP_WAKEUP_VBAT_UNDER_VOLT , //!< Wakeup caused by VDD_BAT under voltage.
122+ ESP_SLEEP_WAKEUP_BT , //!< Wakeup caused by BT (light sleep only)
123+ ESP_SLEEP_WAKEUP_VAD , //!< Wakeup caused by VAD
124+ ESP_SLEEP_WAKEUP_VBAT_UNDER_VOLT , //!< Wakeup caused by VDD_BAT under voltage.
123125} esp_sleep_source_t ;
124126
125127/**
@@ -691,10 +693,20 @@ void esp_deep_sleep_deregister_hook(esp_deep_sleep_cb_t old_dslp_cb);
691693/**
692694 * @brief Get the wakeup source which caused wakeup from sleep
693695 *
696+ * @note !!! This API will only return one wakeup source. If multiple wakeup sources
697+ * wake up at the same time, the wakeup source information may be lost.
698+ *
694699 * @return cause of wake up from last sleep (deep sleep or light sleep)
695700 */
696- esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause (void );
701+ esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause (void )
702+ __attribute__((deprecated ("use esp_sleep_get_wakeup_causes instead" )));
697703
704+ /**
705+ * @brief Get all wakeup sources bitmap which caused wakeup from sleep.
706+ *
707+ * @return The bitmap of the wakeup sources of the last wakeup from sleep. (deep sleep or light sleep)
708+ */
709+ uint32_t esp_sleep_get_wakeup_causes (void );
698710
699711/**
700712 * @brief Default stub to run on wake from deep sleep.
0 commit comments