Skip to content

Commit 4cb0c09

Browse files
committed
Merge branch 'feat/mcpwm_sleep_retention_support_p4' into 'master'
feat(mcpwm): support mcpwm sleep retention on p4 Closes IDF-9928 See merge request espressif/esp-idf!35059
2 parents 44ec704 + a1b4219 commit 4cb0c09

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

components/esp_driver_mcpwm/test_apps/mcpwm/main/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ if(CONFIG_SOC_ETM_SUPPORTED AND CONFIG_SOC_MCPWM_SUPPORT_ETM)
1717
list(APPEND srcs "test_mcpwm_etm.c")
1818
endif()
1919

20-
# TODO: IDF-9928 support ESP32P4
21-
if(CONFIG_SOC_LIGHT_SLEEP_SUPPORTED AND CONFIG_PM_ENABLE AND NOT CONFIG_IDF_TARGET_ESP32P4)
20+
if(CONFIG_SOC_LIGHT_SLEEP_SUPPORTED AND CONFIG_PM_ENABLE)
2221
list(APPEND srcs "test_mcpwm_sleep.c")
2322
endif()
2423

components/esp_driver_pcnt/test_apps/pulse_cnt/main/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ if(CONFIG_PCNT_ISR_IRAM_SAFE)
66
list(APPEND srcs "test_pulse_cnt_iram.c")
77
endif()
88

9-
# TODO: IDF-9907 support ESP32P4
10-
if(CONFIG_SOC_LIGHT_SLEEP_SUPPORTED AND CONFIG_PM_ENABLE AND NOT CONFIG_IDF_TARGET_ESP32P4)
9+
if(CONFIG_SOC_LIGHT_SLEEP_SUPPORTED AND CONFIG_PM_ENABLE)
1110
list(APPEND srcs "test_pulse_cnt_sleep.c")
1211
endif()
1312

components/soc/esp32p4/include/soc/Kconfig.soc_caps.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,10 @@ config SOC_PCNT_SUPPORT_CLEAR_SIGNAL
11311131
bool
11321132
default y
11331133

1134+
config SOC_PCNT_SUPPORT_SLEEP_RETENTION
1135+
bool
1136+
default y
1137+
11341138
config SOC_RMT_GROUPS
11351139
int
11361140
default 1
@@ -1283,6 +1287,10 @@ config SOC_MCPWM_CAPTURE_CLK_FROM_GROUP
12831287
bool
12841288
default y
12851289

1290+
config SOC_MCPWM_SUPPORT_SLEEP_RETENTION
1291+
bool
1292+
default y
1293+
12861294
config SOC_USB_OTG_PERIPH_NUM
12871295
int
12881296
default 2

components/soc/esp32p4/include/soc/retention_periph_defs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ typedef enum periph_retention_module {
5454
SLEEP_RETENTION_MODULE_GPSPI2 = 29,
5555
SLEEP_RETENTION_MODULE_GPSPI3 = 30,
5656
SLEEP_RETENTION_MODULE_LEDC = 31,
57+
SLEEP_RETENTION_MODULE_MCPWM0 = 32,
58+
SLEEP_RETENTION_MODULE_MCPWM1 = 33,
59+
SLEEP_RETENTION_MODULE_PCNT0 = 34,
5760

5861
SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1
5962
} periph_retention_module_t;
@@ -91,6 +94,9 @@ typedef enum periph_retention_module {
9194
: ((m) == SLEEP_RETENTION_MODULE_GPSPI2) ? true \
9295
: ((m) == SLEEP_RETENTION_MODULE_GPSPI3) ? true \
9396
: ((m) == SLEEP_RETENTION_MODULE_LEDC) ? true \
97+
: ((m) == SLEEP_RETENTION_MODULE_MCPWM0) ? true \
98+
: ((m) == SLEEP_RETENTION_MODULE_MCPWM1) ? true \
99+
: ((m) == SLEEP_RETENTION_MODULE_PCNT0) ? true \
94100
: false)
95101

96102
#ifdef __cplusplus

components/soc/esp32p4/include/soc/soc_caps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
#define SOC_PCNT_THRES_POINT_PER_UNIT 2
411411
#define SOC_PCNT_SUPPORT_RUNTIME_THRES_UPDATE 1
412412
#define SOC_PCNT_SUPPORT_CLEAR_SIGNAL 1 /*!< Support clear signal input */
413-
// #define SOC_PCNT_SUPPORT_SLEEP_RETENTION 1 // TODO: IDF-9907 Waiting for expansion of module ID /*!< The sleep retention feature can help back up PCNT registers before sleep */
413+
#define SOC_PCNT_SUPPORT_SLEEP_RETENTION 1 /*!< The sleep retention feature can help back up PCNT registers before sleep */
414414

415415
/*--------------------------- RMT CAPS ---------------------------------------*/
416416
#define SOC_RMT_GROUPS 1U /*!< One RMT group */
@@ -456,7 +456,7 @@
456456
#define SOC_MCPWM_SUPPORT_ETM (1) ///< Support ETM (Event Task Matrix)
457457
#define SOC_MCPWM_SUPPORT_EVENT_COMPARATOR (1) ///< Support event comparator (based on ETM)
458458
#define SOC_MCPWM_CAPTURE_CLK_FROM_GROUP (1) ///< Capture timer shares clock with other PWM timers
459-
// #define SOC_MCPWM_SUPPORT_SLEEP_RETENTION (1) // TODO: IDF-9928 Waiting for expansion of module ID ///< Support back up registers before sleep
459+
#define SOC_MCPWM_SUPPORT_SLEEP_RETENTION (1) ///< Support back up registers before sleep
460460

461461
/*-------------------------- USB CAPS ----------------------------------------*/
462462
// USB Serial JTAG Caps

components/soc/esp32p4/mcpwm_periph.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "soc/soc.h"
88
#include "soc/mcpwm_periph.h"
9+
#include "soc/mcpwm_reg.h"
910
#include "soc/gpio_sig_map.h"
1011

1112
const mcpwm_signal_conn_t mcpwm_periph_signals = {

0 commit comments

Comments
 (0)