This module contains APIs to program and use the EPWM module.
Files | |
file | epwm/v0/epwm.h |
This file contains declarations of CSL APIs corresponding to the ePWM module. This also contains necessary structure, enum and macro definitions and APIs are consolidated to provide more functional APIs. | |
Data Structures | |
struct | EPWM_TimebaseCfg |
Structure holding the TimeBase sub-module configuration parameters. More... | |
struct | EPWM_CounterCmpCfg |
Structure holding the Counter Comparator values. More... | |
struct | EPWM_AqActionCfg |
Structure holding the Action Qualifier actions to be taken on the PWM output at the specific events. More... | |
struct | EPWM_DeadbandCfg |
Structure holding the dead band generation sub-module configuration parameters. More... | |
struct | EPWM_ChopperCfg |
Structure holding the configuration parameters of Chopper sub-module. More... | |
struct | EPWM_TripzoneCfg |
Structure holding the trip-zone sub-module configuration parameters. More... | |
struct | EPWM_EtCfg |
Structure holding the Event Trigger Sub-Module configuration parameters. More... | |
Functions | |
void | EPWM_tbTimebaseClkCfg (uint32_t baseAddr, uint32_t tbClk, uint32_t moduleClk) |
This API configures the clock divider of the Time base module. More... | |
void | EPWM_tbPwmFreqCfg (uint32_t baseAddr, uint32_t tbClk, uint32_t pwmFreq, uint32_t counterDir, uint32_t enableShadowWrite) |
This API configures the PWM Time base counter Frequency/Period. More... | |
void | EPWM_tbSyncEnable (uint32_t baseAddr, uint32_t tbPhsValue, uint32_t counterDir) |
This API enables the synchronization of time base sub-module and also configures the phase count value to be loaded after sync event, counter direction after sync event. More... | |
void | EPWM_tbSyncDisable (uint32_t baseAddr) |
This API disables the synchronization. Even if sync-in event occurs the count value will not be reloaded. More... | |
void | EPWM_tbSetSyncOutMode (uint32_t baseAddr, uint32_t syncOutMode) |
This API selects the source of the synchronization output signal. It determines on which of the supported events sync-out has to be generated. More... | |
void | EPWM_tbTriggerSwSync (uint32_t baseAddr) |
This API generates software triggered sync pulse. More... | |
void | EPWM_tbWriteTbCount (uint32_t baseAddr, uint32_t tbCount) |
This API loads the Time base counter. The new value is taken immediately. More... | |
uint16_t | EPWM_tbReadTbCount (uint32_t baseAddr) |
This API gets the Time base counter current value. The count operation is not affected by the read. More... | |
uint16_t | EPWM_tbGetStatus (uint32_t baseAddr, uint32_t tbStatusMask) |
This API gets the Time Base status as indicated by the tbStatusMask parameter. More... | |
void | EPWM_tbStatusClear (uint32_t baseAddr, uint32_t tbStatusClrMask) |
This API clears the Time base status bits indicated by the tbStatusClrMask parameter. More... | |
void | EPWM_tbSetEmulationMode (uint32_t baseAddr, uint32_t mode) |
This API configures emulation mode. This setting determines the behaviour of Timebase counter during emulation (debugging). More... | |
uint32_t | EPWM_counterComparatorCfg (uint32_t baseAddr, uint32_t cmpType, uint32_t cmpVal, uint32_t enableShadowWrite, uint32_t shadowToActiveLoadTrigger, uint32_t overwriteShadow) |
This API configures the counter comparator and loads the comparator value. When Counter comparator value equals the counter value, then an event is generated both in the up direction and down direction. More... | |
void | EPWM_aqActionOnOutputCfg (uint32_t baseAddr, uint32_t pwmOutputCh, const EPWM_AqActionCfg *pCfg) |
This API configures the action to be taken on output by the Action qualifier module upon receiving the events. This will determine the output waveform. More... | |
void | EPWM_aqSwTriggerOneTimeAction (uint32_t baseAddr, uint32_t pwmOutputCh, uint32_t swTrigAction) |
This API triggers the SW forced single event on the PWM output. More... | |
void | EPWM_aqSwTriggerContAction (uint32_t baseAddr, uint32_t pwmOutputCh, uint32_t swTrigAction, uint32_t activeRegReloadMode) |
This API forces output value continuously on PWM output channel. The output can be forced to low or high. More... | |
void | EPWM_deadbandCfg (uint32_t baseAddr, const EPWM_DeadbandCfg *pCfg) |
This API performs the configuration of the dead band sub-module. This API configures the input source, output mode, polarity, rising and falling edge delays. More... | |
void | EPWM_deadbandBypass (uint32_t baseAddr) |
This API bypasses the Dead-band sub-module. More... | |
void | EPWM_chopperCfg (uint32_t baseAddr, const EPWM_ChopperCfg *pCfg) |
This API performs the configuration of the chopper sub-module. This API configures chopping clock duty cycle, chopping clock frequency and pulse width of first pulse of chopping clock. More... | |
void | EPWM_chopperEnable (uint32_t baseAddr, uint32_t enableChopper) |
This API controls the enabling or disabling of chopper sub-module. More... | |
void | EPWM_tzTriggerTripAction (uint32_t baseAddr, uint32_t tripAction, uint32_t pwmOutputCh) |
This API configures the o/p on PWM channel when a trip event is recognized. The output can be set to high or low or high impedance. More... | |
void | EPWM_tzTripEventEnable (uint32_t baseAddr, uint32_t tzEventType, uint32_t pinNum) |
This API enables the trip event. More... | |
void | EPWM_tzTripEventDisable (uint32_t baseAddr, uint32_t tzEventType, uint32_t pinNum) |
This API disable the trip event. The disabled trip events will be ignored. More... | |
void | EPWM_tzIntrEnable (uint32_t baseAddr, uint32_t tzEventType) |
This API enables the trip interrupt. When trip event occurs the sub-module can be configured to interrupt CPU. More... | |
void | EPWM_tzIntrDisable (uint32_t baseAddr, uint32_t tzEventType) |
This API disables the trip interrupt. More... | |
uint16_t | EPWM_tzEventStatus (uint32_t baseAddr, uint32_t eventMask) |
This API returns the selected trip zone event status. More... | |
void | EPWM_tzEventStatusClear (uint32_t baseAddr, uint32_t eventMask) |
This API clears the selected trip zone event status. More... | |
void | EPWM_tzTriggerSwEvent (uint32_t baseAddr, uint32_t tzEventType) |
This API enables to generate Software forced trip condition. More... | |
void | EPWM_etIntrCfg (uint32_t baseAddr, uint32_t intrEvtSrc, uint32_t intrPrd) |
This API configures the Event Trigger sub-module. This API configures the interrupt source and interrupt period. More... | |
void | EPWM_etIntrEnable (uint32_t baseAddr) |
This API enables the ePWM Event interrupt. More... | |
void | EPWM_etIntrDisable (uint32_t baseAddr) |
This API disables the ePWM Event interrupt. More... | |
uint16_t | EPWM_etIntrStatus (uint32_t baseAddr) |
This API returns the ePWM event interrupt status. More... | |
void | EPWM_etIntrClear (uint32_t baseAddr) |
This API clears the interrupt. This will clear the interrupt flag bit and enable further interrupts pulses to be generated. More... | |
void | EPWM_etIntrTrigger (uint32_t baseAddr) |
This API forces interrupt to be generated. This API is used for testing purpose. More... | |
uint16_t | EPWM_etGetEventCount (uint32_t baseAddr) |
This API returns the number of events occurred. More... | |
Macros | |
#define | EPWM_ETFLG_INT_MASK (PWMSS_EPWM_ETFLG_INT_MASK) |
Mask used to check interrupt status. More... | |
EPWM Output Channel | |
typedef uint32_t | EPWM_OutputCh_t |
Number of supported EPWM outputs in a single epwm channel. More... | |
#define | EPWM_OUTPUT_CH_MIN (0U) |
#define | EPWM_OUTPUT_CH_A (EPWM_OUTPUT_CH_MIN) |
#define | EPWM_OUTPUT_CH_B (1U) |
#define | EPWM_OUTPUT_CH_MAX (EPWM_OUTPUT_CH_B) |
EPWM Tb Counter Direction | |
typedef uint32_t | EPWM_TbCounterDir_t |
Types of Time base counter direction modes. More... | |
#define | EPWM_TB_COUNTER_DIR_UP (PWMSS_EPWM_TBCTL_CTRMODE_UP_COUNT) |
#define | EPWM_TB_COUNTER_DIR_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_DOWN_COUNT) |
#define | EPWM_TB_COUNTER_DIR_UP_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_UP_DOWN_COUNT) |
#define | EPWM_TB_COUNTER_DIR_STOP (PWMSS_EPWM_TBCTL_CTRMODE_STOP_FREEZE) |
EPWM Shadow register Control | |
typedef uint32_t | EPWM_ShadowRegCtrl_t |
Shadow register enable or disable control. More... | |
#define | EPWM_SHADOW_REG_CTRL_ENABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_FROM_SHADOW) |
#define | EPWM_SHADOW_REG_CTRL_DISABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_IMMEDIATELY) |
EPWM Counter directions after sync event | |
typedef uint32_t | EPWM_TbCntDirAftSync_t |
Counter directions after sync event. More... | |
#define | EPWM_TB_CNT_DIR_AFT_SYNC_DOWN (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_DOWN) |
#define | EPWM_TB_CNT_DIR_AFT_SYNC_UP (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_UP) |
EPWM Source of Synchronization output signal | |
typedef uint32_t | EPWM_TbSyncOutEvt_t |
Source of Synchronization output signal. More... | |
#define | EPWM_TB_SYNC_OUT_EVT_SYNCIN (PWMSS_EPWM_TBCTL_SYNCOSEL_EPWMXSYNC) |
#define | EPWM_TB_SYNC_OUT_EVT_CNT_EQ_ZERO (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_0) |
#define | EPWM_TB_SYNC_OUT_EVT_CNT_EQ_CMP_B (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_CPMB) |
#define | EPWM_TB_SYNC_OUT_EVT_DISABLE (PWMSS_EPWM_TBCTL_SYNCOSEL_DISABLE_EPWMXSYNCO) |
EPWM Flags to get the different types of time base status | |
typedef uint32_t | EPWM_TbSts_t |
Flags to get the different types of time base status. More... | |
#define | EPWM_TB_STS_CTR_MAX (PWMSS_EPWM_TBSTS_CTRMAX_MASK) |
#define | EPWM_TB_STS_SYNCI (PWMSS_EPWM_TBSTS_SYNCI_MASK) |
#define | EPWM_TB_STS_CTR_DIR (PWMSS_EPWM_TBSTS_CTRDIR_MASK) |
EPWM Emulation Mode | |
typedef uint32_t | EPWM_TbEmuMode_t |
Emulation Mode. This selects the behaviour of the ePWM time-base counter during emulation events. More... | |
#define | EPWM_TB_EMU_MODE_STP_AFT_NEXT_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_NEXT_CTR) |
#define | EPWM_TB_EMU_MODE_STP_AFT_COMPLETE_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_CYCLE) |
#define | EPWM_TB_EMU_MODE_FREE_RUN (PWMSS_EPWM_TBCTL_FREE_SOFT_RUN2) |
EPWM Comparator type | |
typedef uint32_t | EPWM_CcCmp_t |
#define | EPWM_CC_CMP_MIN (0U) |
#define | EPWM_CC_CMP_A (EPWM_CC_CMP_MIN) |
#define | EPWM_CC_CMP_B (1U) |
#define | EPWM_CC_CMP_MAX (CSL_EPWM_CC_CMP_B) |
EPWM Counter-Comparator registers(A and B) load mode | |
typedef uint32_t | EPWM_CcCmpLoadMode_t |
Counter-Comparator registers(A and B) load mode flags from shadow register. More... | |
#define | EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0) |
#define | EPWM_CC_CMP_LOAD_MODE_CNT_EQ_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_PRD) |
#define | EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO_OR_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0_OR_PRD) |
#define | EPWM_CC_CMP_LOAD_MODE_NO_LOAD (PWMSS_EPWM_CMPCTL_LOADAMODE_FREEZE) |
EPWM Actions | |
typedef uint32_t | EPWM_AqAction_t |
Types of Actions that Action Qualifier can take on the Output when the supported counter compare event occurs. More... | |
#define | EPWM_AQ_ACTION_DONOTHING (PWMSS_EPWM_AQCTLA_ZRO_DISABLED) |
#define | EPWM_AQ_ACTION_LOW (PWMSS_EPWM_AQCTLA_ZRO_CLEAR) |
#define | EPWM_AQ_ACTION_HIGH (PWMSS_EPWM_AQCTLA_ZRO_SET) |
#define | EPQM_AQ_ACTION_TOLLGE (PWMSS_EPWM_AQCTLA_ZRO_TOGGLE) |
#define | EPWM_AQ_ACTION_TOLLGE (CSL_EPQM_AQ_ACTION_TOLLGE) |
EPWM output actions | |
typedef uint32_t | EPWM_AqSwTrigOtAction_t |
Actions to be taken on the output, when Software triggered one time events will occur. More... | |
#define | EPWM_AQ_SW_TRIG_OT_ACTION_DONOTHING (PWMSS_EPWM_AQSFRC_ACTSFA_DISABLED) |
#define | EPWM_AQ_SW_TRIG_OT_ACTION_LOW (PWMSS_EPWM_AQSFRC_ACTSFA_CLEAR) |
#define | EPWM_AQ_SW_TRIG_OT_ACTION_HIGH (PWMSS_EPWM_AQSFRC_ACTSFA_SET) |
#define | EPWM_AQ_SW_TRIG_OT_ACTION_TOGGLE (PWMSS_EPWM_AQSFRC_ACTSFA_TOGGLE) |
EPWM Continuous software forced actions | |
typedef uint32_t | EPWM_AqSwTrigContAction_t |
Types of Continuous software forced actions on output. More... | |
#define | EPWM_AQ_SW_TRIG_CONT_ACTION_NOEFFECT (PWMSS_EPWM_AQCSFRC_CSFA_DISABLED) |
#define | EPWM_AQ_SW_TRIG_CONT_ACTION_LOW (PWMSS_EPWM_AQCSFRC_CSFA_LOW_OUTPUT) |
#define | EPWM_AQ_SW_TRIG_CONT_ACTION_HIGH (PWMSS_EPWM_AQCSFRC_CSFA_HIGH_OUTPUT) |
#define | EPWM_AQ_SW_TRIG_CONT_ACTION_SW_DISBALED (PWMSS_EPWM_AQCSFRC_CSFA_NO_EFFECT) |
EPWM Software Force Active Register Reload | |
typedef uint32_t | EPWM_AqCsfrcRegReload_t |
Action Qualifier Software Force Active Register Reload From Shadow Options. More... | |
#define | EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0) |
#define | EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_PERIOD) |
#define | EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO_OR_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0_OR_PERIOD) |
#define | EPWM_AQ_CSFRC_REG_RELOAD_IMMEDIATE (PWMSS_EPWM_AQSFRC_RLDCSF_IMMEDIATE) |
EPWM Dead Band Input Mode Control | |
typedef uint32_t | EPWM_DbInMode_t |
Dead Band Input Mode Control. This allows you to select the input source to the falling-edge and rising-edge delay. More... | |
#define | EPWM_DB_IN_MODE_A_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_AFED) |
#define | EPWM_DB_IN_MODE_B_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_AFED) |
#define | EPWM_DB_IN_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_BFED) |
#define | EPWM_DB_IN_MODE_B_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_BFED) |
EPWM Polarity Select Control | |
typedef uint32_t | EPWM_DbPolSel_t |
Polarity Select Control. This allows you to selectively invert one of the delayed signals before it is sent out of the dead-band sub-module. More... | |
#define | EPWM_DB_POL_SEL_ACTV_HIGH (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH) |
#define | EPWM_DB_POL_SEL_ACTV_LOW_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW_COMPLEMENTARY) |
#define | EPWM_DB_POL_SEL_ACTV_HIGH_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH_COMPLEMENTARY) |
#define | EPWM_DB_POL_SEL_ACTV_LOW (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW) |
EPWM Dead-band Output Mode Control | |
typedef uint32_t | EPWM_DbOutMode_t |
Dead-band Output Mode Control. This allows you to selectively enable or bypass the dead-band generation for the falling-edge and rising-edge delay. More... | |
#define | EPWM_DB_OUT_MODE_BYPASS (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLED) |
#define | EPWM_DB_OUT_MODE_NO_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_RISING_EDGE) |
#define | EPWM_DB_OUT_MODE_A_RED_NO_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_FALLING_EDGE) |
#define | EPWM_DB_OUT_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_ENABLED) |
EPWM Chopping Clock Duty Cycle | |
typedef uint32_t | EPWM_ChpDutyCycle_t |
Chopping Clock Duty Cycle values. More... | |
#define | EPWM_CHP_DUTY_CYCLE_PERC_12PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_12_5) |
#define | EPWM_CHP_DUTY_CYCLE_PERC_25 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_25) |
#define | EPWM_CHP_DUTY_CYCLE_PERC_37PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_37_5) |
#define | EPWM_CHP_DUTY_CYCLE_PERC_50_PER (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_50) |
#define | EPWM_CHP_DUTY_CYCLE_PERC_62PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_62_5) |
#define | EPWM_CHP_DUTY_CYCLE_PERC_75 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_75) |
#define | EPWM_CHP_DUTY_CYCLE_PERC_87PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_87_5) |
EPWM Chopping Clock Frequency | |
typedef uint32_t | EPWM_ChpClkFreq_t |
Chopping Clock Frequency values . More... | |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_1 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_1) |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_2 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_2) |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_3 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_3) |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_4 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_4) |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_5 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_5) |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_6 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_6) |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_7 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_7) |
#define | EPWM_CHP_CLK_FREQ_DIV_BY_8 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_8) |
EPWM One-Shot Pulse Width | |
typedef uint32_t | EPWM_ChpOshtWidth_t |
One-Shot Pulse Width values. More... | |
#define | EPWM_CHP_OSHT_WIDTH_MIN (0U) |
#define | EPWM_CHP_OSHT_WIDTH_1XSYSOUT_BY_8 (CSL_EPWM_CHP_OSHT_WIDTH_MIN) |
#define | EPWM_CHP_OSHT_WIDTH_2XSYSOUT_BY_8 (1U) |
#define | EPWM_CHP_OSHT_WIDTH_3XSYSOUT_BY_8 (2U) |
#define | EPWM_CHP_OSHT_WIDTH_4XSYSOUT_BY_8 (3U) |
#define | EPWM_CHP_OSHT_WIDTH_5XSYSOUT_BY_8 (4U) |
#define | EPWM_CHP_OSHT_WIDTH_6XSYSOUT_BY_8 (5U) |
#define | EPWM_CHP_OSHT_WIDTH_7XSYSOUT_BY_8 (6U) |
#define | EPWM_CHP_OSHT_WIDTH_8XSYSOUT_BY_8 (7U) |
#define | EPWM_CHP_OSHT_WIDTH_9XSYSOUT_BY_8 (8U) |
#define | EPWM_CHP_OSHT_WIDTH_10XSYSOUT_BY_8 (9U) |
#define | EPWM_CHP_OSHT_WIDTH_11XSYSOUT_BY_8 (10U) |
#define | EPWM_CHP_OSHT_WIDTH_12XSYSOUT_BY_8 (11U) |
#define | EPWM_CHP_OSHT_WIDTH_13XSYSOUT_BY_8 (12U) |
#define | EPWM_CHP_OSHT_WIDTH_14XSYSOUT_BY_8 (13U) |
#define | EPWM_CHP_OSHT_WIDTH_15XSYSOUT_BY_8 (14U) |
#define | EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8 (15U) |
#define | EPWM_CHP_OSHT_WIDTH_MAX (CSL_EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8) |
EPWM output action when a trip event occurs | |
typedef uint32_t | EPWM_TzTripAction_t |
Action to be taken on PWM output When a trip event occurs. More... | |
#define | EPWM_TZ_TRIP_ACTION_TRI_STATE (PWMSS_EPWM_TZCTL_TZA_HIGH_IMPEDANCE) |
#define | EPWM_TZ_TRIP_ACTION_HIGH (PWMSS_EPWM_TZCTL_TZA_HIGH_STATE) |
#define | EPWM_TZ_TRIP_ACTION_LOW (PWMSS_EPWM_TZCTL_TZA_LOW_STATE) |
#define | EPWM_TZ_TRIP_ACTION_DO_NOTHING (PWMSS_EPWM_TZCTL_TZA_DO_NOTHING) |
EPWM trip zone events | |
typedef uint32_t | EPWM_TzEvent_t |
Type of trip zone events. More... | |
#define | EPWM_TZ_EVENT_MIN (0x0U) |
#define | EPWM_TZ_EVENT_ONE_SHOT (EPWM_TZ_EVENT_MIN) |
#define | EPWM_TZ_EVENT_CYCLE_BY_CYCLE (0x1U) |
#define | EPWM_TZ_EVENT_MAX (CSL_EPWM_TZ_EVENT_CYCLE_BY_CYCLE) |
EPWM Trip zone status flags | |
typedef uint32_t | EPWM_TzStsFlg_t |
Trip zone status flags. More... | |
#define | EPWM_TZ_STS_FLG_OST (PWMSS_EPWM_TZFLG_OST_MASK) |
#define | EPWM_TZ_STS_FLG_CBC (PWMSS_EPWM_TZFLG_CBC_MASK) |
#define | EPWM_TZ_STS_FLG_INT (PWMSS_EPWM_TZFLG_INT_MASK) |
EPWM Interrupt (EPWMx_INT) Selection Options | |
typedef uint32_t | EPWM_EtIntrEvt_t |
ePWM Interrupt (EPWMx_INT) Selection Options. More... | |
#define | EPWM_ET_INTR_EVT_CNT_EQ_ZRO (PWMSS_EPWM_ETSEL_INTSEL_CTR_0) |
#define | EPWM_ET_INTR_EVT_CNT_EQ_PRD (PWMSS_EPWM_ETSEL_INTSEL_CTR_PERIOD) |
#define | EPWM_ET_INTR_EVT_CNT_EQ_CMPA_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_INCR) |
#define | EPWM_ET_INTR_EVT_CNT_EQ_CMPA_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_DECR) |
#define | EPWM_ET_INTR_EVT_CNT_EQ_CMPB_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_INCR) |
#define | EPWM_ET_INTR_EVT_CNT_EQ_CMPB_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_DECR) |
EPWM Interrupt (EPWMx_INT) Period Select | |
typedef uint32_t | EPWM_EtIntrPeriod_t |
ePWM Interrupt (EPWMx_INT) Period Select. These values determine how many selected events need to occur before an interrupt is generated. More... | |
#define | EPWM_ET_INTR_PERIOD_DIS_INTR (PWMSS_EPWM_ETPS_INTPRD_DISABLE) |
#define | EPWM_ET_INTR_PERIOD_FIRST_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_FIRST_EVT) |
#define | EPWM_ET_INTR_PERIOD_SECOND_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_SECOND_EVT) |
#define | EPWM_ET_INTR_PERIOD_THIRD_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_THIRD_EVT) |
#define EPWM_OUTPUT_CH_MIN (0U) |
Minimum value of enumeration. Used for input validation.
#define EPWM_OUTPUT_CH_A (EPWM_OUTPUT_CH_MIN) |
Output channel A.
#define EPWM_OUTPUT_CH_B (1U) |
Output channel B.
#define EPWM_OUTPUT_CH_MAX (EPWM_OUTPUT_CH_B) |
Maximum value of enumeration. Used for input validation.
#define EPWM_TB_COUNTER_DIR_UP (PWMSS_EPWM_TBCTL_CTRMODE_UP_COUNT) |
Up Count mode.
#define EPWM_TB_COUNTER_DIR_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_DOWN_COUNT) |
Down count mode.
#define EPWM_TB_COUNTER_DIR_UP_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_UP_DOWN_COUNT) |
Up down count mode.
#define EPWM_TB_COUNTER_DIR_STOP (PWMSS_EPWM_TBCTL_CTRMODE_STOP_FREEZE) |
stop-freeze counter operation (default on reset).
#define EPWM_SHADOW_REG_CTRL_ENABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_FROM_SHADOW) |
Shadow register value will be used.
#define EPWM_SHADOW_REG_CTRL_DISABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_IMMEDIATELY) |
Shadow register is disabled and active register value will be used.
#define EPWM_TB_CNT_DIR_AFT_SYNC_DOWN (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_DOWN) |
Count down after the synchronization event.
#define EPWM_TB_CNT_DIR_AFT_SYNC_UP (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_UP) |
Count up after the synchronization event.
#define EPWM_TB_SYNC_OUT_EVT_SYNCIN (PWMSS_EPWM_TBCTL_SYNCOSEL_EPWMXSYNC) |
Sync Input signal.
#define EPWM_TB_SYNC_OUT_EVT_CNT_EQ_ZERO (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_0) |
Time-base counter equal to zero.
#define EPWM_TB_SYNC_OUT_EVT_CNT_EQ_CMP_B (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_CPMB) |
Time-base counter equal to counter-compare B (TBCNT = CMPB).
#define EPWM_TB_SYNC_OUT_EVT_DISABLE (PWMSS_EPWM_TBCTL_SYNCOSEL_DISABLE_EPWMXSYNCO) |
Disable EPWMxSYNCO(Sync Output) signal.
#define EPWM_TB_STS_CTR_MAX (PWMSS_EPWM_TBSTS_CTRMAX_MASK) |
Time-Base Counter Max Latched Status.
#define EPWM_TB_STS_SYNCI (PWMSS_EPWM_TBSTS_SYNCI_MASK) |
Input Synchronization Latched Status.
#define EPWM_TB_STS_CTR_DIR (PWMSS_EPWM_TBSTS_CTRDIR_MASK) |
Time-Base Counter Direction Status.
#define EPWM_TB_EMU_MODE_STP_AFT_NEXT_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_NEXT_CTR) |
Stop after the next time-base counter increment or decrement.
#define EPWM_TB_EMU_MODE_STP_AFT_COMPLETE_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_CYCLE) |
Stop after the next time-base counter increment or decrement. Up-count mode: stop when the time-base counter = period. Down-count mode: stop when the time-base counter = 0000. Up-down-count mode: stop when the time-base counter = 0000.
#define EPWM_TB_EMU_MODE_FREE_RUN (PWMSS_EPWM_TBCTL_FREE_SOFT_RUN2) |
Counter is in Free run.
#define EPWM_CC_CMP_MIN (0U) |
Minimum value of enumeration. Used for input validation.
#define EPWM_CC_CMP_A (EPWM_CC_CMP_MIN) |
Counter Comparator A.
#define EPWM_CC_CMP_B (1U) |
Counter Comparator B.
#define EPWM_CC_CMP_MAX (CSL_EPWM_CC_CMP_B) |
Maximum value of enumeration. Used for input validation.
#define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0) |
Load on CTR = 0: Time-base counter equal to zero.
#define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_PRD) |
Load on CTR = PRD: Time-base counter equal to period.
#define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO_OR_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0_OR_PRD) |
Load on either CTR = 0 or CTR = PRD.
#define EPWM_CC_CMP_LOAD_MODE_NO_LOAD (PWMSS_EPWM_CMPCTL_LOADAMODE_FREEZE) |
Freeze (no loads possible).
#define EPWM_AQ_ACTION_DONOTHING (PWMSS_EPWM_AQCTLA_ZRO_DISABLED) |
Do nothing (Action disabled).
#define EPWM_AQ_ACTION_LOW (PWMSS_EPWM_AQCTLA_ZRO_CLEAR) |
Clear: Force EPWMx output low.
#define EPWM_AQ_ACTION_HIGH (PWMSS_EPWM_AQCTLA_ZRO_SET) |
Set: Force EPWMx output high.
#define EPQM_AQ_ACTION_TOLLGE (PWMSS_EPWM_AQCTLA_ZRO_TOGGLE) |
#define EPWM_AQ_ACTION_TOLLGE (CSL_EPQM_AQ_ACTION_TOLLGE) |
Toggle EPWMx output: low output signal will be forced high, and a high signal will be forced low.
#define EPWM_AQ_SW_TRIG_OT_ACTION_DONOTHING (PWMSS_EPWM_AQSFRC_ACTSFA_DISABLED) |
Do nothing (Action disabled).
#define EPWM_AQ_SW_TRIG_OT_ACTION_LOW (PWMSS_EPWM_AQSFRC_ACTSFA_CLEAR) |
Clear: Output Low.
#define EPWM_AQ_SW_TRIG_OT_ACTION_HIGH (PWMSS_EPWM_AQSFRC_ACTSFA_SET) |
Set: Output high.
#define EPWM_AQ_SW_TRIG_OT_ACTION_TOGGLE (PWMSS_EPWM_AQSFRC_ACTSFA_TOGGLE) |
Toggle output.
#define EPWM_AQ_SW_TRIG_CONT_ACTION_NOEFFECT (PWMSS_EPWM_AQCSFRC_CSFA_DISABLED) |
Forcing disabled, that is, has no effect.
#define EPWM_AQ_SW_TRIG_CONT_ACTION_LOW (PWMSS_EPWM_AQCSFRC_CSFA_LOW_OUTPUT) |
Forces a continuous low on output A.
#define EPWM_AQ_SW_TRIG_CONT_ACTION_HIGH (PWMSS_EPWM_AQCSFRC_CSFA_HIGH_OUTPUT) |
Forces a continuous high on output A.
#define EPWM_AQ_SW_TRIG_CONT_ACTION_SW_DISBALED (PWMSS_EPWM_AQCSFRC_CSFA_NO_EFFECT) |
Software forcing is disabled and has no effect.
#define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0) |
Load on event counter equals zero.
#define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_PERIOD) |
Load on event counter equals period.
#define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO_OR_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0_OR_PERIOD) |
Load on event counter equals zero or counter equals period.
#define EPWM_AQ_CSFRC_REG_RELOAD_IMMEDIATE (PWMSS_EPWM_AQSFRC_RLDCSF_IMMEDIATE) |
Load immediately.
#define EPWM_DB_IN_MODE_A_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_AFED) |
EPWMxA In (from the action-qualifier) is the source for both falling-edge and rising-edge delay.
#define EPWM_DB_IN_MODE_B_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_AFED) |
EPWMxB In (from the action-qualifier) is the source for rising-edge delayed signal. EPWMxA In (from the action-qualifier) is the source for falling-edge delayed signal.
#define EPWM_DB_IN_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_BFED) |
EPWMxA In (from the action-qualifier) is the source for rising-edge delayed signal. EPWMxB In (from the action-qualifier) is the source for falling-edge delayed signal.
#define EPWM_DB_IN_MODE_B_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_BFED) |
EPWMxB In (from the action-qualifier) is the source for both rising-edge delay and falling-edge delayed signal.
#define EPWM_DB_POL_SEL_ACTV_HIGH (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH) |
Neither EPWMxA nor EPWMxB is inverted (default).
#define EPWM_DB_POL_SEL_ACTV_LOW_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW_COMPLEMENTARY) |
EPWMxA is inverted.
#define EPWM_DB_POL_SEL_ACTV_HIGH_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH_COMPLEMENTARY) |
EPWMxB is inverted.
#define EPWM_DB_POL_SEL_ACTV_LOW (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW) |
Both EPWMxA and EPWMxB are inverted.
#define EPWM_DB_OUT_MODE_BYPASS (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLED) |
Dead-band generation is bypassed for both output signals. In this mode, both the EPWMxA and EPWMxB output signals from the action-qualifier are passed directly to the PWM-chopper sub-module.
#define EPWM_DB_OUT_MODE_NO_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_RISING_EDGE) |
Disable rising-edge delay. The EPWMxA signal from the action-qualifier is passed straight through to the EPWMxA input of the PWM-chopper sub-module. The falling-edge delayed signal is seen on output EPWMxB
#define EPWM_DB_OUT_MODE_A_RED_NO_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_FALLING_EDGE) |
Disable falling-edge delay. The EPWMxB signal from the action-qualifier is passed straight through to the EPWMxB input of the PWM-chopper sub-module. The rising-edge delayed signal is seen on output EPWMxA.
#define EPWM_DB_OUT_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_ENABLED) |
Dead-band is fully enabled for both rising-edge delay on output EPWMxA and falling-edge delay on output EPWMxB.
#define EPWM_CHP_DUTY_CYCLE_PERC_12PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_12_5) |
Duty cycle 1/8 (12.5%).
#define EPWM_CHP_DUTY_CYCLE_PERC_25 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_25) |
Duty cycle 2/8 (25%).
#define EPWM_CHP_DUTY_CYCLE_PERC_37PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_37_5) |
Duty cycle 3/8 (37.5%).
#define EPWM_CHP_DUTY_CYCLE_PERC_50_PER (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_50) |
Duty cycle 4/8 (50%).
#define EPWM_CHP_DUTY_CYCLE_PERC_62PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_62_5) |
Duty cycle 5/8 (62.5%).
#define EPWM_CHP_DUTY_CYCLE_PERC_75 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_75) |
Duty cycle 6/8 (75%).
#define EPWM_CHP_DUTY_CYCLE_PERC_87PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_87_5) |
Duty cycle 7/8 (87.5%).
#define EPWM_CHP_CLK_FREQ_DIV_BY_1 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_1) |
Divide by 1 (no prescale).
#define EPWM_CHP_CLK_FREQ_DIV_BY_2 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_2) |
Divide by 2.
#define EPWM_CHP_CLK_FREQ_DIV_BY_3 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_3) |
Divide by 3.
#define EPWM_CHP_CLK_FREQ_DIV_BY_4 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_4) |
Divide by 4.
#define EPWM_CHP_CLK_FREQ_DIV_BY_5 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_5) |
Divide by 5.
#define EPWM_CHP_CLK_FREQ_DIV_BY_6 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_6) |
Divide by 6.
#define EPWM_CHP_CLK_FREQ_DIV_BY_7 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_7) |
Divide by 7.
#define EPWM_CHP_CLK_FREQ_DIV_BY_8 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_8) |
Divide by 8.
#define EPWM_CHP_OSHT_WIDTH_MIN (0U) |
Minimum value of enumeration. Used for input validation.
#define EPWM_CHP_OSHT_WIDTH_1XSYSOUT_BY_8 (CSL_EPWM_CHP_OSHT_WIDTH_MIN) |
1 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_2XSYSOUT_BY_8 (1U) |
2 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_3XSYSOUT_BY_8 (2U) |
3 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_4XSYSOUT_BY_8 (3U) |
4 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_5XSYSOUT_BY_8 (4U) |
5 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_6XSYSOUT_BY_8 (5U) |
6 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_7XSYSOUT_BY_8 (6U) |
7 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_8XSYSOUT_BY_8 (7U) |
8 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_9XSYSOUT_BY_8 (8U) |
9 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_10XSYSOUT_BY_8 (9U) |
10 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_11XSYSOUT_BY_8 (10U) |
11 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_12XSYSOUT_BY_8 (11U) |
12 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_13XSYSOUT_BY_8 (12U) |
13 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_14XSYSOUT_BY_8 (13U) |
14 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_15XSYSOUT_BY_8 (14U) |
15 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8 (15U) |
16 x SYSCLKOUT/8 wide.
#define EPWM_CHP_OSHT_WIDTH_MAX (CSL_EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8) |
Maximum value of enumeration. Used for input validation.
#define EPWM_TZ_TRIP_ACTION_TRI_STATE (PWMSS_EPWM_TZCTL_TZA_HIGH_IMPEDANCE) |
High impedance (EPWMxA = High-impedance state).
#define EPWM_TZ_TRIP_ACTION_HIGH (PWMSS_EPWM_TZCTL_TZA_HIGH_STATE) |
Force EPWMxA to a high state.
#define EPWM_TZ_TRIP_ACTION_LOW (PWMSS_EPWM_TZCTL_TZA_LOW_STATE) |
Force EPWMxA to a low state.
#define EPWM_TZ_TRIP_ACTION_DO_NOTHING (PWMSS_EPWM_TZCTL_TZA_DO_NOTHING) |
Do nothing, no action is taken on EPWMxA.
#define EPWM_TZ_EVENT_MIN (0x0U) |
Minimum value of enumeration. Used for input validation.
#define EPWM_TZ_EVENT_ONE_SHOT (EPWM_TZ_EVENT_MIN) |
One shot trip zone event.
#define EPWM_TZ_EVENT_CYCLE_BY_CYCLE (0x1U) |
Cycle by cycle trip zone event.
#define EPWM_TZ_EVENT_MAX (CSL_EPWM_TZ_EVENT_CYCLE_BY_CYCLE) |
Maximum value of enumeration. Used for input validation.
#define EPWM_TZ_STS_FLG_OST (PWMSS_EPWM_TZFLG_OST_MASK) |
Latched Status Flag for A One-Shot Trip Event.
#define EPWM_TZ_STS_FLG_CBC (PWMSS_EPWM_TZFLG_CBC_MASK) |
Latched Status Flag for Cycle-By-Cycle Trip Event.
#define EPWM_TZ_STS_FLG_INT (PWMSS_EPWM_TZFLG_INT_MASK) |
Latched status for Trip Interrupt .
#define EPWM_ET_INTR_EVT_CNT_EQ_ZRO (PWMSS_EPWM_ETSEL_INTSEL_CTR_0) |
Enable event time-base counter equal to zero. (TBCNT = 0000h).
#define EPWM_ET_INTR_EVT_CNT_EQ_PRD (PWMSS_EPWM_ETSEL_INTSEL_CTR_PERIOD) |
Enable event time-base counter equal to period (TBCNT = TBPRD).
#define EPWM_ET_INTR_EVT_CNT_EQ_CMPA_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_INCR) |
Enable event time-base counter equal to CMPA when the timer is incrementing.
#define EPWM_ET_INTR_EVT_CNT_EQ_CMPA_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_DECR) |
Enable event time-base counter equal to CMPA when the timer is decrementing.
#define EPWM_ET_INTR_EVT_CNT_EQ_CMPB_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_INCR) |
Enable event: time-base counter equal to CMPB when the timer is incrementing.
#define EPWM_ET_INTR_EVT_CNT_EQ_CMPB_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_DECR) |
Enable event: time-base counter equal to CMPB when the timer is decrementing.
#define EPWM_ET_INTR_PERIOD_DIS_INTR (PWMSS_EPWM_ETPS_INTPRD_DISABLE) |
Disable the interrupt event counter. No interrupt will be generated.
#define EPWM_ET_INTR_PERIOD_FIRST_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_FIRST_EVT) |
Generate an interrupt on the first event.
#define EPWM_ET_INTR_PERIOD_SECOND_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_SECOND_EVT) |
Generate an interrupt on the second event.
#define EPWM_ET_INTR_PERIOD_THIRD_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_THIRD_EVT) |
Generate an interrupt on the third event.
#define EPWM_ETFLG_INT_MASK (PWMSS_EPWM_ETFLG_INT_MASK) |
Mask used to check interrupt status.
typedef uint32_t EPWM_OutputCh_t |
Number of supported EPWM outputs in a single epwm channel.
typedef uint32_t EPWM_TbCounterDir_t |
Types of Time base counter direction modes.
typedef uint32_t EPWM_ShadowRegCtrl_t |
Shadow register enable or disable control.
Same macros will be used to control the following shadow registers
typedef uint32_t EPWM_TbCntDirAftSync_t |
Counter directions after sync event.
typedef uint32_t EPWM_TbSyncOutEvt_t |
Source of Synchronization output signal.
typedef uint32_t EPWM_TbSts_t |
Flags to get the different types of time base status.
typedef uint32_t EPWM_TbEmuMode_t |
Emulation Mode. This selects the behaviour of the ePWM time-base counter during emulation events.
typedef uint32_t EPWM_CcCmp_t |
\ Counter Comparator type either A or B.
typedef uint32_t EPWM_CcCmpLoadMode_t |
Counter-Comparator registers(A and B) load mode flags from shadow register.
Same macros will be used to control the following registers
typedef uint32_t EPWM_AqAction_t |
Types of Actions that Action Qualifier can take on the Output when the supported counter compare event occurs.
Same actions will be applicable for all the supported events and same actions are applicable for both A and B channel PWM outputs.
typedef uint32_t EPWM_AqSwTrigOtAction_t |
Actions to be taken on the output, when Software triggered one time events will occur.
Same macros will be used for both A and B channel outputs because the bit field values are same.
typedef uint32_t EPWM_AqSwTrigContAction_t |
Types of Continuous software forced actions on output.
Same macros will be used for configuration of both A and B PWM outputs, because bit field values for both A and B are same.
typedef uint32_t EPWM_AqCsfrcRegReload_t |
Action Qualifier Software Force Active Register Reload From Shadow Options.
typedef uint32_t EPWM_DbInMode_t |
Dead Band Input Mode Control. This allows you to select the input source to the falling-edge and rising-edge delay.
typedef uint32_t EPWM_DbPolSel_t |
Polarity Select Control. This allows you to selectively invert one of the delayed signals before it is sent out of the dead-band sub-module.
typedef uint32_t EPWM_DbOutMode_t |
Dead-band Output Mode Control. This allows you to selectively enable or bypass the dead-band generation for the falling-edge and rising-edge delay.
typedef uint32_t EPWM_ChpDutyCycle_t |
Chopping Clock Duty Cycle values.
typedef uint32_t EPWM_ChpClkFreq_t |
Chopping Clock Frequency values .
typedef uint32_t EPWM_ChpOshtWidth_t |
One-Shot Pulse Width values.
typedef uint32_t EPWM_TzTripAction_t |
Action to be taken on PWM output When a trip event occurs.
Same macros will be used to control both A and B outputs because the bit field values are same for A and B channels.
typedef uint32_t EPWM_TzEvent_t |
Type of trip zone events.
typedef uint32_t EPWM_TzStsFlg_t |
Trip zone status flags.
typedef uint32_t EPWM_EtIntrEvt_t |
ePWM Interrupt (EPWMx_INT) Selection Options.
typedef uint32_t EPWM_EtIntrPeriod_t |
ePWM Interrupt (EPWMx_INT) Period Select. These values determine how many selected events need to occur before an interrupt is generated.
void EPWM_tbTimebaseClkCfg | ( | uint32_t | baseAddr, |
uint32_t | tbClk, | ||
uint32_t | moduleClk | ||
) |
This API configures the clock divider of the Time base module.
The clock divider can be calculated using the equation TBCLK = SYSCLKOUT/(HSPCLKDIV × CLKDIV)
baseAddr | Base Address of PWMSS instance used. |
tbClk | Timebase clock to be generated in Hz. |
moduleClk | Input clock of the PWM module (sysclk2) in Hz. |
void EPWM_tbPwmFreqCfg | ( | uint32_t | baseAddr, |
uint32_t | tbClk, | ||
uint32_t | pwmFreq, | ||
uint32_t | counterDir, | ||
uint32_t | enableShadowWrite | ||
) |
This API configures the PWM Time base counter Frequency/Period.
The period count determines the period of the final output waveform.
baseAddr | Base Address of PWMSS instance used. |
tbClk | Timebase clock in Hz. |
pwmFreq | Frequency of the PWM Output in Hz. |
counterDir | Direction of the counter(up, down, up-down). 'counterDir' can take values from the following enum |
enableShadowWrite | Flag controlling Whether write to Period register is to be shadowed or not. 'enableShadowWrite' can take values from the following enum |
void EPWM_tbSyncEnable | ( | uint32_t | baseAddr, |
uint32_t | tbPhsValue, | ||
uint32_t | counterDir | ||
) |
This API enables the synchronization of time base sub-module and also configures the phase count value to be loaded after sync event, counter direction after sync event.
When a sync-in event is generated the the time base counter is reloaded with the new value. After sync the counter will use the new value and direction as specified after sync event.
baseAddr | Base Address of PWMSS instance used. |
tbPhsValue | Phase value to be reloaded after sync |
counterDir | Count direction after sync. 'counterDir' can take values from the following enum |
void EPWM_tbSyncDisable | ( | uint32_t | baseAddr | ) |
This API disables the synchronization. Even if sync-in event occurs the count value will not be reloaded.
baseAddr | Base Address of PWMSS instance used. |
void EPWM_tbSetSyncOutMode | ( | uint32_t | baseAddr, |
uint32_t | syncOutMode | ||
) |
This API selects the source of the synchronization output signal. It determines on which of the supported events sync-out has to be generated.
baseAddr | Base Address of PWMSS instance used. |
syncOutMode | Sync out mode. 'syncOutMode' can take values from the following enum |
void EPWM_tbTriggerSwSync | ( | uint32_t | baseAddr | ) |
This API generates software triggered sync pulse.
baseAddr | Base Address of PWMSS instance used. |
void EPWM_tbWriteTbCount | ( | uint32_t | baseAddr, |
uint32_t | tbCount | ||
) |
This API loads the Time base counter. The new value is taken immediately.
baseAddr | Base Address of PWMSS instance used. |
tbCount | Time base count value to be loaded. |
uint16_t EPWM_tbReadTbCount | ( | uint32_t | baseAddr | ) |
This API gets the Time base counter current value. The count operation is not affected by the read.
baseAddr | Base Address of PWMSS instance used. |
tbCount | Current Timebase count value. |
uint16_t EPWM_tbGetStatus | ( | uint32_t | baseAddr, |
uint32_t | tbStatusMask | ||
) |
This API gets the Time Base status as indicated by the tbStatusMask parameter.
baseAddr | Base Address of PWMSS instance used. |
tbStatusMask | Flag indicating the type of status needed. 'tbStatusMask' can take values from the following enum |
tbStatus | Requested status is returned. |
void EPWM_tbStatusClear | ( | uint32_t | baseAddr, |
uint32_t | tbStatusClrMask | ||
) |
This API clears the Time base status bits indicated by the tbStatusClrMask parameter.
baseAddr | Base Address of PWMSS instance used. |
tbStatusClrMask | Mask indicating which status bit need to be cleared 'tbStatusClrMask' can take following values |
void EPWM_tbSetEmulationMode | ( | uint32_t | baseAddr, |
uint32_t | mode | ||
) |
This API configures emulation mode. This setting determines the behaviour of Timebase counter during emulation (debugging).
baseAddr | Base Address of PWMSS instance used. |
mode | Emulation mode. 'mode' can take values from the following enum |
uint32_t EPWM_counterComparatorCfg | ( | uint32_t | baseAddr, |
uint32_t | cmpType, | ||
uint32_t | cmpVal, | ||
uint32_t | enableShadowWrite, | ||
uint32_t | shadowToActiveLoadTrigger, | ||
uint32_t | overwriteShadow | ||
) |
This API configures the counter comparator and loads the comparator value. When Counter comparator value equals the counter value, then an event is generated both in the up direction and down direction.
baseAddr | Base Address of PWMSS instance used. |
cmpType | Comparator Type A or B. 'cmpType' can take values from the following enum |
cmpVal | Comparator value that needs to be loaded. |
enableShadowWrite | Enable write to shadow register. 'enableShadowWrite' can take values from the following enum |
shadowToActiveLoadTrigger | Shadow to active register load mode. 'shadowToActiveLoadTrigger' can take values from the following enum |
overwriteShadow | Overwrite even if previous value is not loaded to active register. 'overwriteShadow' can take following values
|
TRUE | Comparator value is written successfully. |
FALSE | Comparator value write is failed. |
void EPWM_aqActionOnOutputCfg | ( | uint32_t | baseAddr, |
uint32_t | pwmOutputCh, | ||
const EPWM_AqActionCfg * | pCfg | ||
) |
This API configures the action to be taken on output by the Action qualifier module upon receiving the events. This will determine the output waveform.
baseAddr | Base Address of PWMSS instance used. |
pwmOutputCh | PWM Output channel type either A or B 'pwmOutputCh' can take values from the following enum |
pCfg | Pointer to the following structure which contains the action configuration variables for different events |
void EPWM_aqSwTriggerOneTimeAction | ( | uint32_t | baseAddr, |
uint32_t | pwmOutputCh, | ||
uint32_t | swTrigAction | ||
) |
This API triggers the SW forced single event on the PWM output.
This can be used for testing the AQ sub-module. Every call to this API will trigger a single event.
baseAddr | Base Address of PWMSS instance used. |
pwmOutputCh | PWM Output channel type either A or B 'pwmOutputCh' can take values from the following enum |
swTrigAction | Action that needs to be taken on the PWM output. 'swTrigAction' can take one of the following enum values |
void EPWM_aqSwTriggerContAction | ( | uint32_t | baseAddr, |
uint32_t | pwmOutputCh, | ||
uint32_t | swTrigAction, | ||
uint32_t | activeRegReloadMode | ||
) |
This API forces output value continuously on PWM output channel. The output can be forced to low or high.
baseAddr | Base Address of PWMSS instance used. |
pwmOutputCh | PWM Output channel type either A or B 'pwmOutputCh' can take values from the following enum |
swTrigAction | Value to be forced on the output This parameter can take values from the following enum |
activeRegReloadMode | Shadow to active reg load trigger. This parameter can take values from the following enum |
void EPWM_deadbandCfg | ( | uint32_t | baseAddr, |
const EPWM_DeadbandCfg * | pCfg | ||
) |
This API performs the configuration of the dead band sub-module. This API configures the input source, output mode, polarity, rising and falling edge delays.
The Dead band generator has two sub-modules, one for raising edge delay and the other for falling edge delay. This can be configured when a delay is need between two signals during signal change. The dead band generator is useful in full-inverters.
baseAddr | Base Address of PWMSS instance used. |
pCfg | Pointer to the structure EPWM_DeadbandCfg containing the dead band configuration parameters. |
void EPWM_deadbandBypass | ( | uint32_t | baseAddr | ) |
This API bypasses the Dead-band sub-module.
baseAddr | Base Address of PWMSS instance used. |
void EPWM_chopperCfg | ( | uint32_t | baseAddr, |
const EPWM_ChopperCfg * | pCfg | ||
) |
This API performs the configuration of the chopper sub-module. This API configures chopping clock duty cycle, chopping clock frequency and pulse width of first pulse of chopping clock.
baseAddr | Base Address of PWMSS instance used. |
pCfg | Pointer to the structure EPWM_ChopperCfg containing the chopper configuration parameters. |
void EPWM_chopperEnable | ( | uint32_t | baseAddr, |
uint32_t | enableChopper | ||
) |
This API controls the enabling or disabling of chopper sub-module.
baseAddr | Base Address of PWMSS instance used. |
enableChopper | Flag controlling the enabling or disabling 'enableChopper' can take one of the following values
|
void EPWM_tzTriggerTripAction | ( | uint32_t | baseAddr, |
uint32_t | tripAction, | ||
uint32_t | pwmOutputCh | ||
) |
This API configures the o/p on PWM channel when a trip event is recognized. The output can be set to high or low or high impedance.
baseAddr | Base Address of PWMSS instance used. |
tripAction | Action to be taken on the PWM output. This parameter can take values from the following enum |
pwmOutputCh | PWM Output channel type either A or B 'pwmOutputCh' can take values from the following enum |
void EPWM_tzTripEventEnable | ( | uint32_t | baseAddr, |
uint32_t | tzEventType, | ||
uint32_t | pinNum | ||
) |
This API enables the trip event.
The trip signals indicates external fault, and the ePWM outputs can be programmed to respond accordingly when faults occur.
baseAddr | Base Address of PWMSS instance used. |
tzEventType | Enable OST or CBC trip zone event This parameter can take values from the following enum |
pinNum | Pin number on which trip zone event has to be enabled. |
void EPWM_tzTripEventDisable | ( | uint32_t | baseAddr, |
uint32_t | tzEventType, | ||
uint32_t | pinNum | ||
) |
This API disable the trip event. The disabled trip events will be ignored.
baseAddr | Base Address of PWMSS instance used. |
tzEventType | Disable OST or CBC trip zone event This parameter can take values from the following enum |
pinNum | Pin number on which trip zone event has to be disabled. |
void EPWM_tzIntrEnable | ( | uint32_t | baseAddr, |
uint32_t | tzEventType | ||
) |
This API enables the trip interrupt. When trip event occurs the sub-module can be configured to interrupt CPU.
baseAddr | Base Address of PWMSS instance used. |
tzEventType | Trip zone event for which interrupt has to be enabled. This parameter can take values form the following enum |
void EPWM_tzIntrDisable | ( | uint32_t | baseAddr, |
uint32_t | tzEventType | ||
) |
This API disables the trip interrupt.
baseAddr | Base Address of PWMSS instance used. |
tzEventType | Trip zone event for which interrupt has to be enabled. This parameter can take values form the following enum |
uint16_t EPWM_tzEventStatus | ( | uint32_t | baseAddr, |
uint32_t | eventMask | ||
) |
This API returns the selected trip zone event status.
baseAddr | Base Address of PWMSS instance used. |
eventMask | Type of status which has to be read. This parameter can take values from the following enum |
Status | Status of the required status flag. |
void EPWM_tzEventStatusClear | ( | uint32_t | baseAddr, |
uint32_t | eventMask | ||
) |
This API clears the selected trip zone event status.
baseAddr | Base Address of PWMSS instance used. |
eventMask | Type of status which has to be read. This parameter can take values from the following enum |
void EPWM_tzTriggerSwEvent | ( | uint32_t | baseAddr, |
uint32_t | tzEventType | ||
) |
This API enables to generate Software forced trip condition.
baseAddr | Base Address of PWMSS instance used. |
tzEventType | Type of trip condition which has to be generated. This parameter can take values from the following enum |
void EPWM_etIntrCfg | ( | uint32_t | baseAddr, |
uint32_t | intrEvtSrc, | ||
uint32_t | intrPrd | ||
) |
This API configures the Event Trigger sub-module. This API configures the interrupt source and interrupt period.
baseAddr | Base Address of PWMSS instance used. |
intrEvtSrc | Event source which triggers interrupt. This parameter can take values from the following enum |
intrPrd | prescalar value(This determines how may selected events need to occur before an interrupt is generated). This parameter can take values from the following enum |
void EPWM_etIntrEnable | ( | uint32_t | baseAddr | ) |
This API enables the ePWM Event interrupt.
baseAddr | Base Address of PWMSS instance used. |
void EPWM_etIntrDisable | ( | uint32_t | baseAddr | ) |
This API disables the ePWM Event interrupt.
baseAddr | Base Address of PWMSS instance used. |
uint16_t EPWM_etIntrStatus | ( | uint32_t | baseAddr | ) |
This API returns the ePWM event interrupt status.
baseAddr | Base Address of PWMSS instance used. |
0 | Interrupt is not generated. |
1 | Interrupt is generated. |
void EPWM_etIntrClear | ( | uint32_t | baseAddr | ) |
This API clears the interrupt. This will clear the interrupt flag bit and enable further interrupts pulses to be generated.
baseAddr | Base Address of PWMSS instance used. |
void EPWM_etIntrTrigger | ( | uint32_t | baseAddr | ) |
This API forces interrupt to be generated. This API is used for testing purpose.
baseAddr | Base Address of PWMSS instance used. |
uint16_t EPWM_etGetEventCount | ( | uint32_t | baseAddr | ) |
This API returns the number of events occurred.
baseAddr | Base Address of PWMSS instance used. |
eventCount | number of events occurred. This will have values in the range 0 to 3. |