mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
change(soc): rename peripheral powerdowned sleep wakeable IO soc_caps
rename SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK to SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_MASK rename SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT to SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_PIN_CNT rename SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP to SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
This commit is contained in:
@@ -41,7 +41,7 @@ typedef enum {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
typedef enum {
|
||||
ESP_GPIO_WAKEUP_GPIO_LOW = 0,
|
||||
ESP_GPIO_WAKEUP_GPIO_HIGH = 1
|
||||
@@ -452,7 +452,7 @@ __attribute__((deprecated("please use 'esp_sleep_enable_ext1_wakeup_io' and 'esp
|
||||
#endif // SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN
|
||||
#endif // SOC_PM_SUPPORT_EXT1_WAKEUP
|
||||
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
/**
|
||||
* @brief Enable wakeup using specific gpio pins
|
||||
*
|
||||
@@ -581,7 +581,7 @@ esp_err_t esp_sleep_disable_wifi_beacon_wakeup(void);
|
||||
*/
|
||||
uint64_t esp_sleep_get_ext1_wakeup_status(void);
|
||||
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
/**
|
||||
* @brief Get the bit mask of GPIOs which caused wakeup (gpio)
|
||||
*
|
||||
@@ -590,7 +590,7 @@ uint64_t esp_sleep_get_ext1_wakeup_status(void);
|
||||
* @return bit mask, if GPIOn caused wakeup, BIT(n) will be set
|
||||
*/
|
||||
uint64_t esp_sleep_get_gpio_wakeup_status(void);
|
||||
#endif //SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#endif //SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
|
||||
/**
|
||||
* @brief Configure power domain options for sleep mode
|
||||
|
||||
@@ -244,8 +244,8 @@ void esp_deep_sleep_wakeup_io_reset(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
uint32_t dl_io_mask = SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK;
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
uint32_t dl_io_mask = SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_MASK;
|
||||
gpio_hal_context_t gpio_hal = {
|
||||
.dev = GPIO_HAL_GET_HW(GPIO_PORT_0)
|
||||
};
|
||||
|
||||
@@ -273,9 +273,9 @@ typedef struct {
|
||||
uint32_t ext0_trigger_level : 1;
|
||||
uint32_t ext0_rtc_gpio_num : 5;
|
||||
#endif
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
uint32_t gpio_wakeup_mask : SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT; // Only RTC_GPIO supports wakeup deepsleep
|
||||
uint32_t gpio_trigger_mode : SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT;
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
uint32_t gpio_wakeup_mask : SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_PIN_CNT;
|
||||
uint32_t gpio_trigger_mode : SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_PIN_CNT;
|
||||
#endif
|
||||
uint32_t sleep_time_adjustment;
|
||||
uint32_t ccount_ticks_record;
|
||||
@@ -364,7 +364,7 @@ static void touch_wakeup_prepare(void);
|
||||
#if SOC_VBAT_SUPPORTED
|
||||
static void vbat_under_volt_wakeup_prepare(void);
|
||||
#endif
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
static void gpio_deep_sleep_wakeup_prepare(void);
|
||||
#endif
|
||||
|
||||
@@ -987,7 +987,7 @@ static esp_err_t SLEEP_FN_ATTR esp_sleep_start(uint32_t sleep_flags, uint32_t cl
|
||||
// for !(s_config.wakeup_triggers & RTC_EXT1_TRIG_EN), ext1 wakeup will be turned off in hardware in the real call to sleep
|
||||
#endif
|
||||
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
if (deep_sleep && (s_config.wakeup_triggers & RTC_GPIO_TRIG_EN)) {
|
||||
gpio_deep_sleep_wakeup_prepare();
|
||||
}
|
||||
@@ -1841,7 +1841,7 @@ bool esp_sleep_is_valid_wakeup_gpio(gpio_num_t gpio_num)
|
||||
{
|
||||
#if SOC_RTCIO_PIN_COUNT > 0
|
||||
return RTC_GPIO_IS_VALID_GPIO(gpio_num);
|
||||
#elif SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#elif SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
return GPIO_IS_DEEP_SLEEP_WAKEUP_VALID_GPIO(gpio_num);
|
||||
#else
|
||||
return false;
|
||||
@@ -2069,7 +2069,7 @@ uint64_t esp_sleep_get_ext1_wakeup_status(void)
|
||||
|
||||
#endif // SOC_PM_SUPPORT_EXT1_WAKEUP && SOC_RTCIO_PIN_COUNT > 0
|
||||
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
uint64_t esp_sleep_get_gpio_wakeup_status(void)
|
||||
{
|
||||
if (!(esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_GPIO))) {
|
||||
@@ -2080,7 +2080,7 @@ uint64_t esp_sleep_get_gpio_wakeup_status(void)
|
||||
|
||||
static void gpio_deep_sleep_wakeup_prepare(void)
|
||||
{
|
||||
uint32_t valid_wake_io_mask = SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK;
|
||||
uint32_t valid_wake_io_mask = SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_MASK;
|
||||
for (gpio_num_t gpio_idx = __builtin_ctz(valid_wake_io_mask); valid_wake_io_mask >> gpio_idx; gpio_idx++) {
|
||||
if ((s_config.gpio_wakeup_mask & BIT64(gpio_idx)) == 0) {
|
||||
continue;
|
||||
@@ -2114,7 +2114,7 @@ esp_err_t esp_deep_sleep_enable_gpio_wakeup(uint64_t gpio_pin_mask, esp_deepslee
|
||||
gpio_int_type_t intr_type = ((mode == ESP_GPIO_WAKEUP_GPIO_LOW) ? GPIO_INTR_LOW_LEVEL : GPIO_INTR_HIGH_LEVEL);
|
||||
esp_err_t err = ESP_OK;
|
||||
|
||||
uint64_t invalid_io_mask = gpio_pin_mask & ~SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK;
|
||||
uint64_t invalid_io_mask = gpio_pin_mask & ~SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_MASK;
|
||||
if (invalid_io_mask != 0) {
|
||||
for (gpio_num_t gpio_idx = __builtin_ctzll(invalid_io_mask); invalid_io_mask >> gpio_idx; gpio_idx++) {
|
||||
if (invalid_io_mask & BIT64(gpio_idx)) {
|
||||
@@ -2141,7 +2141,7 @@ esp_err_t esp_deep_sleep_enable_gpio_wakeup(uint64_t gpio_pin_mask, esp_deepslee
|
||||
return err;
|
||||
}
|
||||
|
||||
#endif //SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
#endif //SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
|
||||
|
||||
esp_err_t esp_sleep_enable_gpio_wakeup(void)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -142,7 +142,7 @@ static void register_ext1_wakeup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
static struct {
|
||||
struct arg_int *pin;
|
||||
struct arg_int *level;
|
||||
@@ -383,7 +383,7 @@ static int process_get_wakeup_cause(int argc, char **argv)
|
||||
|
||||
if (causes & BIT(ESP_SLEEP_WAKEUP_GPIO)) {
|
||||
if (esp_reset_reason() == ESP_RST_DEEPSLEEP) {
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
uint64_t wakeup_pin_mask = esp_sleep_get_gpio_wakeup_status();
|
||||
if (wakeup_pin_mask != 0) {
|
||||
int pin = __builtin_ffsll(wakeup_pin_mask) - 1;
|
||||
@@ -440,7 +440,7 @@ void register_io_wakeup_cmd(void)
|
||||
#endif
|
||||
register_gpio_control();
|
||||
register_gpio_wakeup();
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
#if SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP
|
||||
register_rtcio_wakeup();
|
||||
#endif
|
||||
register_get_wakeup_cause();
|
||||
|
||||
Reference in New Issue
Block a user