diff --git a/components/soc/esp32c5/include/soc/retention_periph_defs.h b/components/soc/esp32c5/include/soc/retention_periph_defs.h index 025dc2f29a..f738bc0132 100644 --- a/components/soc/esp32c5/include/soc/retention_periph_defs.h +++ b/components/soc/esp32c5/include/soc/retention_periph_defs.h @@ -57,6 +57,33 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 } periph_retention_module_t; +#define is_top_domain_module(m) \ + ( ((m) == SLEEP_RETENTION_MODULE_NULL) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_CLOCK_SYSTEM) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ADC) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2C0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_RMT0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2S0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ETM0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TEMP_SENSOR) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_PARLIO0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GPSPI2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_LEDC) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_PCNT0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_MCPWM0) ? true \ + : false) + #ifdef __cplusplus } #endif diff --git a/components/soc/esp32c6/include/soc/retention_periph_defs.h b/components/soc/esp32c6/include/soc/retention_periph_defs.h index 7a8a675cb9..c5cb8cb5c7 100644 --- a/components/soc/esp32c6/include/soc/retention_periph_defs.h +++ b/components/soc/esp32c6/include/soc/retention_periph_defs.h @@ -58,6 +58,34 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 } periph_retention_module_t; +#define is_top_domain_module(m) \ + ( ((m) == SLEEP_RETENTION_MODULE_NULL) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_CLOCK_SYSTEM) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ADC) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2C0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_RMT0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2S0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ETM0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TEMP_SENSOR) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TWAI0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TWAI1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_PARLIO0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GPSPI2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_LEDC) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_PCNT0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_MCPWM0) ? true \ + : false) + #ifdef __cplusplus } #endif diff --git a/components/soc/esp32c61/include/soc/retention_periph_defs.h b/components/soc/esp32c61/include/soc/retention_periph_defs.h index 3d81e28d20..1971185297 100644 --- a/components/soc/esp32c61/include/soc/retention_periph_defs.h +++ b/components/soc/esp32c61/include/soc/retention_periph_defs.h @@ -49,6 +49,24 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 } periph_retention_module_t; +#define is_top_domain_module(m) \ + ( ((m) == SLEEP_RETENTION_MODULE_NULL) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_CLOCK_SYSTEM) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2C0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ETM0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GPSPI2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_LEDC) ? true \ + : false) + #ifdef __cplusplus } #endif diff --git a/components/soc/esp32h2/include/soc/retention_periph_defs.h b/components/soc/esp32h2/include/soc/retention_periph_defs.h index 8dd7922a63..0b6162777f 100644 --- a/components/soc/esp32h2/include/soc/retention_periph_defs.h +++ b/components/soc/esp32h2/include/soc/retention_periph_defs.h @@ -56,6 +56,34 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 } periph_retention_module_t; +#define is_top_domain_module(m) \ + ( ((m) == SLEEP_RETENTION_MODULE_NULL) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_CLOCK_SYSTEM) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GDMA_CH2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ADC) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2C0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2C1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_RMT0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2S0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ETM0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TEMP_SENSOR) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TWAI0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_PARLIO0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GPSPI2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_LEDC) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_PCNT0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_MCPWM0) ? true \ + : false) + #ifdef __cplusplus } #endif diff --git a/components/soc/esp32p4/include/soc/retention_periph_defs.h b/components/soc/esp32p4/include/soc/retention_periph_defs.h index 072b8cee08..09a5c824df 100644 --- a/components/soc/esp32p4/include/soc/retention_periph_defs.h +++ b/components/soc/esp32p4/include/soc/retention_periph_defs.h @@ -58,6 +58,41 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 } periph_retention_module_t; +#define is_top_domain_module(m) \ + ( ((m) == SLEEP_RETENTION_MODULE_NULL) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_CLOCK_SYSTEM) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_AHB_DMA_CH0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_AHB_DMA_CH1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_AHB_DMA_CH2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_AXI_DMA_CH0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_AXI_DMA_CH1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_AXI_DMA_CH2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART3) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_UART4) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_RMT0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2S0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2S1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2S2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2C0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_I2C1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_ETM0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TWAI0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TWAI1) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_TWAI2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_PARLIO0) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GPSPI2) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_GPSPI3) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_LEDC) ? true \ + : false) + #ifdef __cplusplus } #endif