From 932d4d13f058d1e0a57b75cee4ebae5198f1d385 Mon Sep 17 00:00:00 2001 From: SalimTerryLi Date: Tue, 3 Aug 2021 19:21:19 +0800 Subject: [PATCH] MCPWM/sync: expose API for configuring timer sync removed example: mcpwm_basic_config Closes https://github.com/espressif/esp-idf/issues/5429 Co-authored-by: wubowen --- components/driver/include/driver/mcpwm.h | 97 +++++++++- components/driver/mcpwm.c | 84 ++++++++- components/driver/test/test_pwm.c | 113 +++++++++++- components/soc/esp32s3/include/soc/soc_caps.h | 1 + docs/en/api-reference/peripherals/mcpwm.rst | 50 +++++- .../mcpwm/mcpwm_basic_config/README.md | 35 ---- .../mcpwm_basic_config/main/CMakeLists.txt | 2 - .../main/mcpwm_basic_config_example.c | 168 ------------------ .../CMakeLists.txt | 2 +- .../Makefile | 2 +- .../mcpwm/mcpwm_sync_example/README.md | 74 ++++++++ .../mcpwm_sync_example/main/CMakeLists.txt | 2 + .../main/component.mk | 0 .../main/mcpwm_sync_example.c | 158 ++++++++++++++++ .../mcpwm_sync_example/readme_res/overall.png | Bin 0 -> 35797 bytes .../readme_res/sync_phase.png | Bin 0 -> 10151 bytes .../mcpwm_sync_example/readme_res/synced.png | Bin 0 -> 16120 bytes 17 files changed, 563 insertions(+), 225 deletions(-) delete mode 100644 examples/peripherals/mcpwm/mcpwm_basic_config/README.md delete mode 100644 examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt delete mode 100644 examples/peripherals/mcpwm/mcpwm_basic_config/main/mcpwm_basic_config_example.c rename examples/peripherals/mcpwm/{mcpwm_basic_config => mcpwm_sync_example}/CMakeLists.txt (88%) rename examples/peripherals/mcpwm/{mcpwm_basic_config => mcpwm_sync_example}/Makefile (81%) create mode 100644 examples/peripherals/mcpwm/mcpwm_sync_example/README.md create mode 100644 examples/peripherals/mcpwm/mcpwm_sync_example/main/CMakeLists.txt rename examples/peripherals/mcpwm/{mcpwm_basic_config => mcpwm_sync_example}/main/component.mk (100%) create mode 100644 examples/peripherals/mcpwm/mcpwm_sync_example/main/mcpwm_sync_example.c create mode 100644 examples/peripherals/mcpwm/mcpwm_sync_example/readme_res/overall.png create mode 100644 examples/peripherals/mcpwm/mcpwm_sync_example/readme_res/sync_phase.png create mode 100644 examples/peripherals/mcpwm/mcpwm_sync_example/readme_res/synced.png diff --git a/components/driver/include/driver/mcpwm.h b/components/driver/include/driver/mcpwm.h index 20b41ffd32..2a4e825f77 100644 --- a/components/driver/include/driver/mcpwm.h +++ b/components/driver/include/driver/mcpwm.h @@ -130,11 +130,30 @@ typedef enum { * @brief MCPWM select sync signal input */ typedef enum { - MCPWM_SELECT_SYNC0 = 4, /*!