From d4fe219c497ee30adc6153413bb98cbb5f61c152 Mon Sep 17 00:00:00 2001 From: morris Date: Thu, 7 Jan 2021 17:36:54 +0800 Subject: [PATCH 1/2] mcpwm: refactor driver --- components/driver/CMakeLists.txt | 1 + components/driver/include/driver/mcpwm.h | 70 +- components/driver/mcpwm.c | 514 +++--- components/hal/CMakeLists.txt | 1 + components/hal/esp32/include/hal/mcpwm_ll.h | 1488 +++++++++------- components/hal/esp32s3/include/hal/mcpwm_ll.h | 1490 ++++++++++------- components/hal/include/hal/mcpwm_hal.h | 297 +--- components/hal/include/hal/mcpwm_types.h | 87 +- components/hal/mcpwm_hal.c | 209 +-- .../soc/esp32s3/include/soc/mcpwm_struct.h | 5 +- docs/en/api-reference/peripherals/mcpwm.rst | 4 +- 11 files changed, 2119 insertions(+), 2047 deletions(-) diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index fcac19fe12..07a683a832 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -59,6 +59,7 @@ if(${target} STREQUAL "esp32s3") "gdma.c" "sdmmc_host.c" "sdmmc_transaction.c" + "mcpwm.c" "spi_slave_hd.c" "touch_sensor_common.c" ) diff --git a/components/driver/include/driver/mcpwm.h b/components/driver/include/driver/mcpwm.h index 8774941e48..7c41efc5db 100644 --- a/components/driver/include/driver/mcpwm.h +++ b/components/driver/include/driver/mcpwm.h @@ -8,7 +8,6 @@ #include "soc/soc_caps.h" #if SOC_MCPWM_SUPPORTED - #include "esp_err.h" #include "soc/soc.h" #include "driver/gpio.h" @@ -20,7 +19,6 @@ extern "C" { #endif - /** * @brief IO signals for the MCPWM * @@ -130,6 +128,15 @@ typedef enum { MCPWM_SELECT_F2, /*!