Merge branch 'feature/mcpwm_interrupt_priority_v5.0' into 'release/v5.0'

feat(MCPWM): Support set interrupt priority(v5.0)

See merge request espressif/esp-idf!25522
This commit is contained in:
morris
2023-09-19 10:41:58 +08:00
16 changed files with 239 additions and 9 deletions

View File

@@ -132,6 +132,8 @@ esp_err_t mcpwm_capture_timer_set_phase_on_sync(mcpwm_cap_timer_handle_t cap_tim
*/
typedef struct {
int gpio_num; /*!< GPIO used capturing input signal */
int intr_priority; /*!< MCPWM capture interrupt priority,
if set to 0, the driver will try to allocate an interrupt with a relative low priority (1,2,3) */
uint32_t prescale; /*!< Prescale of input signal, effective frequency = cap_input_clk/prescale */
struct {
uint32_t pos_edge: 1; /*!< Whether to capture on positive edge */

View File

@@ -19,6 +19,8 @@ extern "C" {
* @brief MCPWM comparator configuration
*/
typedef struct {
int intr_priority; /*!< MCPWM comparator interrupt priority,
if set to 0, the driver will try to allocate an interrupt with a relative low priority (1,2,3) */
struct {
uint32_t update_cmp_on_tez: 1; /*!< Whether to update compare value when timer count equals to zero (tez) */
uint32_t update_cmp_on_tep: 1; /*!< Whether to update compare value when timer count equals to peak (tep) */

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -20,8 +20,10 @@ extern "C" {
* @brief MCPWM GPIO fault configuration structure
*/
typedef struct {
int group_id; /*!< In which MCPWM group that the GPIO fault belongs to */
int gpio_num; /*!< GPIO used by the fault signal */
int group_id; /*!< In which MCPWM group that the GPIO fault belongs to */
int intr_priority; /*!< MCPWM GPIO fault interrupt priority,
if set to 0, the driver will try to allocate an interrupt with a relative low priority (1,2,3) */
int gpio_num; /*!< GPIO used by the fault signal */
struct {
uint32_t active_level: 1; /*!< On which level the fault signal is treated as active */
uint32_t io_loop_back: 1; /*!< For debug/test, the signal output from the GPIO will be fed to the input path as well */

View File

@@ -19,7 +19,9 @@ extern "C" {
* @brief MCPWM operator configuration
*/
typedef struct {
int group_id; /*!< Specify from which group to allocate the MCPWM operator */
int group_id; /*!< Specify from which group to allocate the MCPWM operator */
int intr_priority; /*!< MCPWM operator interrupt priority,
if set to 0, the driver will try to allocate an interrupt with a relative low priority (1,2,3) */
struct {
uint32_t update_gen_action_on_tez: 1; /*!< Whether to update generator action when timer counts to zero */
uint32_t update_gen_action_on_tep: 1; /*!< Whether to update generator action when timer counts to peak */

View File

@@ -35,6 +35,8 @@ typedef struct {
The step size of each count tick equals to (1 / resolution_hz) seconds */
mcpwm_timer_count_mode_t count_mode; /*!< Count mode */
uint32_t period_ticks; /*!< Number of count ticks within a period */
int intr_priority; /*!< MCPWM timer interrupt priority,
if set to 0, the driver will try to allocate an interrupt with a relative low priority (1,2,3) */
struct {
uint32_t update_period_on_empty: 1; /*!< Whether to update period when timer counts to zero */
uint32_t update_period_on_sync: 1; /*!< Whether to update period on sync event */