1 // Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 typedef enum { 18 MCPWM_TIMER_DIRECTION_UP, /*!< Counting direction: Increase */ 19 MCPWM_TIMER_DIRECTION_DOWN, /*!< Counting direction: Decrease */ 20 } mcpwm_timer_direction_t; 21 22 typedef enum { 23 MCPWM_TIMER_EVENT_ZERO, /*!< MCPWM timer counts to zero */ 24 MCPWM_TIMER_EVENT_PEAK, /*!< MCPWM timer counts to peak */ 25 } mcpwm_timer_event_t; 26 27 typedef enum { 28 MCPWM_TIMER_COUNT_MODE_PAUSE, /*!< MCPWM timer paused */ 29 MCPWM_TIMER_COUNT_MODE_UP, /*!< MCPWM timer counting up */ 30 MCPWM_TIMER_COUNT_MODE_DOWN, /*!< MCPWM timer counting down */ 31 MCPWM_TIMER_COUNT_MODE_UP_DOWN, /*!< MCPWM timer counting up and down */ 32 } mcpwm_timer_count_mode_t; 33 34 typedef enum { 35 MCPWM_TIMER_STOP_AT_ZERO, /*!< MCPWM timer stops when couting to zero */ 36 MCPWM_TIMER_STOP_AT_PEAK, /*!< MCPWM timer stops when counting to peak */ 37 MCPWM_TIMER_START_NO_STOP, /*!< MCPWM timer starts couting */ 38 MCPWM_TIMER_START_STOP_AT_ZERO, /*!< MCPWM timer starts counting and stops when couting to zero */ 39 MCPWM_TIMER_START_STOP_AT_PEAK, /*!< MCPWM timer starts counting and stops when counting to peak */ 40 } mcpwm_timer_execute_cmd_t; 41 42 typedef enum { 43 MCPWM_GEN_ACTION_KEEP, /*!< Generator action: Keep the same level */ 44 MCPWM_GEN_ACTION_LOW, /*!< Generator action: Force to low level */ 45 MCPWM_GEN_ACTION_HIGH, /*!< Generator action: Force to high level */ 46 MCPWM_GEN_ACTION_TOGGLE, /*!< Generator action: Toggle level */ 47 } mcpwm_generator_action_t; 48 49 typedef enum { 50 MCPWM_TRIP_TYPE_CBC, /*!< CBC trip type, shut down the operator cycle by cycle*/ 51 MCPWM_TRIP_TYPE_OST, /*!< OST trip type, shut down the operator in one shot */ 52 } mcpwm_trip_type_t; 53