Merge branch 'doc/fix_misleading_of_mcpwm_capture_enable_doc' into 'master'

driver/mcpwm: fix the misleading of mcpwm_capture_enable parameters

Closes IDFGH-3000

See merge request espressif/esp-idf!13497
This commit is contained in:
Michael (XIAO Xufeng)
2021-05-16 15:15:26 +00:00
4 changed files with 5 additions and 2 deletions

View File

@@ -568,6 +568,7 @@ esp_err_t mcpwm_fault_deinit(mcpwm_unit_t mcpwm_num, mcpwm_fault_signal_t fault_
* @param cap_edge set capture edge, BIT(0) - negative edge, BIT(1) - positive edge
* @param cap_sig capture pin, which needs to be enabled
* @param num_of_pulse count time between rising/falling edge between 2 *(pulses mentioned), counter uses APB_CLK
* [0~MCPWM_LL_MAX_PRESCALE] (MCPWM_LL_MAX_PRESCALE = 255 on ESP32);
*
* @return
* - ESP_OK Success

View File

@@ -49,6 +49,7 @@ static const char *MCPWM_TAG = "MCPWM";
#define MCPWM_DRIVER_INIT_ERROR "MCPWM DRIVER NOT INITIALIZED"
#define MCPWM_GROUP_NUM_ERROR "MCPWM GROUP NUM ERROR"
#define MCPWM_PRESCALE_ERROR "MCPWM PRESCALE ERROR"
#define MCPWM_TIMER_ERROR "MCPWM TIMER NUM ERROR"
#define MCPWM_CAPTURE_ERROR "MCPWM CAPTURE NUM ERROR"
#define MCPWM_PARAM_ADDR_ERROR "MCPWM PARAM ADDR ERROR"
@@ -531,6 +532,7 @@ esp_err_t mcpwm_capture_enable(mcpwm_unit_t mcpwm_num, mcpwm_capture_signal_t ca
uint32_t num_of_pulse)
{
MCPWM_CHECK(mcpwm_num < SOC_MCPWM_GROUPS, MCPWM_GROUP_NUM_ERROR, ESP_ERR_INVALID_ARG);
MCPWM_CHECK(num_of_pulse <= MCPWM_LL_MAX_PRESCALE, MCPWM_PRESCALE_ERROR, ESP_ERR_INVALID_ARG);
// enable MCPWM module incase user don't use `mcpwm_init` at all
periph_module_enable(mcpwm_periph_signals.groups[mcpwm_num].module);
mcpwm_hal_init_config_t init_config = {

View File

@@ -36,7 +36,7 @@ extern "C" {
/// Get the address of peripheral registers
#define MCPWM_LL_GET_HW(ID) (((ID)==0)? &MCPWM0: &MCPWM1)
#define MCPWM_LL_MAX_PRESCALE 255
/********************* Global *******************/
/**

View File

@@ -36,7 +36,7 @@ extern "C" {
/// Get the address of peripheral registers
#define MCPWM_LL_GET_HW(ID) (((ID)==0)? &MCPWM0: &MCPWM1)
#define MCPWM_LL_MAX_PRESCALE 255
/********************* Global *******************/
/**