EPWM Module¶
The ePWM (enhanced Pulse width Modulator) API provides a set of functions for configuring and using the ePWM module. The provided functions provide the capability to generate and alter PWM wave forms by providing access to the following ePWM sub-modules. * Time Base * Counter Compare * Action Qualifier * Dead Band Generator * Trip Zone * Event Trigger * Digital Compare
-
group
epwm_api
Defines
-
EPWM_SYNC_OUT_SOURCE_M
((uint16_t)EPWM_SYNCOUTEN_SWEN|\
(uint16_t)
EPWM_SYNCOUTEN_ZEROEN|\
(uint16_t)
EPWM_SYNCOUTEN_CMPBEN|\
(uint16_t)
EPWM_SYNCOUTEN_CMPCEN|\
(uint16_t)
EPWM_SYNCOUTEN_CMPDEN|\
(uint16_t)
EPWM_SYNCOUTEN_DCAEVT1EN|\
(uint16_t)
EPWM_SYNCOUTEN_DCBEVT1EN)¶
-
EPWM_SYNC_OUT_PULSE_ON_SOFTWARE
EPWM_SYNCOUTEN_SWEN¶ Software force generated EPWM sync-out pulse.
-
EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO
EPWM_SYNCOUTEN_ZEROEN¶ Counter zero event generates EPWM sync-out pulse.
-
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_B
EPWM_SYNCOUTEN_CMPBEN¶ Counter equal to CMPB event generates EPWM sync-out pulse.
-
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_C
EPWM_SYNCOUTEN_CMPCEN¶ Counter equal to CMPC event generates EPWM sync-out pulse.
-
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_D
EPWM_SYNCOUTEN_CMPDEN¶ Counter equal to CMPD event generates EPWM sync-out pulse.
-
EPWM_SYNC_OUT_PULSE_ON_DCA_EVT1_SYNC
EPWM_SYNCOUTEN_DCAEVT1EN¶ DCA Event 1 Sync signal generates EPWM sync-out pulse.
-
EPWM_SYNC_OUT_PULSE_ON_DCB_EVT1_SYNC
EPWM_SYNCOUTEN_DCBEVT1EN¶ DCB Event 1 Sync signal generates EPWM sync-out pulse.
-
EPWM_SYNC_OUT_PULSE_ON_ALL
EPWM_SYNC_OUT_SOURCE_M¶ Enable all the above sources.
-
EPWM_TIME_BASE_STATUS_COUNT_UP
1U¶ Time base counter is counting up
-
EPWM_TIME_BASE_STATUS_COUNT_DOWN
0U¶ Time base counter is counting down
-
EPWM_DB_INPUT_EPWMA
0U¶ Input signal is ePWMA
-
EPWM_DB_INPUT_EPWMB
1U¶ Input signal is ePWMB
-
EPWM_DB_INPUT_DB_RED
2U¶ Input signal is the output of Rising Edge delay
-
EPWM_TZ_SIGNAL_CBC1
0x1U¶ TZ1 Cycle By Cycle
-
EPWM_TZ_SIGNAL_CBC2
0x2U¶ TZ2 Cycle By Cycle
-
EPWM_TZ_SIGNAL_CBC3
0x4U¶ TZ3 Cycle By Cycle
-
EPWM_TZ_SIGNAL_CBC4
0x8U¶ TZ4 Cycle By Cycle
-
EPWM_TZ_SIGNAL_CBC5
0x10U¶ TZ5 Cycle By Cycle
-
EPWM_TZ_SIGNAL_CBC6
0x20U¶ TZ6 Cycle By Cycle
-
EPWM_TZ_SIGNAL_DCAEVT2
0x40U¶ DCAEVT2 Cycle By Cycle
-
EPWM_TZ_SIGNAL_DCBEVT2
0x80U¶ DCBEVT2 Cycle By Cycle
-
EPWM_TZ_SIGNAL_OSHT1
0x100U¶ One-shot TZ1
-
EPWM_TZ_SIGNAL_OSHT2
0x200U¶ One-shot TZ2
-
EPWM_TZ_SIGNAL_OSHT3
0x400U¶ One-shot TZ3
-
EPWM_TZ_SIGNAL_OSHT4
0x800U¶ One-shot TZ4
-
EPWM_TZ_SIGNAL_OSHT5
0x1000U¶ One-shot TZ5
-
EPWM_TZ_SIGNAL_OSHT6
0x2000U¶ One-shot TZ6
-
EPWM_TZ_SIGNAL_DCAEVT1
0x4000U¶ One-shot DCAEVT1
-
EPWM_TZ_SIGNAL_DCBEVT1
0x8000U¶ One-shot DCBEVT1
-
EPWM_TZ_INTERRUPT_CBC
0x2U¶ Trip Zones Cycle By Cycle interrupt
-
EPWM_TZ_INTERRUPT_OST
0x4U¶ Trip Zones One Shot interrupt
-
EPWM_TZ_INTERRUPT_DCAEVT1
0x8U¶ Digital Compare A Event 1 interrupt
-
EPWM_TZ_INTERRUPT_DCAEVT2
0x10U¶ Digital Compare A Event 2 interrupt
-
EPWM_TZ_INTERRUPT_DCBEVT1
0x20U¶ Digital Compare B Event 1 interrupt
-
EPWM_TZ_INTERRUPT_DCBEVT2
0x40U¶ Digital Compare B Event 2 interrupt
-
EPWM_TZ_FLAG_CBC
0x2U¶ Trip Zones Cycle By Cycle flag
-
EPWM_TZ_FLAG_OST
0x4U¶ Trip Zones One Shot flag
-
EPWM_TZ_FLAG_DCAEVT1
0x8U¶ Digital Compare A Event 1 flag
-
EPWM_TZ_FLAG_DCAEVT2
0x10U¶ Digital Compare A Event 2 flag
-
EPWM_TZ_FLAG_DCBEVT1
0x20U¶ Digital Compare B Event 1 flag
-
EPWM_TZ_FLAG_DCBEVT2
0x40U¶ Digital Compare B Event 2 flag
-
EPWM_TZ_INTERRUPT
0x1U¶ Trip Zone interrupt
-
EPWM_TZ_CBC_FLAG_1
0x1U¶ CBC flag 1
-
EPWM_TZ_CBC_FLAG_2
0x2U¶ CBC flag 2
-
EPWM_TZ_CBC_FLAG_3
0x4U¶ CBC flag 3
-
EPWM_TZ_CBC_FLAG_4
0x8U¶ CBC flag 4
-
EPWM_TZ_CBC_FLAG_5
0x10U¶ CBC flag 5
-
EPWM_TZ_CBC_FLAG_6
0x20U¶ CBC flag 6
-
EPWM_TZ_CBC_FLAG_DCAEVT2
0x40U¶ CBC flag Digital compare event A2
-
EPWM_TZ_CBC_FLAG_DCBEVT2
0x80U¶ CBC flag Digital compare event B2
-
EPWM_TZ_OST_FLAG_OST1
0x1U¶ OST flag OST1
-
EPWM_TZ_OST_FLAG_OST2
0x2U¶ OST flag OST2
-
EPWM_TZ_OST_FLAG_OST3
0x4U¶ OST flag OST3
-
EPWM_TZ_OST_FLAG_OST4
0x8U¶ OST flag OST4
-
EPWM_TZ_OST_FLAG_OST5
0x10U¶ OST flag OST5
-
EPWM_TZ_OST_FLAG_OST6
0x20U¶ OST flag OST6
-
EPWM_TZ_OST_FLAG_DCAEVT1
0x40U¶ OST flag Digital compare event A1
-
EPWM_TZ_OST_FLAG_DCBEVT1
0x80U¶ OST flag Digital compare event B1
-
EPWM_TZ_FORCE_EVENT_CBC
0x2U¶ Force Cycle By Cycle trip event
-
EPWM_TZ_FORCE_EVENT_OST
0x4U¶ Force a One-Shot Trip Event
-
EPWM_TZ_FORCE_EVENT_DCAEVT1
0x8U¶ ForceDigital Compare Output A Event 1
-
EPWM_TZ_FORCE_EVENT_DCAEVT2
0x10U¶ ForceDigital Compare Output A Event 2
-
EPWM_TZ_FORCE_EVENT_DCBEVT1
0x20U¶ ForceDigital Compare Output B Event 1
-
EPWM_TZ_FORCE_EVENT_DCBEVT2
0x40U¶ ForceDigital Compare Output B Event 2
-
EPWM_INT_TBCTR_ZERO
1U¶ Time-base counter equal to zero
-
EPWM_INT_TBCTR_PERIOD
2U¶ Time-base counter equal to period
-
EPWM_INT_TBCTR_ZERO_OR_PERIOD
3U¶ Time-base counter equal to zero or period
-
EPWM_INT_TBCTR_U_CMPA
4U¶ time-base counter equal to CMPA when the timer is incrementing
-
EPWM_INT_TBCTR_U_CMPC
8U¶ time-base counter equal to CMPC when the timer is incrementing
-
EPWM_INT_TBCTR_D_CMPA
5U¶ time-base counter equal to CMPA when the timer is decrementing
-
EPWM_INT_TBCTR_D_CMPC
10U¶ time-base counter equal to CMPC when the timer is decrementing
-
EPWM_INT_TBCTR_U_CMPB
6U¶ time-base counter equal to CMPB when the timer is incrementing
-
EPWM_INT_TBCTR_U_CMPD
12U¶ time-base counter equal to CMPD when the timer is incrementing
-
EPWM_INT_TBCTR_D_CMPB
7U¶ time-base counter equal to CMPB when the timer is decrementing
-
EPWM_INT_TBCTR_D_CMPD
14U¶ time-base counter equal to CMPD when the timer is decrementing
-
EPWM_DC_COMBINATIONAL_TRIPIN1
0x1U¶ Combinational Trip 1 input
-
EPWM_DC_COMBINATIONAL_TRIPIN2
0x2U¶ Combinational Trip 2 input
-
EPWM_DC_COMBINATIONAL_TRIPIN3
0x4U¶ Combinational Trip 3 input
-
EPWM_DC_COMBINATIONAL_TRIPIN4
0x8U¶ Combinational Trip 4 input
-
EPWM_DC_COMBINATIONAL_TRIPIN5
0x10U¶ Combinational Trip 5 input
-
EPWM_DC_COMBINATIONAL_TRIPIN6
0x20U¶ Combinational Trip 6 input
-
EPWM_DC_COMBINATIONAL_TRIPIN7
0x40U¶ Combinational Trip 7 input
-
EPWM_DC_COMBINATIONAL_TRIPIN8
0x80U¶ Combinational Trip 8 input
-
EPWM_DC_COMBINATIONAL_TRIPIN9
0x100U¶ Combinational Trip 9 input
-
EPWM_DC_COMBINATIONAL_TRIPIN10
0x200U¶ Combinational Trip 10 input
-
EPWM_DC_COMBINATIONAL_TRIPIN11
0x400U¶ Combinational Trip 11 input
-
EPWM_DC_COMBINATIONAL_TRIPIN12
0x800U¶ Combinational Trip 12 input
-
EPWM_DC_COMBINATIONAL_TRIPIN14
0x2000U¶ Combinational Trip 14 input
-
EPWM_DC_COMBINATIONAL_TRIPIN15
0x4000U¶ Combinational Trip 15 input
-
EPWM_GL_REGISTER_TBPRD_TBPRDHR
0x1U¶ Global load TBPRD:TBPRDHR
-
EPWM_GL_REGISTER_CMPA_CMPAHR
0x2U¶ Global load CMPA:CMPAHR
-
EPWM_GL_REGISTER_CMPB_CMPBHR
0x4U¶ Global load CMPB:CMPBHR
-
EPWM_GL_REGISTER_CMPC
0x8U¶ Global load CMPC
-
EPWM_GL_REGISTER_CMPD
0x10U¶ Global load CMPD
-
EPWM_GL_REGISTER_DBRED_DBREDHR
0x20U¶ Global load DBRED:DBREDHR
-
EPWM_GL_REGISTER_DBFED_DBFEDHR
0x40U¶ Global load DBFED:DBFEDHR
-
EPWM_GL_REGISTER_DBCTL
0x80U¶ Global load DBCTL
-
EPWM_GL_REGISTER_AQCTLA_AQCTLA2
0x100U¶ Global load AQCTLA/A2
-
EPWM_GL_REGISTER_AQCTLB_AQCTLB2
0x200U¶ Global load AQCTLB/B2
-
EPWM_GL_REGISTER_AQCSFRC
0x400U¶ Global load AQCSFRC
Enums
-
enum
EPWM_EmulationMode
¶ Values that can be passed to EPWM_setEmulationMode() as the emulationMode parameter.
Values:
-
enumerator
EPWM_EMULATION_STOP_AFTER_NEXT_TB
= 0¶ Stop after next Time Base counter increment or decrement.
-
enumerator
EPWM_EMULATION_STOP_AFTER_FULL_CYCLE
= 1¶ Stop when counter completes whole cycle.
-
enumerator
EPWM_EMULATION_FREE_RUN
= 2¶ Free run.
-
enumerator
-
enum
EPWM_SyncCountMode
¶ Values that can be passed to EPWM_setCountModeAfterSync() as the mode parameter.
Values:
-
enumerator
EPWM_COUNT_MODE_DOWN_AFTER_SYNC
= 0¶ Count down after sync event.
-
enumerator
EPWM_COUNT_MODE_UP_AFTER_SYNC
= 1¶ Count up after sync event.
-
enumerator
-
enum
EPWM_ClockDivider
¶ Values that can be passed to EPWM_setClockPrescaler() as the prescaler parameter.
Values:
-
enumerator
EPWM_CLOCK_DIVIDER_1
= 0¶ Divide clock by 1.
-
enumerator
EPWM_CLOCK_DIVIDER_2
= 1¶ Divide clock by 2.
-
enumerator
EPWM_CLOCK_DIVIDER_4
= 2¶ Divide clock by 4.
-
enumerator
EPWM_CLOCK_DIVIDER_8
= 3¶ Divide clock by 8.
-
enumerator
EPWM_CLOCK_DIVIDER_16
= 4¶ Divide clock by 16.
-
enumerator
EPWM_CLOCK_DIVIDER_32
= 5¶ Divide clock by 32.
-
enumerator
EPWM_CLOCK_DIVIDER_64
= 6¶ Divide clock by 64.
-
enumerator
EPWM_CLOCK_DIVIDER_128
= 7¶ Divide clock by 128.
-
enumerator
-
enum
EPWM_HSClockDivider
¶ Values that can be passed to EPWM_setClockPrescaler() as the highSpeedPrescaler parameter.
Values:
-
enumerator
EPWM_HSCLOCK_DIVIDER_1
= 0¶ Divide clock by 1.
-
enumerator
EPWM_HSCLOCK_DIVIDER_2
= 1¶ Divide clock by 2.
-
enumerator
EPWM_HSCLOCK_DIVIDER_4
= 2¶ Divide clock by 4.
-
enumerator
EPWM_HSCLOCK_DIVIDER_6
= 3¶ Divide clock by 6.
-
enumerator
EPWM_HSCLOCK_DIVIDER_8
= 4¶ Divide clock by 8.
-
enumerator
EPWM_HSCLOCK_DIVIDER_10
= 5¶ Divide clock by 10.
-
enumerator
EPWM_HSCLOCK_DIVIDER_12
= 6¶ Divide clock by 12.
-
enumerator
EPWM_HSCLOCK_DIVIDER_14
= 7¶ Divide clock by 14.
-
enumerator
-
enum
EPWM_SyncInPulseSource
¶ Values that can be passed to EPWM_setSyncInPulseSource() as the mode parameter.
Values:
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_DISABLE
= 0x0¶ Disable Sync-in.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1
= 0x1¶ Sync-in source is EPWM1 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM2
= 0x2¶ Sync-in source is EPWM2 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM3
= 0x3¶ Sync-in source is EPWM3 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM4
= 0x4¶ Sync-in source is EPWM4 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM5
= 0x5¶ Sync-in source is EPWM5 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM6
= 0x6¶ Sync-in source is EPWM6 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM7
= 0x7¶ Sync-in source is EPWM7 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_ECAP1
= 0x11¶ Sync-in source is ECAP1 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_ECAP2
= 0x12¶ Sync-in source is ECAP2 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_ECAP3
= 0x13¶ Sync-in source is ECAP3 sync-out signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_INPUTXBAR_OUT5
= 0x18¶ Sync-in source is Input XBAR out5 signal.
-
enumerator
EPWM_SYNC_IN_PULSE_SRC_INPUTXBAR_OUT6
= 0x19¶ Sync-in source is Input XBAR out6 signal.
-
enumerator
-
enum
EPWM_OneShotSyncOutTrigger
¶ Values that can be passed to EPWM_setOneShotSyncOutTrigger() as the trigger parameter.
Values:
-
enumerator
EPWM_OSHT_SYNC_OUT_TRIG_SYNC
= 0x0¶ Trigger is OSHT sync.
-
enumerator
EPWM_OSHT_SYNC_OUT_TRIG_RELOAD
= 0x1¶ Trigger is OSHT reload.
-
enumerator
-
enum
EPWM_PeriodLoadMode
¶ Values that can be passed to EPWM_setPeriodLoadMode() as the loadMode parameter.
Values:
-
enumerator
EPWM_PERIOD_SHADOW_LOAD
= 0¶ PWM Period register access is through shadow register.
-
enumerator
EPWM_PERIOD_DIRECT_LOAD
= 1¶ PWM Period register access is directly.
-
enumerator
-
enum
EPWM_TimeBaseCountMode
¶ Values that can be passed to EPWM_setTimeBaseCounterMode() as the counterMode parameter.
Values:
-
enumerator
EPWM_COUNTER_MODE_UP
= 0¶ Up - count mode.
-
enumerator
EPWM_COUNTER_MODE_DOWN
= 1¶ Down - count mode.
-
enumerator
EPWM_COUNTER_MODE_UP_DOWN
= 2¶ Up - down - count mode.
-
enumerator
EPWM_COUNTER_MODE_STOP_FREEZE
= 3¶ Stop - Freeze counter.
-
enumerator
-
enum
EPWM_PeriodShadowLoadMode
¶ Values that can be passed to EPWM_selectPeriodLoadEvent() as the shadowLoadMode parameter.
Values:
-
enumerator
EPWM_SHADOW_LOAD_MODE_COUNTER_ZERO
= 0¶ shadow to active load occurs when time base counter reaches 0.
-
enumerator
EPWM_SHADOW_LOAD_MODE_COUNTER_SYNC
= 1¶ shadow to active load occurs when time base counter reaches 0 and a SYNC occurs
-
enumerator
EPWM_SHADOW_LOAD_MODE_SYNC
= 2¶ shadow to active load occurs only when a SYNC occurs
-
enumerator
-
enum
EPWM_CurrentLink
¶ Values that can be passed to EPWM_setupEPWMLinks() as the epwmLink parameter.
Values:
-
enumerator
EPWM_LINK_WITH_EPWM_1
= 0¶ link current ePWM with ePWM1
-
enumerator
EPWM_LINK_WITH_EPWM_2
= 1¶ link current ePWM with ePWM2
-
enumerator
EPWM_LINK_WITH_EPWM_3
= 2¶ link current ePWM with ePWM3
-
enumerator
EPWM_LINK_WITH_EPWM_4
= 3¶ link current ePWM with ePWM4
-
enumerator
EPWM_LINK_WITH_EPWM_5
= 4¶ link current ePWM with ePWM5
-
enumerator
EPWM_LINK_WITH_EPWM_6
= 5¶ link current ePWM with ePWM6
-
enumerator
EPWM_LINK_WITH_EPWM_7
= 6¶ link current ePWM with ePWM7
-
enumerator
-
enum
EPWM_LinkComponent
¶ Values that can be passed to EPWM_setupEPWMLinks() as the linkComp parameter.
Values:
-
enumerator
EPWM_LINK_TBPRD
= 0¶ link TBPRD:TBPRDHR registers
-
enumerator
EPWM_LINK_COMP_A
= 4¶ link COMPA registers
-
enumerator
EPWM_LINK_COMP_B
= 8¶ link COMPB registers
-
enumerator
EPWM_LINK_COMP_C
= 12¶ link COMPC registers
-
enumerator
EPWM_LINK_COMP_D
= 16¶ link COMPD registers
-
enumerator
EPWM_LINK_GLDCTL2
= 28¶ link GLDCTL2 registers
-
enumerator
-
enum
EPWM_CounterCompareModule
¶ Values that can be passed to the EPWM_getCounterCompareShadowStatus(), EPWM_setCounterCompareValue(), EPWM_setCounterCompareShadowLoadMode(), EPWM_disableCounterCompareShadowLoadMode() as the compModule parameter.
Values:
-
enumerator
EPWM_COUNTER_COMPARE_A
= 0¶ counter compare A
-
enumerator
EPWM_COUNTER_COMPARE_B
= 2¶ counter compare B
-
enumerator
EPWM_COUNTER_COMPARE_C
= 5¶ counter compare C
-
enumerator
EPWM_COUNTER_COMPARE_D
= 7¶ counter compare D
-
enumerator
-
enum
EPWM_CounterCompareLoadMode
¶ Values that can be passed to EPWM_setCounterCompareShadowLoadMode() as the loadMode parameter.
Values:
-
enumerator
EPWM_COMP_LOAD_ON_CNTR_ZERO
= 0¶ load when counter equals zero
-
enumerator
EPWM_COMP_LOAD_ON_CNTR_PERIOD
= 1¶ load when counter equals period
-
enumerator
EPWM_COMP_LOAD_ON_CNTR_ZERO_PERIOD
= 2¶ load when counter equals zero or period
-
enumerator
EPWM_COMP_LOAD_FREEZE
= 3¶ Freeze shadow to active load.
-
enumerator
EPWM_COMP_LOAD_ON_SYNC_CNTR_ZERO
= 4¶ load when counter equals zero
-
enumerator
EPWM_COMP_LOAD_ON_SYNC_CNTR_PERIOD
= 5¶ load when counter equals period
-
enumerator
EPWM_COMP_LOAD_ON_SYNC_CNTR_ZERO_PERIOD
= 6¶ load when counter equals zero or period
-
enumerator
EPWM_COMP_LOAD_ON_SYNC_ONLY
= 8¶ load on sync only
-
enumerator
-
enum
EPWM_ActionQualifierModule
¶ Values that can be passed to EPWM_setActionQualifierShadowLoadMode() and EPWM_disableActionQualifierShadowLoadMode() as the aqModule parameter.
Values:
-
enumerator
EPWM_ACTION_QUALIFIER_A
= 0¶ Action Qualifier A.
-
enumerator
EPWM_ACTION_QUALIFIER_B
= 2¶ Action Qualifier B.
-
enumerator
-
enum
EPWM_ActionQualifierLoadMode
¶ Values that can be passed to EPWM_setActionQualifierShadowLoadMode() as the loadMode parameter.
Values:
-
enumerator
EPWM_AQ_LOAD_ON_CNTR_ZERO
= 0¶ load when counter equals zero
-
enumerator
EPWM_AQ_LOAD_ON_CNTR_PERIOD
= 1¶ load when counter equals period
-
enumerator
EPWM_AQ_LOAD_ON_CNTR_ZERO_PERIOD
= 2¶ load when counter equals zero or period
-
enumerator
EPWM_AQ_LOAD_FREEZE
= 3¶ Freeze shadow to active load.
-
enumerator
EPWM_AQ_LOAD_ON_SYNC_CNTR_ZERO
= 4¶ load on sync or when counter equals zero
-
enumerator
EPWM_AQ_LOAD_ON_SYNC_CNTR_PERIOD
= 5¶ load on sync or when counter equals period
-
enumerator
EPWM_AQ_LOAD_ON_SYNC_CNTR_ZERO_PERIOD
= 6¶ load on sync or when counter equals zero or period
-
enumerator
EPWM_AQ_LOAD_ON_SYNC_ONLY
= 8¶ load on sync only
-
enumerator
-
enum
EPWM_ActionQualifierTriggerSource
¶ Values that can be passed to EPWM_setActionQualifierT1TriggerSource() and EPWM_setActionQualifierT2TriggerSource() as the trigger parameter.
Values:
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_1
= 0¶ Digital compare event A 1.
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2
= 1¶ Digital compare event A 2.
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_DCB_1
= 2¶ Digital compare event B 1.
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_DCB_2
= 3¶ Digital compare event B 2.
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_1
= 4¶ Trip zone 1.
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_2
= 5¶ Trip zone 2.
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_3
= 6¶ Trip zone 3.
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_EPWM_SYNCIN
= 7¶ ePWM sync
-
enumerator
EPWM_AQ_TRIGGER_EVENT_TRIG_DC_EVTFILT
= 8¶ Digital compare filter event.
-
enumerator
-
enum
EPWM_ActionQualifierOutputEvent
¶ Values that can be passed to EPWM_setActionQualifierAction() as the event parameter.
Values:
-
enumerator
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO
= 0¶ Time base counter equals zero.
-
enumerator
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD
= 2¶ Time base counter equals period.
-
enumerator
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA
= 4¶ Time base counter up equals COMPA.
-
enumerator
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA
= 6¶ Time base counter down equals COMPA.
-
enumerator
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB
= 8¶ Time base counter up equals COMPB.
-
enumerator
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB
= 10¶ Time base counter down equals COMPB.
-
enumerator
EPWM_AQ_OUTPUT_ON_T1_COUNT_UP
= 1¶ T1 event on count up.
-
enumerator
EPWM_AQ_OUTPUT_ON_T1_COUNT_DOWN
= 3¶ T1 event on count down.
-
enumerator
EPWM_AQ_OUTPUT_ON_T2_COUNT_UP
= 5¶ T2 event on count up.
-
enumerator
EPWM_AQ_OUTPUT_ON_T2_COUNT_DOWN
= 7¶ T2 event on count down.
-
enumerator
-
enum
EPWM_ActionQualifierOutput
¶ Values that can be passed to EPWM_setActionQualifierSWAction(), EPWM_setActionQualifierAction() as the outPut parameter.
Values:
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE
= 0¶ No change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW
= 1¶ Set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH
= 2¶ Set output pins to High.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE
= 3¶ Toggle the output pins.
-
enumerator
-
enum
EPWM_ActionQualifierSWOutput
¶ Values that can be passed to EPWM_setActionQualifierContSWForceAction() as the outPut parameter.
Values:
-
enumerator
EPWM_AQ_SW_DISABLED
= 0¶ Software forcing disabled.
-
enumerator
EPWM_AQ_SW_OUTPUT_LOW
= 1¶ Set output pins to low.
-
enumerator
EPWM_AQ_SW_OUTPUT_HIGH
= 2¶ Set output pins to High.
-
enumerator
-
enum
EPWM_ActionQualifierEventAction
¶ Values that can be passed to EPWM_setActionQualifierActionComplete() as the action parameter.
Values:
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_ZERO
= 0x0¶ Time base counter equals zero and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_ZERO
= 0x1¶ Time base counter equals zero and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_ZERO
= 0x2¶ Time base counter equals zero and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_ZERO
= 0x3¶ Time base counter equals zero and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_PERIOD
= 0x0¶ Time base counter equals period and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_PERIOD
= 0x4¶ Time base counter equals period and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_PERIOD
= 0x8¶ Time base counter equals period and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_PERIOD
= 0xC¶ Time base counter equals period and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_UP_CMPA
= 0x00¶ Time base counter up equals COMPA and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_UP_CMPA
= 0x10¶ Time base counter up equals COMPA and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_UP_CMPA
= 0x20¶ Time base counter up equals COMPA and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_UP_CMPA
= 0x30¶ Time base counter up equals COMPA and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_CMPA
= 0x00¶ Time base counter down equals COMPA and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_DOWN_CMPA
= 0x40¶ Time base counter down equals COMPA and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_DOWN_CMPA
= 0x80¶ Time base counter down equals COMPA and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_DOWN_CMPA
= 0xC0¶ Time base counter down equals COMPA and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_UP_CMPB
= 0x000¶ Time base counter up equals COMPB and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_UP_CMPB
= 0x100¶ Time base counter up equals COMPB and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_UP_CMPB
= 0x200¶ Time base counter up equals COMPB and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_UP_CMPB
= 0x300¶ Time base counter up equals COMPB and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_CMPB
= 0x000¶ Time base counter down equals COMPB and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_DOWN_CMPB
= 0x400¶ Time base counter down equals COMPB and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_DOWN_CMPB
= 0x800¶ Time base counter down equals COMPB and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_DOWN_CMPB
= 0xC00¶ Time base counter down equals COMPB and toggle the output pins.
-
enumerator
-
enum
EPWM_AdditionalActionQualifierEventAction
¶ Values that can be passed to EPWM_setAdditionalActionQualifierActionComplete() as the action parameter.
Values:
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_UP_T1
= 0x0¶ T1 event on count up and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_UP_T1
= 0x1¶ T1 event on count up and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_UP_T1
= 0x2¶ T1 event on count up and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_UP_T1
= 0x3¶ T1 event on count up and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_T1
= 0x0¶ T1 event on count down and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_DOWN_T1
= 0x4¶ T1 event on count down and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_DOWN_T1
= 0x8¶ T1 event on count down and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_DOWN_T1
= 0xC¶ T1 event on count down and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_UP_T2
= 0x00¶ T2 event on count up and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_UP_T2
= 0x10¶ T2 event on count up and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_UP_T2
= 0x20¶ T2 event on count up and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_UP_T2
= 0x30¶ T2 event on count up and toggle the output pins.
-
enumerator
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_T2
= 0x00¶ T2 event on count down and no change in the output pins.
-
enumerator
EPWM_AQ_OUTPUT_LOW_DOWN_T2
= 0x40¶ T2 event on count down and set output pins to low.
-
enumerator
EPWM_AQ_OUTPUT_HIGH_DOWN_T2
= 0x80¶ T2 event on count down and set output pins to high.
-
enumerator
EPWM_AQ_OUTPUT_TOGGLE_DOWN_T2
= 0xC0¶ T2 event on count down and toggle the output pins.
-
enumerator
-
enum
EPWM_ActionQualifierOutputModule
¶ Values that can be passed to EPWM_forceActionQualifierSWAction(), EPWM_setActionQualifierSWAction(), EPWM_setActionQualifierAction() EPWM_setActionQualifierContSWForceAction() as the epwmOutput parameter.
Values:
-
enumerator
EPWM_AQ_OUTPUT_A
= 0¶ ePWMxA output
-
enumerator
EPWM_AQ_OUTPUT_B
= 2¶ ePWMxB output
-
enumerator
-
enum
EPWM_ActionQualifierContForce
¶ Values that can be passed to EPWM_setActionQualifierContSWForceShadowMode() as the mode parameter.
Values:
-
enumerator
EPWM_AQ_SW_SH_LOAD_ON_CNTR_ZERO
= 0¶ shadow mode load when counter equals zero
-
enumerator
EPWM_AQ_SW_SH_LOAD_ON_CNTR_PERIOD
= 1¶ shadow mode load when counter equals period
-
enumerator
EPWM_AQ_SW_SH_LOAD_ON_CNTR_ZERO_PERIOD
= 2¶ shadow mode load when counter equals zero or period
-
enumerator
EPWM_AQ_SW_IMMEDIATE_LOAD
= 3¶ No shadow load mode. Immediate mode only.
-
enumerator
-
enum
EPWM_DeadBandOutput
¶ Values that can be passed to EPWM_setDeadBandOutputSwapMode() as the output parameter.
Values:
-
enumerator
EPWM_DB_OUTPUT_A
= 0¶ DB output is ePWMA.
-
enumerator
EPWM_DB_OUTPUT_B
= 1¶ DB output is ePWMB.
-
enumerator
-
enum
EPWM_DeadBandDelayMode
¶ Values that can be passed to EPWM_setDeadBandDelayPolarity(), EPWM_setDeadBandDelayMode() as the delayMode parameter.
Values:
-
enumerator
EPWM_DB_RED
= 1¶ DB RED (Rising Edge Delay) mode.
-
enumerator
EPWM_DB_FED
= 0¶ DB FED (Falling Edge Delay) mode.
-
enumerator
-
enum
EPWM_DeadBandPolarity
¶ Values that can be passed to EPWM_setDeadBandDelayPolarity as the polarity parameter.
Values:
-
enumerator
EPWM_DB_POLARITY_ACTIVE_HIGH
= 0¶ DB polarity is not inverted.
-
enumerator
EPWM_DB_POLARITY_ACTIVE_LOW
= 1¶ DB polarity is inverted.
-
enumerator
-
enum
EPWM_DeadBandControlLoadMode
¶ Values that can be passed to EPWM_setDeadBandControlShadowLoadMode() as the loadMode parameter.
Values:
-
enumerator
EPWM_DB_LOAD_ON_CNTR_ZERO
= 0¶ load when counter equals zero
-
enumerator
EPWM_DB_LOAD_ON_CNTR_PERIOD
= 1¶ load when counter equals period
-
enumerator
EPWM_DB_LOAD_ON_CNTR_ZERO_PERIOD
= 2¶ load when counter equals zero or period
-
enumerator
EPWM_DB_LOAD_FREEZE
= 3¶ Freeze shadow to active load.
-
enumerator
-
enum
EPWM_RisingEdgeDelayLoadMode
¶ Values that can be passed to EPWM_setRisingEdgeDelayCountShadowLoadMode() as the loadMode parameter.
Values:
-
enumerator
EPWM_RED_LOAD_ON_CNTR_ZERO
= 0¶ load when counter equals zero
-
enumerator
EPWM_RED_LOAD_ON_CNTR_PERIOD
= 1¶ load when counter equals period
-
enumerator
EPWM_RED_LOAD_ON_CNTR_ZERO_PERIOD
= 2¶ load when counter equals zero or period
-
enumerator
EPWM_RED_LOAD_FREEZE
= 3¶ Freeze shadow to active load.
-
enumerator
-
enum
EPWM_FallingEdgeDelayLoadMode
¶ Values that can be passed to EPWM_setFallingEdgeDelayCountShadowLoadMode() as the loadMode parameter.
Values:
-
enumerator
EPWM_FED_LOAD_ON_CNTR_ZERO
= 0¶ load when counter equals zero
-
enumerator
EPWM_FED_LOAD_ON_CNTR_PERIOD
= 1¶ load when counter equals period
-
enumerator
EPWM_FED_LOAD_ON_CNTR_ZERO_PERIOD
= 2¶ load when counter equals zero or period
-
enumerator
EPWM_FED_LOAD_FREEZE
= 3¶ Freeze shadow to active load.
-
enumerator
-
enum
EPWM_DeadBandClockMode
¶ Values that can be passed to EPWM_setDeadBandCounterClock() as the clockMode parameter.
Values:
-
enumerator
EPWM_DB_COUNTER_CLOCK_FULL_CYCLE
= 0¶ Dead band counter runs at TBCLK rate.
-
enumerator
EPWM_DB_COUNTER_CLOCK_HALF_CYCLE
= 1¶ Dead band counter runs at 2*TBCLK rate.
-
enumerator
-
enum
EPWM_TripZoneDigitalCompareOutput
¶ Values that can be passed to EPWM_setTripZoneDigitalCompareEventCondition() as the dcType parameter.
Values:
-
enumerator
EPWM_TZ_DC_OUTPUT_A1
= 0¶ Digital Compare output 1 A.
-
enumerator
EPWM_TZ_DC_OUTPUT_A2
= 3¶ Digital Compare output 2 A.
-
enumerator
EPWM_TZ_DC_OUTPUT_B1
= 6¶ Digital Compare output 1 B.
-
enumerator
EPWM_TZ_DC_OUTPUT_B2
= 9¶ Digital Compare output 2 B.
-
enumerator
-
enum
EPWM_TripZoneDigitalCompareOutputEvent
¶ Values that can be passed to EPWM_setTripZoneDigitalCompareEventCondition() as the dcEvent parameter.
Values:
-
enumerator
EPWM_TZ_EVENT_DC_DISABLED
= 0¶ Event is disabled.
-
enumerator
EPWM_TZ_EVENT_DCXH_LOW
= 1¶ Event when DCxH low.
-
enumerator
EPWM_TZ_EVENT_DCXH_HIGH
= 2¶ Event when DCxH high.
-
enumerator
EPWM_TZ_EVENT_DCXL_LOW
= 3¶ Event when DCxL low.
-
enumerator
EPWM_TZ_EVENT_DCXL_HIGH
= 4¶ Event when DCxL high.
-
enumerator
EPWM_TZ_EVENT_DCXL_HIGH_DCXH_LOW
= 5¶ Event when DCxL high DCxH low.
-
enumerator
-
enum
EPWM_TripZoneEvent
¶ Values that can be passed to EPWM_setTripZoneAction() as the tzEvent parameter.
Values:
-
enumerator
EPWM_TZ_ACTION_EVENT_TZA
= 0¶ TZ1 - TZ6, DCAEVT2, DCAEVT1.
-
enumerator
EPWM_TZ_ACTION_EVENT_TZB
= 2¶ TZ1 - TZ6, DCBEVT2, DCBEVT1.
-
enumerator
EPWM_TZ_ACTION_EVENT_DCAEVT1
= 4¶ DCAEVT1 (Digital Compare A event 1)
-
enumerator
EPWM_TZ_ACTION_EVENT_DCAEVT2
= 6¶ DCAEVT2 (Digital Compare A event 2)
-
enumerator
EPWM_TZ_ACTION_EVENT_DCBEVT1
= 8¶ DCBEVT1 (Digital Compare B event 1)
-
enumerator
EPWM_TZ_ACTION_EVENT_DCBEVT2
= 10¶ DCBEVT2 (Digital Compare B event 2)
-
enumerator
-
enum
EPWM_TripZoneAction
¶ Values that can be passed to EPWM_setTripZoneAction() as the tzAction parameter.
Values:
-
enumerator
EPWM_TZ_ACTION_HIGH_Z
= 0¶ high impedance output
-
enumerator
EPWM_TZ_ACTION_HIGH
= 1¶ high voltage state
-
enumerator
EPWM_TZ_ACTION_LOW
= 2¶ low voltage state
-
enumerator
EPWM_TZ_ACTION_DISABLE
= 3¶ disable action
-
enumerator
-
enum
EPWM_TripZoneAdvancedEvent
¶ Values that can be passed to EPWM_setTripZoneAdvAction() as the tzAdvEvent parameter.
Values:
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_TZB_D
= 9¶ TZ1 - TZ6, DCBEVT2, DCBEVT1 while counting down.
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_TZB_U
= 6¶ TZ1 - TZ6, DCBEVT2, DCBEVT1 while counting up.
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_TZA_D
= 3¶ TZ1 - TZ6, DCAEVT2, DCAEVT1 while counting down.
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_TZA_U
= 0¶ TZ1 - TZ6, DCAEVT2, DCAEVT1 while counting up.
-
enumerator
-
enum
EPWM_TripZoneAdvancedAction
¶ Values that can be passed to EPWM_setTripZoneAdvDigitalCompareActionA(), EPWM_setTripZoneAdvDigitalCompareActionB(),EPWM_setTripZoneAdvAction() as the tzAdvDCAction parameter.
Values:
-
enumerator
EPWM_TZ_ADV_ACTION_HIGH_Z
= 0¶ high impedance output
-
enumerator
EPWM_TZ_ADV_ACTION_HIGH
= 1¶ high voltage state
-
enumerator
EPWM_TZ_ADV_ACTION_LOW
= 2¶ low voltage state
-
enumerator
EPWM_TZ_ADV_ACTION_TOGGLE
= 3¶ toggle the output
-
enumerator
EPWM_TZ_ADV_ACTION_DISABLE
= 7¶ disable action
-
enumerator
-
enum
EPWM_TripZoneAdvDigitalCompareEvent
¶ Values that can be passed to EPWM_setTripZoneAdvDigitalCompareActionA() and EPWM_setTripZoneAdvDigitalCompareActionB() as the tzAdvDCEvent parameter.
Values:
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_U
= 0¶ Digital Compare event A/B 1 while counting up.
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_D
= 3¶ Digital Compare event A/B 1 while counting down.
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_U
= 6¶ Digital Compare event A/B 2 while counting up.
-
enumerator
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_D
= 9¶ Digital Compare event A/B 2 while counting down.
-
enumerator
-
enum
EPWM_CycleByCycleTripZoneClearMode
¶ Values that can be passed to EPWM_selectCycleByCycleTripZoneClearEvent() as the clearMode parameter.
Values:
-
enumerator
EPWM_TZ_CBC_PULSE_CLR_CNTR_ZERO
= 0¶ Clear CBC pulse when counter equals zero.
-
enumerator
EPWM_TZ_CBC_PULSE_CLR_CNTR_PERIOD
= 1¶ Clear CBC pulse when counter equals period.
-
enumerator
EPWM_TZ_CBC_PULSE_CLR_CNTR_ZERO_PERIOD
= 2¶ Clear CBC pulse when counter equals zero or period.
-
enumerator
-
enum
EPWM_ADCStartOfConversionType
¶ Values that can be passed to EPWM_enableADCTrigger(), EPWM_disableADCTrigger(),EPWM_setADCTriggerSource(), EPWM_setADCTriggerEventPrescale(),EPWM_getADCTriggerFlagStatus(), EPWM_clearADCTriggerFlag(),EPWM_enableADCTriggerEventCountInit(), EPWM_disableADCTriggerEventCountInit(),EPWM_forceADCTriggerEventCountInit(), EPWM_setADCTriggerEventCountInitValue(),EPWM_getADCTriggerEventCount(), EPWM_forceADCTrigger() as the adcSOCType parameter
Values:
-
enumerator
EPWM_SOC_A
= 0¶ SOC A.
-
enumerator
EPWM_SOC_B
= 1¶ SOC B.
-
enumerator
-
enum
EPWM_ADCStartOfConversionSource
¶ Values that can be passed to EPWM_setADCTriggerSource() as the socSource parameter.
Values:
-
enumerator
EPWM_SOC_DCxEVT1
= 0¶ Event is based on DCxEVT1.
-
enumerator
EPWM_SOC_TBCTR_ZERO
= 1¶ Time-base counter equal to zero.
-
enumerator
EPWM_SOC_TBCTR_PERIOD
= 2¶ Time-base counter equal to period.
-
enumerator
EPWM_SOC_TBCTR_ZERO_OR_PERIOD
= 3¶ Time-base counter equal to zero or period.
-
enumerator
EPWM_SOC_TBCTR_U_CMPA
= 4¶ time-base counter equal to CMPA when the timer is incrementing
-
enumerator
EPWM_SOC_TBCTR_U_CMPC
= 8¶ time-base counter equal to CMPC when the timer is incrementing
-
enumerator
EPWM_SOC_TBCTR_D_CMPA
= 5¶ time-base counter equal to CMPA when the timer is decrementing
-
enumerator
EPWM_SOC_TBCTR_D_CMPC
= 10¶ time-base counter equal to CMPC when the timer is decrementing
-
enumerator
EPWM_SOC_TBCTR_U_CMPB
= 6¶ time-base counter equal to CMPB when the timer is incrementing
-
enumerator
EPWM_SOC_TBCTR_U_CMPD
= 12¶ time-base counter equal to CMPD when the timer is incrementing
-
enumerator
EPWM_SOC_TBCTR_D_CMPB
= 7¶ time-base counter equal to CMPB when the timer is decrementing
-
enumerator
EPWM_SOC_TBCTR_D_CMPD
= 14¶ time-base counter equal to CMPD when the timer is decrementing
-
enumerator
-
enum
EPWM_DigitalCompareType
¶ Values that can be passed to EPWM_selectDigitalCompareTripInput(), EPWM_enableDigitalCompareTripCombinationInput(), EPWM_disableDigitalCompareTripCombinationInput() as the dcType parameter.
Values:
-
enumerator
EPWM_DC_TYPE_DCAH
= 0¶ Digital Compare A High.
-
enumerator
EPWM_DC_TYPE_DCAL
= 1¶ Digital Compare A Low.
-
enumerator
EPWM_DC_TYPE_DCBH
= 2¶ Digital Compare B High.
-
enumerator
EPWM_DC_TYPE_DCBL
= 3¶ Digital Compare B Low.
-
enumerator
-
enum
EPWM_DigitalCompareTripInput
¶ Values that can be passed to EPWM_selectDigitalCompareTripInput() as the tripSource parameter.
Values:
-
enumerator
EPWM_DC_TRIP_TRIPIN1
= 0¶ Trip 1.
-
enumerator
EPWM_DC_TRIP_TRIPIN2
= 1¶ Trip 2.
-
enumerator
EPWM_DC_TRIP_TRIPIN3
= 2¶ Trip 3.
-
enumerator
EPWM_DC_TRIP_TRIPIN4
= 3¶ Trip 4.
-
enumerator
EPWM_DC_TRIP_TRIPIN5
= 4¶ Trip 5.
-
enumerator
EPWM_DC_TRIP_TRIPIN6
= 5¶ Trip 6.
-
enumerator
EPWM_DC_TRIP_TRIPIN7
= 6¶ Trip 7.
-
enumerator
EPWM_DC_TRIP_TRIPIN8
= 7¶ Trip 8.
-
enumerator
EPWM_DC_TRIP_TRIPIN9
= 8¶ Trip 9.
-
enumerator
EPWM_DC_TRIP_TRIPIN10
= 9¶ Trip 10.
-
enumerator
EPWM_DC_TRIP_TRIPIN11
= 10¶ Trip 11.
-
enumerator
EPWM_DC_TRIP_TRIPIN12
= 11¶ Trip 12.
-
enumerator
EPWM_DC_TRIP_TRIPIN14
= 13¶ Trip 14.
-
enumerator
EPWM_DC_TRIP_TRIPIN15
= 14¶ Trip 15.
-
enumerator
EPWM_DC_TRIP_COMBINATION
= 15¶ All Trips (Trip1 - Trip 15) are selected.
-
enumerator
-
enum
EPWM_DigitalCompareBlankingPulse
¶ Values that can be passed to EPWM_setDigitalCompareBlankingEvent() as the the blankingPulse parameter.
Values:
-
enumerator
EPWM_DC_WINDOW_START_TBCTR_PERIOD
= 0¶ Time base counter equals period.
-
enumerator
EPWM_DC_WINDOW_START_TBCTR_ZERO
= 1¶ Time base counter equals zero.
-
enumerator
EPWM_DC_WINDOW_START_TBCTR_ZERO_PERIOD
= 2¶ Time base counter equals zero.
-
enumerator
-
enum
EPWM_DigitalCompareFilterInput
¶ Values that can be passed to EPWM_setDigitalCompareFilterInput() as the filterInput parameter.
Values:
-
enumerator
EPWM_DC_WINDOW_SOURCE_DCAEVT1
= 0¶ DC filter signal source is DCAEVT1.
-
enumerator
EPWM_DC_WINDOW_SOURCE_DCAEVT2
= 1¶ DC filter signal source is DCAEVT2.
-
enumerator
EPWM_DC_WINDOW_SOURCE_DCBEVT1
= 2¶ DC filter signal source is DCBEVT1.
-
enumerator
EPWM_DC_WINDOW_SOURCE_DCBEVT2
= 3¶ DC filter signal source is DCBEVT2.
-
enumerator
-
enum
EPWM_DigitalCompareModule
¶ Values that can be assigned to EPWM_setDigitalCompareEventSource(), EPWM_setDigitalCompareEventSyncMode(),EPWM_enableDigitalCompareSyncEvent() EPWM_enableDigitalCompareADCTrigger(),EPWM_disableDigitalCompareSyncEvent() EPWM_disableDigitalCompareADCTrigger() as the dcModule parameter.
Values:
-
enumerator
EPWM_DC_MODULE_A
= 0¶ Digital Compare Module A.
-
enumerator
EPWM_DC_MODULE_B
= 1¶ Digital Compare Module B.
-
enumerator
-
enum
EPWM_DigitalCompareEvent
¶ Values that can be passed to EPWM_setDigitalCompareEventSource(), EPWM_setDigitalCompareEventSyncMode as the dcEvent parameter.
Values:
-
enumerator
EPWM_DC_EVENT_1
= 0¶ Digital Compare Event number 1.
-
enumerator
EPWM_DC_EVENT_2
= 1¶ Digital Compare Event number 2.
-
enumerator
-
enum
EPWM_DigitalCompareEventSource
¶ Values that can be passed to EPWM_setDigitalCompareEventSource() as the dcEventSource parameter.
Values:
-
enumerator
EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL
= 0¶ signal source is unfiltered (DCAEVT1/2)
-
enumerator
EPWM_DC_EVENT_SOURCE_FILT_SIGNAL
= 1¶ signal source is filtered (DCEVTFILT)
-
enumerator
-
enum
EPWM_DigitalCompareSyncMode
¶ Values that can be passed to EPWM_setDigitalCompareEventSyncMode() as the syncMode parameter.
Values:
-
enumerator
EPWM_DC_EVENT_INPUT_SYNCED
= 0¶ DC input signal is synced with TBCLK.
-
enumerator
EPWM_DC_EVENT_INPUT_NOT_SYNCED
= 1¶ DC input signal is not synced with TBCLK.
-
enumerator
-
enum
EPWM_DigitalCompareCBCLatchMode
¶ Values that can be passed to EPWM_setDigitalCompareCBCLatchMode() as the latchMode parameter.
Values:
-
enumerator
EPWM_DC_CBC_LATCH_DISABLED
= 0x0¶ DC cycle-by-cycle(CBC) latch is disabled.
-
enumerator
EPWM_DC_CBC_LATCH_ENABLED
= 0x1¶ DC cycle-by-cycle(CBC) latch is enabled.
-
enumerator
-
enum
EPWM_DigitalCompareCBCLatchClearEvent
¶ Values that can be passed to EPWM_selectDigitalCompareCBCLatchClearEvent() as the latchMode parameter.
Values:
-
enumerator
EPWM_DC_CBC_LATCH_CLR_CNTR_ZERO
= 0x0¶ Clear CBC latch when counter equals zero.
-
enumerator
EPWM_DC_CBC_LATCH_CLR_ON_CNTR_PERIOD
= 0x1¶ Clear CBC latch when counter equals period.
-
enumerator
EPWM_DC_CBC_LATCH_CLR_ON_CNTR_ZERO_PERIOD
= 0x2¶ Clear CBC latch when counter equals zero or period.
-
enumerator
-
enum
EPWM_GlobalLoadTrigger
¶ Values that can be passed to EPWM_setGlobalLoadTrigger() as the loadTrigger parameter.
Values:
-
enumerator
EPWM_GL_LOAD_PULSE_CNTR_ZERO
= 0x0¶ load when counter is equal to zero
-
enumerator
EPWM_GL_LOAD_PULSE_CNTR_PERIOD
= 0x1¶ load when counter is equal to period
-
enumerator
EPWM_GL_LOAD_PULSE_CNTR_ZERO_PERIOD
= 0x2¶ load when counter is equal to zero or period
-
enumerator
EPWM_GL_LOAD_PULSE_SYNC
= 0x3¶ load on sync event
-
enumerator
EPWM_GL_LOAD_PULSE_SYNC_OR_CNTR_ZERO
= 0x4¶ load on sync event or when counter is equal to zero
-
enumerator
EPWM_GL_LOAD_PULSE_SYNC_OR_CNTR_PERIOD
= 0x5¶ load on sync event or when counter is equal to period
-
enumerator
EPWM_GL_LOAD_PULSE_SYNC_CNTR_ZERO_PERIOD
= 0x6¶ load on sync event or when counter is equal to period or zero
-
enumerator
EPWM_GL_LOAD_PULSE_GLOBAL_FORCE
= 0xF¶ load on global force
-
enumerator
-
enum
EPWM_ValleyTriggerSource
¶ Values that can be passed to EPWM_setValleyTriggerSource() as the trigger parameter.
Values:
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_SOFTWARE
= 0U¶ Valley capture trigged by software.
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_CNTR_ZERO
= 1U¶ Valley capture trigged by when counter is equal to zero.
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_CNTR_PERIOD
= 2U¶ Valley capture trigged by when counter is equal period.
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_CNTR_ZERO_PERIOD
= 3U¶ Valley capture trigged when counter is equal to zero or period.
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_DCAEVT1
= 4U¶ Valley capture trigged by DCAEVT1 (Digital Compare A event 1)
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_DCAEVT2
= 5U¶ Valley capture trigged by DCAEVT2 (Digital Compare A event 2)
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_DCBEVT1
= 6U¶ Valley capture trigged by DCBEVT1 (Digital Compare B event 1)
-
enumerator
EPWM_VALLEY_TRIGGER_EVENT_DCBEVT2
= 7U¶ Valley capture trigged by DCBEVT2 (Digital Compare B event 2)
-
enumerator
-
enum
EPWM_ValleyCounterEdge
¶ Values that can be passed to EPWM_getValleyCountEdgeStatus() as the edge parameter.
Values:
-
enumerator
EPWM_VALLEY_COUNT_START_EDGE
= 0¶ Valley count start edge.
-
enumerator
EPWM_VALLEY_COUNT_STOP_EDGE
= 1¶ Valley count stop edge.
-
enumerator
-
enum
EPWM_ValleyDelayMode
¶ Values that can be passed to EPWM_setValleyDelayValue() as the delayMode parameter.
Values:
-
enumerator
EPWM_VALLEY_DELAY_MODE_SW_DELAY
= 0U¶ Delay value equals the offset value defines by software.
-
enumerator
EPWM_VALLEY_DELAY_MODE_VCNT_DELAY_SW_DELAY
= 1U¶ Delay value equals the sum of the Hardware counter value and the offset value defines by software
-
enumerator
EPWM_VALLEY_DELAY_MODE_VCNT_DELAY_SHIFT_1_SW_DELAY
= 2U¶ Delay value equals the the Hardware counter shifted by (1 + the offset value defines by software)
-
enumerator
EPWM_VALLEY_DELAY_MODE_VCNT_DELAY_SHIFT_2_SW_DELAY
= 3U¶ Delay value equals the the Hardware counter shifted by (2 + the offset value defines by software)
-
enumerator
EPWM_VALLEY_DELAY_MODE_VCNT_DELAY_SHIFT_4_SW_DELAY
= 4U¶ Delay value equals the the Hardware counter shifted by (4 + the offset value defines by software)
-
enumerator
-
enum
EPWM_DigitalCompareEdgeFilterMode
¶ Values that can be passed to EPWM_setDigitalCompareEdgeFilterMode() as the edgeMode parameter.
Values:
-
enumerator
EPWM_DC_EDGEFILT_MODE_RISING
= 0¶ Digital Compare Edge filter low to high edge mode
-
enumerator
EPWM_DC_EDGEFILT_MODE_FALLING
= 1¶ Digital Compare Edge filter high to low edge mode
-
enumerator
EPWM_DC_EDGEFILT_MODE_BOTH
= 2¶ Digital Compare Edge filter both edges mode
-
enumerator
-
enum
EPWM_DigitalCompareEdgeFilterEdgeCount
¶ Values that can be passed to EPWM_setDigitalCompareEdgeFilterEdgeCount() as the edgeCount parameter.
Values:
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_0
= 0¶ Digital Compare Edge filter edge count = 0
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_1
= 1¶ Digital Compare Edge filter edge count = 1
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_2
= 2¶ Digital Compare Edge filter edge count = 2
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_3
= 3¶ Digital Compare Edge filter edge count = 3
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_4
= 4¶ Digital Compare Edge filter edge count = 4
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_5
= 5¶ Digital Compare Edge filter edge count = 5
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_6
= 6¶ Digital Compare Edge filter edge count = 6
-
enumerator
EPWM_DC_EDGEFILT_EDGECNT_7
= 7¶ Digital Compare Edge filter edge count = 7
-
enumerator
-
enum
EPWM_LockRegisterGroup
¶ Values that can be passed to EPWM_lockRegisters() as the registerGroup parameter.
Values:
-
enumerator
EPWM_REGISTER_GROUP_GLOBAL_LOAD
= 0x2¶ Global load register group.
-
enumerator
EPWM_REGISTER_GROUP_TRIP_ZONE
= 0x4¶ Trip zone register group.
-
enumerator
EPWM_REGISTER_GROUP_TRIP_ZONE_CLEAR
= 0x8¶ Trip zone clear group.
-
enumerator
EPWM_REGISTER_GROUP_DIGITAL_COMPARE
= 0x10¶ Digital compare group.
-
enumerator
Functions
-
void
EPWM_setTimeBaseCounter
(uint32_t base, uint16_t count)¶ Set the time base count
This function sets the 16 bit counter value of the time base counter.
- Parameters
base
: is the base address of the EPWM module.count
: is the time base count value.
- Return
None.
-
void
EPWM_setCountModeAfterSync
(uint32_t base, EPWM_SyncCountMode mode)¶ Set count mode after phase shift sync
This function sets the time base count to count up or down after a new phase value set by the
EPWM_setPhaseShift(). The count direction is determined by the variable mode. Valid inputs for mode are:EPWM_COUNT_MODE_UP_AFTER_SYNC - Count up after sync
EPWM_COUNT_MODE_DOWN_AFTER_SYNC - Count down after sync
- Parameters
base
: is the base address of the EPWM module.mode
: is the count mode.
- Return
None.
-
void
EPWM_setClockPrescaler
(uint32_t base, EPWM_ClockDivider prescaler, EPWM_HSClockDivider highSpeedPrescaler)¶ Set the time base clock and the high speed time base clock count pre-scaler
This function sets the pre scaler(divider)value for the time base clock counter and the high speed time base clock counter. Valid values for pre-scaler and highSpeedPrescaler are EPWM_CLOCK_DIVIDER_X, where X is 1,2,4,8,16, 32,64 or 128. The actual numerical values for these macros represent values 0,1…7. The equation for the output clock is: TBCLK = EPWMCLK/(highSpeedPrescaler * pre-scaler)
- Parameters
base
: is the base address of the EPWM module.prescaler
: is the time base count pre scale value.highSpeedPrescaler
: is the high speed time base count pre scale value.
Note: EPWMCLK is a scaled version of SYSCLK. At reset EPWMCLK is half SYSCLK.
- Return
None.
-
void
EPWM_forceSyncPulse
(uint32_t base)¶ Force a software sync pulse
This function causes a single software initiated sync pulse. Make sure the appropriate mode is selected using EPWM_setupSyncOutputMode() before using this function.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setSyncInPulseSource
(uint32_t base, EPWM_SyncInPulseSource source)¶ Set up the source for sync-in pulse.
This function set the sync out pulse mode. Valid values for mode are:
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1-16 - sync-in pulse source can be any of the EPWM1-16 sync-out signal
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_ECAP1-7 - sync-in pulse source can be selected as any of the ECAP1-16 sync-out signal
EPWM_SYNC_IN_PULSE_SRC_INPUTXBAR_OUT5-6 - sync-in pulse source can be selected as any of the Input xbar out5-6 signal
EPWM_SYNC_IN_PULSE_SRC_ETHERCAT_SYNC0-1 - sync-in pulse source can be selected as any of the Ethercat sync0-1 signal
EPWM_SYNC_IN_PULSE_SRC_DISABLE - sync-in pulse is disabled for the EPWM module
- Parameters
base
: is the base address of the EPWM module.source
: is the sync-in pulse source.
- Return
None.
-
void
EPWM_enableSyncOutPulseSource
(uint32_t base, uint16_t source)¶ Enables sync-out pulse source.
This function enables the sync-out pulse source. Below valid values for param
source can be OR’d together to enable multiple sync-out sources:EPWM_SYNC_OUT_PULSE_ON_SOFTWARE - sync-out pulse is generated by software when EPWM_forceSyncPulse() function is called or by EPWMxSYNCI signal.
EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO - sync-out pulse is generated when time base counter equals zero.
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_B - sync-out pulse is generated when time base counter equals compare B value.
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_C - sync-out pulse is generated when time base counter equals compare C value.
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_D - sync-out pulse is generated when time base counter equals compare D value.
EPWM_SYNC_OUT_PULSE_ON_DCA_EVT1_SYNC - sync-out pulse is generated by DCA event1 sync signal
EPWM_SYNC_OUT_PULSE_ON_DCB_EVT1_SYNC - sync-out pulse is generated by DCB event1 sync signal
EPWM_SYNC_OUT_PULSE_ON_ALL - sync-out pulse is generated by all the above sources
- Parameters
base
: is the base address of the EPWM module.source
: is the sync-out pulse source.
- Return
None.
-
void
EPWM_disableSyncOutPulseSource
(uint32_t base, uint16_t source)¶ Disables sync-out pulse source.
This function disables the sync-out pulse source. Below valid values for param
source can be OR’d together to disable multiple sync-out sources:EPWM_SYNC_OUT_PULSE_ON_SOFTWARE - disables software as sync-out source
EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO - disables counter equal to zero event as sync-out source
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_B - disables counter equal to cmpb event as sync-out source
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_C - disables counter equal to cmpc event as sync-out source
EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_D - disables counter equal to cmpd event as sync-out source
EPWM_SYNC_OUT_PULSE_ON_DCA_EVT1_SYNC - disables DCA event1 sync signal as sync-out source
EPWM_SYNC_OUT_PULSE_ON_DCB_EVT1_SYNC - disables DCB event1 sync signal as sync-out source
EPWM_SYNC_OUT_PULSE_ON_ALL - disables all the above sync-out sources
- Parameters
base
: is the base address of the EPWM module.source
: is the sync-out pulse source.
- Return
None.
-
void
EPWM_setOneShotSyncOutTrigger
(uint32_t base, EPWM_OneShotSyncOutTrigger trigger)¶ Set up the one-shot sync-out trigger source.
This function sets the one-shot sync-out trigger source. Valid values for param
trigger are:EPWM_OSHT_SYNC_OUT_TRIG_SYNC - Trigger for one-shot sync-out signal is one-shot sync event.
EPWM_OSHT_SYNC_OUT_TRIG_RELOAD - Trigger for one-shot sync-out signal is one-shot reload event.
- Parameters
base
: is the base address of the EPWM module.trigger
: is the one-shot sync-out signal trigger source.
- Return
None.
-
void
EPWM_setPeriodLoadMode
(uint32_t base, EPWM_PeriodLoadMode loadMode)¶ Set PWM period load mode.
This function sets the load mode for the PWM period. If loadMode is set to EPWM_PERIOD_SHADOW_LOAD, a write or read to the TBPRD (PWM Period count register) accesses the shadow register. If loadMode is set to EPWM_PERIOD_DIRECT_LOAD, a write or read to the TBPRD register accesses the register directly.
- Parameters
base
: is the base address of the EPWM module.loadMode
: is the PWM period load mode.
- Return
None.
-
void
EPWM_enablePhaseShiftLoad
(uint32_t base)¶ Enable phase shift load
This function enables loading of phase shift when the appropriate sync event occurs.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disablePhaseShiftLoad
(uint32_t base)¶ Disable phase shift load
This function disables loading of phase shift.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setTimeBaseCounterMode
(uint32_t base, EPWM_TimeBaseCountMode counterMode)¶ Set time base counter mode
This function sets up the time base counter mode. Valid values for counterMode are:
EPWM_COUNTER_MODE_UP - Up - count mode.
EPWM_COUNTER_MODE_DOWN - Down - count mode.
EPWM_COUNTER_MODE_UP_DOWN - Up - down - count mode.
EPWM_COUNTER_MODE_STOP_FREEZE - Stop - Freeze counter.
- Parameters
base
: is the base address of the EPWM module.counterMode
: is the time base counter mode.
- Return
None.
-
void
EPWM_selectPeriodLoadEvent
(uint32_t base, EPWM_PeriodShadowLoadMode shadowLoadMode)¶ Set shadow to active period load on sync mode
This function sets up the shadow to active Period register load mode with respect to a sync event. Valid values for shadowLoadMode are:
EPWM_SHADOW_LOAD_MODE_COUNTER_ZERO - shadow to active load occurs when time base counter reaches 0.
EPWM_SHADOW_LOAD_MODE_COUNTER_SYNC - shadow to active load occurs when time base counter reaches 0 and a SYNC occurs.
EPWM_SHADOW_LOAD_MODE_SYNC - shadow to active load occurs only when a SYNC occurs.
- Parameters
base
: is the base address of the EPWM module.shadowLoadMode
: is the shadow to active load mode.
- Return
None.
-
void
EPWM_enableOneShotSync
(uint32_t base)¶ Enable one shot sync mode
This function enables one shot sync mode.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableOneShotSync
(uint32_t base)¶ Disable one shot sync mode
This function disables one shot sync mode.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_startOneShotSync
(uint32_t base)¶ Start one shot sync mode
This function propagates a one shot sync pulse.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
uint16_t
EPWM_getTimeBaseCounterValue
(uint32_t base)¶ Returns time base counter value.
This function returns the current value of the time base counter.
- Parameters
base
: is the base address of the EPWM module.
- Return
returns time base counter value
-
bool
EPWM_getTimeBaseCounterOverflowStatus
(uint32_t base)¶ Return time base counter maximum status.
This function returns the status of the time base max counter.
- Parameters
base
: is the base address of the EPWM module.
- Return
Returns true if the counter has reached 0xFFFF. Returns false if the counter hasn’t reached 0xFFFF.
-
void
EPWM_clearTimeBaseCounterOverflowEvent
(uint32_t base)¶ Clear max time base counter event.
This function clears the max time base counter latch event. The latch event occurs when the time base counter reaches its maximum value of 0xFFFF.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
bool
EPWM_getSyncStatus
(uint32_t base)¶ Return external sync signal status.
This function returns the external sync signal status.
- Parameters
base
: is the base address of the EPWM module.
- Return
Returns true if if an external sync signal event Returns false if there is no event.
-
void
EPWM_clearSyncEvent
(uint32_t base)¶ Clear external sync signal event.
This function clears the external sync signal latch event.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
uint16_t
EPWM_getTimeBaseCounterDirection
(uint32_t base)¶ Return time base counter direction.
This function returns the direction of the time base counter.
- Parameters
base
: is the base address of the EPWM module.
- Return
returns EPWM_TIME_BASE_STATUS_COUNT_UP if the counter is counting up or EPWM_TIME_BASE_STATUS_COUNT_DOWN if the counter is counting down.
-
void
EPWM_setPhaseShift
(uint32_t base, uint16_t phaseCount)¶ Sets the phase shift offset counter value.
This function sets the 16 bit time-base counter phase of the ePWM relative to the time-base that is supplying the synchronization input signal. Call the
EPWM_enablePhaseShiftLoad() function to enable loading of the phaseCount phase shift value when a sync event occurs.- Parameters
base
: is the base address of the EPWM module.phaseCount
: is the phase shift count value.
- Return
None.
-
void
EPWM_setTimeBasePeriod
(uint32_t base, uint16_t periodCount)¶ Sets the PWM period count.
This function sets the period of the PWM count. The value of periodCount is the value written to the register. User should map the desired period or frequency of the waveform into the correct periodCount. Invoke the function
EPWM_selectPeriodLoadEvent() with the appropriate parameter to set the load mode of the Period count. periodCount has a maximum valid value of 0xFFFF- Parameters
base
: is the base address of the EPWM module.periodCount
: is period count value.
- Return
None.
-
uint16_t
EPWM_getTimeBasePeriod
(uint32_t base)¶ Gets the PWM period count.
This function gets the period of the PWM count.
- Parameters
base
: is the base address of the EPWM module.
- Return
The period count value.
-
void
EPWM_setupEPWMLinks
(uint32_t base, EPWM_CurrentLink epwmLink, EPWM_LinkComponent linkComp)¶ Sets the EPWM links.
This function links the component defined in linkComp in the current ePWM instance with the linkComp component of the ePWM instance defined by epwmLink. A change (a write) in the value of linkComp component of epwmLink instance, causes a change in the current ePWM linkComp component. For example if the current ePWM is ePWM3 and the values of epwmLink and linkComp are EPWM_LINK_WITH_EPWM_1 and EPWM_LINK_COMP_C respectively, then a write to COMPC register in ePWM1, will result in a simultaneous write to COMPC register in ePWM3. Valid values for epwmLink are:
EPWM_LINK_WITH_EPWM_1 - link current ePWM with ePWM1
EPWM_LINK_WITH_EPWM_2 - link current ePWM with ePWM2
EPWM_LINK_WITH_EPWM_3 - link current ePWM with ePWM3
EPWM_LINK_WITH_EPWM_4 - link current ePWM with ePWM4
EPWM_LINK_WITH_EPWM_5 - link current ePWM with ePWM5
EPWM_LINK_WITH_EPWM_6 - link current ePWM with ePWM6
EPWM_LINK_WITH_EPWM_7 - link current ePWM with ePWM7
- Parameters
base
: is the base address of the EPWM module.epwmLink
: is the ePWM instance to link with.linkComp
: is the ePWM component to link.
Valid values for linkComp are:
EPWM_LINK_TBPRD - link TBPRD:TBPRDHR registers
EPWM_LINK_COMP_A - link COMPA registers
EPWM_LINK_COMP_B - link COMPB registers
EPWM_LINK_COMP_C - link COMPC registers
EPWM_LINK_COMP_D - link COMPD registers
EPWM_LINK_GLDCTL2 - link GLDCTL2 registers
- Return
None.
-
void
EPWM_setCounterCompareShadowLoadMode
(uint32_t base, EPWM_CounterCompareModule compModule, EPWM_CounterCompareLoadMode loadMode)¶ Sets up the Counter Compare shadow load mode
This function enables and sets up the counter compare shadow load mode. Valid values for the variables are:
compModule
EPWM_COUNTER_COMPARE_A - counter compare A.
EPWM_COUNTER_COMPARE_B - counter compare B.
EPWM_COUNTER_COMPARE_C - counter compare C.
EPWM_COUNTER_COMPARE_D - counter compare D.
loadMode
EPWM_COMP_LOAD_ON_CNTR_ZERO - load when counter equals zero
EPWM_COMP_LOAD_ON_CNTR_PERIOD - load when counter equals period
EPWM_COMP_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period
EPWM_COMP_LOAD_FREEZE - Freeze shadow to active load
EPWM_COMP_LOAD_ON_SYNC_CNTR_ZERO - load when counter equals zero
EPWM_COMP_LOAD_ON_SYNC_CNTR_PERIOD -load when counter equals period
EPWM_COMP_LOAD_ON_SYNC_CNTR_ZERO_PERIOD - load when counter equals zero or period
EPWM_COMP_LOAD_ON_SYNC_ONLY - load on sync only
- Parameters
base
: is the base address of the EPWM module.compModule
: is the counter compare module.loadMode
: is the shadow to active load mode.
- Return
None.
-
void
EPWM_disableCounterCompareShadowLoadMode
(uint32_t base, EPWM_CounterCompareModule compModule)¶ Disable Counter Compare shadow load mode
This function disables counter compare shadow load mode. Valid values for the variables are:
compModule
EPWM_COUNTER_COMPARE_A - counter compare A.
EPWM_COUNTER_COMPARE_B - counter compare B.
EPWM_COUNTER_COMPARE_C - counter compare C.
EPWM_COUNTER_COMPARE_D - counter compare D.
- Parameters
base
: is the base address of the EPWM module.compModule
: is the counter compare module.
- Return
None.
-
void
EPWM_setCounterCompareValue
(uint32_t base, EPWM_CounterCompareModule compModule, uint16_t compCount)¶ Set counter compare values.
This function sets the counter compare value for counter compare registers. The maximum value for compCount is 0xFFFF. Valid values for compModule are:
EPWM_COUNTER_COMPARE_A - counter compare A.
EPWM_COUNTER_COMPARE_B - counter compare B.
EPWM_COUNTER_COMPARE_C - counter compare C.
EPWM_COUNTER_COMPARE_D - counter compare D.
- Parameters
base
: is the base address of the EPWM module.compModule
: is the Counter Compare value module.compCount
: is the counter compare count value.
- Return
None.
-
uint16_t
EPWM_getCounterCompareValue
(uint32_t base, EPWM_CounterCompareModule compModule)¶ Get counter compare values.
This function gets the counter compare value for counter compare registers. Valid values for compModule are:
EPWM_COUNTER_COMPARE_A - counter compare A.
EPWM_COUNTER_COMPARE_B - counter compare B.
EPWM_COUNTER_COMPARE_C - counter compare C.
EPWM_COUNTER_COMPARE_D - counter compare D.
- Parameters
base
: is the base address of the EPWM module.compModule
: is the Counter Compare value module.
- Return
The counter compare count value.
-
bool
EPWM_getCounterCompareShadowStatus
(uint32_t base, EPWM_CounterCompareModule compModule)¶ Return the counter compare shadow register full status.
This function returns the counter Compare shadow register full status flag. Valid values for compModule are:
EPWM_COUNTER_COMPARE_A - counter compare A.
EPWM_COUNTER_COMPARE_B - counter compare B.
- Parameters
base
: is the base address of the EPWM module.compModule
: is the Counter Compare value module.
- Return
Returns true if the shadow register is full. Returns false if the shadow register is not full.
-
void
EPWM_setActionQualifierShadowLoadMode
(uint32_t base, EPWM_ActionQualifierModule aqModule, EPWM_ActionQualifierLoadMode loadMode)¶ Sets the Action Qualifier shadow load mode
This function enables and sets the Action Qualifier shadow load mode. Valid values for the variables are:
aqModule
EPWM_ACTION_QUALIFIER_A - Action Qualifier A.
EPWM_ACTION_QUALIFIER_B - Action Qualifier B.
loadMode
EPWM_AQ_LOAD_ON_CNTR_ZERO - load when counter equals zero
EPWM_AQ_LOAD_ON_CNTR_PERIOD - load when counter equals period
EPWM_AQ_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period
EPWM_AQ_LOAD_FREEZE - Freeze shadow to active load
EPWM_AQ_LOAD_ON_SYNC_CNTR_ZERO - load on sync or when counter equals zero
EPWM_AQ_LOAD_ON_SYNC_CNTR_PERIOD - load on sync or when counter equals period
EPWM_AQ_LOAD_ON_SYNC_CNTR_ZERO_PERIOD - load on sync or when counter equals zero or period
EPWM_AQ_LOAD_ON_SYNC_ONLY - load on sync only
- Parameters
base
: is the base address of the EPWM module.aqModule
: is the Action Qualifier module value.loadMode
: is the shadow to active load mode.
- Return
None.
-
void
EPWM_disableActionQualifierShadowLoadMode
(uint32_t base, EPWM_ActionQualifierModule aqModule)¶ Disable Action Qualifier shadow load mode
This function disables the Action Qualifier shadow load mode. Valid values for the variables are:
aqModule
EPWM_ACTION_QUALIFIER_A - Action Qualifier A.
EPWM_ACTION_QUALIFIER_B - Action Qualifier B.
- Parameters
base
: is the base address of the EPWM module.aqModule
: is the Action Qualifier module value.
- Return
None.
-
void
EPWM_setActionQualifierT1TriggerSource
(uint32_t base, EPWM_ActionQualifierTriggerSource trigger)¶ Set up Action qualifier trigger source for event T1
This function sets up the sources for Action Qualifier event T1. Valid values for trigger are:
EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_1 - Digital compare event A 1
EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2 - Digital compare event A 2
EPWM_AQ_TRIGGER_EVENT_TRIG_DCB_1 - Digital compare event B 1
EPWM_AQ_TRIGGER_EVENT_TRIG_DCB_2 - Digital compare event B 2
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_1 - Trip zone 1
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_2 - Trip zone 2
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_3 - Trip zone 3
EPWM_AQ_TRIGGER_EVENT_TRIG_EPWM_SYNCIN - ePWM sync
- Parameters
base
: is the base address of the EPWM module.trigger
: sources for Action Qualifier triggers.
- Return
None.
-
void
EPWM_setActionQualifierT2TriggerSource
(uint32_t base, EPWM_ActionQualifierTriggerSource trigger)¶ Set up Action qualifier trigger source for event T2
This function sets up the sources for Action Qualifier event T2. Valid values for trigger are:
EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_1 - Digital compare event A 1
EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2 - Digital compare event A 2
EPWM_AQ_TRIGGER_EVENT_TRIG_DCB_1 - Digital compare event B 1
EPWM_AQ_TRIGGER_EVENT_TRIG_DCB_2 - Digital compare event B 2
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_1 - Trip zone 1
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_2 - Trip zone 2
EPWM_AQ_TRIGGER_EVENT_TRIG_TZ_3 - Trip zone 3
EPWM_AQ_TRIGGER_EVENT_TRIG_EPWM_SYNCIN - ePWM sync
- Parameters
base
: is the base address of the EPWM module.trigger
: sources for Action Qualifier triggers.
- Return
None.
-
void
EPWM_setActionQualifierAction
(uint32_t base, EPWM_ActionQualifierOutputModule epwmOutput, EPWM_ActionQualifierOutput output, EPWM_ActionQualifierOutputEvent event)¶ Set up Action qualifier outputs
This function sets up the Action Qualifier output on ePWM A or ePWMB, depending on the value of epwmOutput, to a value specified by outPut based on the input events - specified by event. The following are valid values for the parameters.
epwmOutput
EPWM_AQ_OUTPUT_A - ePWMxA output
EPWM_AQ_OUTPUT_B - ePWMxB output
output
EPWM_AQ_OUTPUT_NO_CHANGE - No change in the output pins
EPWM_AQ_OUTPUT_LOW - Set output pins to low
EPWM_AQ_OUTPUT_HIGH - Set output pins to High
EPWM_AQ_OUTPUT_TOGGLE - Toggle the output pins
event
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO - Time base counter equals zero
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD - Time base counter equals period
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA - Time base counter up equals COMPA
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA - Time base counter down equals COMPA
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB - Time base counter up equals COMPB
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB - Time base counter down equals COMPB
EPWM_AQ_OUTPUT_ON_T1_COUNT_UP - T1 event on count up
EPWM_AQ_OUTPUT_ON_T1_COUNT_DOWN - T1 event on count down
EPWM_AQ_OUTPUT_ON_T2_COUNT_UP - T2 event on count up
EPWM_AQ_OUTPUT_ON_T2_COUNT_DOWN - T2 event on count down
- Parameters
base
: is the base address of the EPWM module.epwmOutput
: is the ePWM pin type.output
: is the Action Qualifier output.event
: is the event that causes a change in output.
- Return
None.
-
void
EPWM_setActionQualifierActionComplete
(uint32_t base, EPWM_ActionQualifierOutputModule epwmOutput, uint16_t action)¶ Set up Action qualifier event outputs
This function sets up the Action Qualifier output on ePWMA or ePWMB, depending on the value of epwmOutput, to a value specified by action. Valid action param values from different time base counter scenarios should be OR’d together to configure complete action for a pwm output. The following are valid values for the parameters.
epwmOutput
EPWM_AQ_OUTPUT_A - ePWMxA output
EPWM_AQ_OUTPUT_B - ePWMxB output
action
When time base counter equals zero
EPWM_AQ_OUTPUT_NO_CHANGE_ZERO - Time base counter equals zero and no change in output pins
EPWM_AQ_OUTPUT_LOW_ZERO - Time base counter equals zero and set output pins to low
EPWM_AQ_OUTPUT_HIGH_ZERO - Time base counter equals zero and set output pins to high
EPWM_AQ_OUTPUT_TOGGLE_ZERO - Time base counter equals zero and toggle the output pins
When time base counter equals period
EPWM_AQ_OUTPUT_NO_CHANGE_PERIOD - Time base counter equals period and no change in output pins
EPWM_AQ_OUTPUT_LOW_PERIOD - Time base counter equals period and set output pins to low
EPWM_AQ_OUTPUT_HIGH_PERIOD - Time base counter equals period and set output pins to high
EPWM_AQ_OUTPUT_TOGGLE_PERIOD - Time base counter equals period and toggle the output pins
When time base counter equals CMPA during up-count
EPWM_AQ_OUTPUT_NO_CHANGE_UP_CMPA - Time base counter up equals COMPA and no change in the output pins
EPWM_AQ_OUTPUT_LOW_UP_CMPA - Time base counter up equals COMPA and set output pins low
EPWM_AQ_OUTPUT_HIGH_UP_CMPA - Time base counter up equals COMPA and set output pins high
EPWM_AQ_OUTPUT_TOGGLE_UP_CMPA - Time base counter up equals COMPA and toggle output pins
When time base counter equals CMPA during down-count
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_CMPA - Time base counter down equals COMPA and no change in the output pins
EPWM_AQ_OUTPUT_LOW_DOWN_CMPA - Time base counter down equals COMPA and set output pins low
EPWM_AQ_OUTPUT_HIGH_DOWN_CMPA - Time base counter down equals COMPA and set output pins high
EPWM_AQ_OUTPUT_TOGGLE_DOWN_CMPA - Time base counter down equals COMPA and toggle output pins
When time base counter equals CMPB during up-count
EPWM_AQ_OUTPUT_NO_CHANGE_UP_CMPB - Time base counter up equals COMPB and no change in the output pins
EPWM_AQ_OUTPUT_LOW_UP_CMPB - Time base counter up equals COMPB and set output pins low
EPWM_AQ_OUTPUT_HIGH_UP_CMPB - Time base counter up equals COMPB and set output pins high
EPWM_AQ_OUTPUT_TOGGLE_UP_CMPB - Time base counter up equals COMPB and toggle output pins
When time base counter equals CMPB during down-count
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_CMPB- Time base counter down equals COMPB and no change in the output pins
EPWM_AQ_OUTPUT_LOW_DOWN_CMPB - Time base counter down equals COMPB and set output pins low
EPWM_AQ_OUTPUT_HIGH_DOWN_CMPB - Time base counter down equals COMPB and set output pins high
EPWM_AQ_OUTPUT_TOGGLE_DOWN_CMPB - Time base counter down equals COMPB and toggle output pins
- Parameters
base
: is the base address of the EPWM module.epwmOutput
: is the ePWM pin type.action
: is the desired action when the specified event occurs
note: A logical OR of the valid values should be passed as the action parameter. Single action should be configured for each time base counter scenario.
- Return
None.
-
void
EPWM_setAdditionalActionQualifierActionComplete
(uint32_t base, EPWM_ActionQualifierOutputModule epwmOutput, uint16_t action)¶ Set up Additional action qualifier event outputs
This function sets up the Additional Action Qualifier output on ePWMA or ePWMB depending on the value of epwmOutput, to a value specified by action. Valid action param values from different event scenarios should be OR’d together to configure complete action for a pwm output. The following are valid values for the parameters.
epwmOutput
EPWM_AQ_OUTPUT_A - ePWMxA output
EPWM_AQ_OUTPUT_B - ePWMxB output
action
When T1 event occurs during up-count
EPWM_AQ_OUTPUT_NO_CHANGE_UP_T1 - T1 event on count up and no change in output pins
EPWM_AQ_OUTPUT_LOW_UP_T1 - T1 event on count up and set output pins to low
EPWM_AQ_OUTPUT_HIGH_UP_T1 - T1 event on count up and set output pins to high
EPWM_AQ_OUTPUT_TOGGLE_UP_T1 - T1 event on count up and toggle the output pins
When T1 event occurs during down-count
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_T1- T1 event on count down and no change in output pins
EPWM_AQ_OUTPUT_LOW_DOWN_T1 - T1 event on count down and set output pins to low
EPWM_AQ_OUTPUT_HIGH_DOWN_T1 - T1 event on count down and set output pins to high
EPWM_AQ_OUTPUT_TOGGLE_DOWN_T1 - T1 event on count down and toggle the output pins
When T2 event occurs during up-count
EPWM_AQ_OUTPUT_NO_CHANGE_UP_T2 - T2 event on count up and no change in output pins
EPWM_AQ_OUTPUT_LOW_UP_T2 - T2 event on count up and set output pins to low
EPWM_AQ_OUTPUT_HIGH_UP_T2 - T2 event on count up and set output pins to high
EPWM_AQ_OUTPUT_TOGGLE_UP_T2 - T2 event on count up and toggle the output pins
When T2 event occurs during down-count
EPWM_AQ_OUTPUT_NO_CHANGE_DOWN_T2 - T2 event on count down and no change in output pins
EPWM_AQ_OUTPUT_LOW_DOWN_T2 - T2 event on count down and set output pins to low
EPWM_AQ_OUTPUT_HIGH_DOWN_T2 - T2 event on count down and set output pins to high
EPWM_AQ_OUTPUT_TOGGLE_DOWN_T2 - T2 event on count down and toggle the output pins
- Parameters
base
: is the base address of the EPWM module.epwmOutput
: is the ePWM pin type.action
: is the desired action when the specified event occurs
note: A logical OR of the valid values should be passed as the action parameter. Single action should be configured for each event scenario.
- Return
None.
-
void
EPWM_setActionQualifierContSWForceShadowMode
(uint32_t base, EPWM_ActionQualifierContForce mode)¶ Sets up Action qualifier continuous software load mode.
This function sets up the AQCFRSC register load mode for continuous software force reload mode. The software force actions are determined by the
EPWM_setActionQualifierContSWForceAction() function. Valid values for mode are:EPWM_AQ_SW_SH_LOAD_ON_CNTR_ZERO - shadow mode load when counter equals zero
EPWM_AQ_SW_SH_LOAD_ON_CNTR_PERIOD - shadow mode load when counter equals period
EPWM_AQ_SW_SH_LOAD_ON_CNTR_ZERO_PERIOD - shadow mode load when counter equals zero or period
EPWM_AQ_SW_IMMEDIATE_LOAD - immediate mode load only
- Parameters
base
: is the base address of the EPWM module.mode
: is the mode for shadow to active load mode.
- Return
None.
-
void
EPWM_setActionQualifierContSWForceAction
(uint32_t base, EPWM_ActionQualifierOutputModule epwmOutput, EPWM_ActionQualifierSWOutput output)¶ Triggers a continuous software forced event.
This function triggers a continuous software forced Action Qualifier output on ePWM A or B based on the value of epwmOutput. Valid values for the parameters are:
epwmOutput
EPWM_AQ_OUTPUT_A - ePWMxA output
EPWM_AQ_OUTPUT_B - ePWMxB output
output
EPWM_AQ_SW_DISABLED - Software forcing disabled.
EPWM_AQ_SW_OUTPUT_LOW - Set output pins to low
EPWM_AQ_SW_OUTPUT_HIGH - Set output pins to High
- Parameters
base
: is the base address of the EPWM module.epwmOutput
: is the ePWM pin type.output
: is the Action Qualifier output.
- Return
None.
-
void
EPWM_setActionQualifierSWAction
(uint32_t base, EPWM_ActionQualifierOutputModule epwmOutput, EPWM_ActionQualifierOutput output)¶ Set up one time software forced Action qualifier outputs
This function sets up the one time software forced Action Qualifier output on ePWM A or ePWMB, depending on the value of epwmOutput to a value specified by outPut. The following are valid values for the parameters.
epwmOutput
EPWM_AQ_OUTPUT_A - ePWMxA output
EPWM_AQ_OUTPUT_B - ePWMxB output
output
EPWM_AQ_OUTPUT_NO_CHANGE - No change in the output pins
EPWM_AQ_OUTPUT_LOW - Set output pins to low
EPWM_AQ_OUTPUT_HIGH - Set output pins to High
EPWM_AQ_OUTPUT_TOGGLE - Toggle the output pins
- Parameters
base
: is the base address of the EPWM module.epwmOutput
: is the ePWM pin type.output
: is the Action Qualifier output.
- Return
None.
-
void
EPWM_forceActionQualifierSWAction
(uint32_t base, EPWM_ActionQualifierOutputModule epwmOutput)¶ Triggers a one time software forced event on Action qualifier
This function triggers a one time software forced Action Qualifier event on ePWM A or B based on the value of epwmOutput. Valid values for epwmOutput are:
EPWM_AQ_OUTPUT_A - ePWMxA output
EPWM_AQ_OUTPUT_B - ePWMxB output
- Parameters
base
: is the base address of the EPWM module.epwmOutput
: is the ePWM pin type.
- Return
None.
-
void
EPWM_setDeadBandOutputSwapMode
(uint32_t base, EPWM_DeadBandOutput output, bool enableSwapMode)¶ Sets Dead Band signal output swap mode.
This function sets up the output signal swap mode. For example if the output variable is set to EPWM_DB_OUTPUT_A and enableSwapMode is true, then the ePWM A output gets its signal from the ePWM B signal path. Valid values for the input variables are:
output
EPWM_DB_OUTPUT_A - ePWM output A
EPWM_DB_OUTPUT_B - ePWM output B
enableSwapMode
true - the output is swapped
false - the output and the signal path are the same.
- Parameters
base
: is the base address of the EPWM module.output
: is the ePWM Dead Band output.enableSwapMode
: is the output swap mode.
- Return
None.
-
void
EPWM_setDeadBandDelayMode
(uint32_t base, EPWM_DeadBandDelayMode delayMode, bool enableDelayMode)¶ Sets Dead Band signal output mode.
This function sets up the dead band delay mode. The delayMode variable determines if the applied delay is Rising Edge or Falling Edge. The enableDelayMode determines if a dead band delay should be applied. Valid values for the variables are:
delayMode
EPWM_DB_RED - Rising Edge delay
EPWM_DB_FED - Falling Edge delay
enableDelayMode
true - Falling edge or Rising edge delay is applied.
false - Dead Band delay is bypassed.
- Parameters
base
: is the base address of the EPWM module.delayMode
: is the Dead Band delay type.enableDelayMode
: is the dead band delay mode.
- Return
None.
-
void
EPWM_setDeadBandDelayPolarity
(uint32_t base, EPWM_DeadBandDelayMode delayMode, EPWM_DeadBandPolarity polarity)¶ Sets Dead Band delay polarity.
This function sets up the polarity as determined by the variable polarity of the Falling Edge or Rising Edge delay depending on the value of delayMode. Valid values for the variables are:
delayMode
EPWM_DB_RED - Rising Edge delay
EPWM_DB_FED - Falling Edge delay
polarity
EPWM_DB_POLARITY_ACTIVE_HIGH - polarity is not inverted.
EPWM_DB_POLARITY_ACTIVE_LOW - polarity is inverted.
- Parameters
base
: is the base address of the EPWM module.delayMode
: is the Dead Band delay type.polarity
: is the polarity of the delayed signal.
- Return
None.
-
void
EPWM_setRisingEdgeDeadBandDelayInput
(uint32_t base, uint16_t input)¶ Sets Rising Edge Dead Band delay input.
This function sets up the rising Edge delay input signal. Valid values for input are:
EPWM_DB_INPUT_EPWMA - Input signal is ePWMA( Valid for both Falling Edge and Rising Edge)
EPWM_DB_INPUT_EPWMB - Input signal is ePWMB( Valid for both Falling Edge and Rising Edge)
- Parameters
base
: is the base address of the EPWM module.input
: is the input signal to the dead band.
- Return
None.
-
void
EPWM_setFallingEdgeDeadBandDelayInput
(uint32_t base, uint16_t input)¶ Sets Dead Band delay input.
This function sets up the rising Edge delay input signal. Valid values for input are:
EPWM_DB_INPUT_EPWMA - Input signal is ePWMA(Valid for both Falling Edge and Rising Edge)
EPWM_DB_INPUT_EPWMB - Input signal is ePWMB(Valid for both Falling Edge and Rising Edge)
EPWM_DB_INPUT_DB_RED - Input signal is the output of Rising Edge delay. (Valid only for Falling Edge delay)
- Parameters
base
: is the base address of the EPWM module.input
: is the input signal to the dead band.
- Return
None.
-
void
EPWM_setDeadBandControlShadowLoadMode
(uint32_t base, EPWM_DeadBandControlLoadMode loadMode)¶ Set the Dead Band control shadow load mode.
This function enables and sets the Dead Band control register shadow load mode. Valid values for the
loadMode parameter are:EPWM_DB_LOAD_ON_CNTR_ZERO - load when counter equals zero.
EPWM_DB_LOAD_ON_CNTR_PERIOD - load when counter equals period.
EPWM_DB_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period.
EPWM_DB_LOAD_FREEZE - Freeze shadow to active load.
- Parameters
base
: is the base address of the EPWM module.loadMode
: is the shadow to active load mode.
- Return
None.
-
void
EPWM_disableDeadBandControlShadowLoadMode
(uint32_t base)¶ Disable Dead Band control shadow load mode.
This function disables the Dead Band control register shadow load mode.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setRisingEdgeDelayCountShadowLoadMode
(uint32_t base, EPWM_RisingEdgeDelayLoadMode loadMode)¶ Set the RED (Rising Edge Delay) shadow load mode.
This function sets the Rising Edge Delay register shadow load mode. Valid values for the
loadMode parameter are:EPWM_RED_LOAD_ON_CNTR_ZERO - load when counter equals zero.
EPWM_RED_LOAD_ON_CNTR_PERIOD - load when counter equals period.
EPWM_RED_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period.
EPWM_RED_LOAD_FREEZE - Freeze shadow to active load.
- Parameters
base
: is the base address of the EPWM module.loadMode
: is the shadow to active load event.
- Return
None.
-
void
EPWM_disableRisingEdgeDelayCountShadowLoadMode
(uint32_t base)¶ Disable the RED (Rising Edge Delay) shadow load mode.
This function disables the Rising Edge Delay register shadow load mode.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setFallingEdgeDelayCountShadowLoadMode
(uint32_t base, EPWM_FallingEdgeDelayLoadMode loadMode)¶ Set the FED (Falling Edge Delay) shadow load mode.
This function enables and sets the Falling Edge Delay register shadow load mode. Valid values for the
loadMode parameters are:EPWM_FED_LOAD_ON_CNTR_ZERO - load when counter equals zero.
EPWM_FED_LOAD_ON_CNTR_PERIOD - load when counter equals period.
EPWM_FED_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period.
EPWM_FED_LOAD_FREEZE - Freeze shadow to active load.
- Parameters
base
: is the base address of the EPWM module.loadMode
: is the shadow to active load event.
- Return
None.
-
void
EPWM_disableFallingEdgeDelayCountShadowLoadMode
(uint32_t base)¶ Disables the FED (Falling Edge Delay) shadow load mode.
This function disables the Falling Edge Delay register shadow load mode. Valid values for the parameters are:
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setDeadBandCounterClock
(uint32_t base, EPWM_DeadBandClockMode clockMode)¶ Sets Dead Band Counter clock rate.
This function sets up the Dead Band counter clock rate with respect to TBCLK (ePWM time base counter). Valid values for clockMode are:
EPWM_DB_COUNTER_CLOCK_FULL_CYCLE -Dead band counter runs at TBCLK (ePWM Time Base Counter) rate.
EPWM_DB_COUNTER_CLOCK_HALF_CYCLE -Dead band counter runs at 2*TBCLK (twice ePWM Time Base Counter)rate.
- Parameters
base
: is the base address of the EPWM module.clockMode
: is the Dead Band counter clock mode.
- Return
None.
-
void
EPWM_setRisingEdgeDelayCount
(uint32_t base, uint16_t redCount)¶ Set ePWM RED count
This function sets the RED (Rising Edge Delay) count value. The value of redCount should be less than 0x4000U.
- Parameters
base
: is the base address of the EPWM module.redCount
: is the RED(Rising Edge Delay) count.
- Return
None.
-
void
EPWM_setFallingEdgeDelayCount
(uint32_t base, uint16_t fedCount)¶ Set ePWM FED count
This function sets the FED (Falling Edge Delay) count value. The value of fedCount should be less than 0x4000U.
- Parameters
base
: is the base address of the EPWM module.fedCount
: is the FED(Falling Edge Delay) count.
- Return
None.
-
void
EPWM_enableChopper
(uint32_t base)¶ Enable chopper mode
This function enables ePWM chopper module.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableChopper
(uint32_t base)¶ Disable chopper mode
This function disables ePWM chopper module.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setChopperDutyCycle
(uint32_t base, uint16_t dutyCycleCount)¶ Set chopper duty cycle.
This function sets the chopping clock duty cycle. The value of dutyCycleCount should be less than 7. The dutyCycleCount value is converted to the actual chopper duty cycle value base on the following equation: chopper duty cycle = (dutyCycleCount + 1) / 8
- Parameters
base
: is the base address of the EPWM module.dutyCycleCount
: is the chopping clock duty cycle count.
- Return
None.
-
void
EPWM_setChopperFreq
(uint32_t base, uint16_t freqDiv)¶ Set chopper clock frequency scaler.
This function sets the scaler for the chopping clock frequency. The value of freqDiv should be less than 8. The chopping clock frequency is altered based on the following equation. chopper clock frequency = SYSCLKOUT / ( 1 + freqDiv)
- Parameters
base
: is the base address of the EPWM module.freqDiv
: is the chopping clock frequency divider.
- Return
None.
-
void
EPWM_setChopperFirstPulseWidth
(uint32_t base, uint16_t firstPulseWidth)¶ Set chopper clock frequency scaler.
This function sets the first pulse width of chopper output waveform. The value of firstPulseWidth should be less than 0x10. The value of the first pulse width in seconds is given using the following equation: first pulse width = 1 / (((firstPulseWidth + 1) * SYSCLKOUT)/8)
- Parameters
base
: is the base address of the EPWM module.firstPulseWidth
: is the width of the first pulse.
- Return
None.
-
void
EPWM_enableTripZoneSignals
(uint32_t base, uint16_t tzSignal)¶ Enables Trip Zone signal.
This function enables the Trip Zone signals specified by tzSignal as a source for the Trip Zone module. Valid values for tzSignal are:
EPWM_TZ_SIGNAL_CBC1 - TZ1 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC2 - TZ2 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC3 - TZ3 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC4 - TZ4 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC5 - TZ5 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC6 - TZ6 Cycle By Cycle
EPWM_TZ_SIGNAL_DCAEVT2 - DCAEVT2 Cycle By Cycle
EPWM_TZ_SIGNAL_DCBEVT2 - DCBEVT2 Cycle By Cycle
EPWM_TZ_SIGNAL_OSHT1 - One-shot TZ1
EPWM_TZ_SIGNAL_OSHT2 - One-shot TZ2
EPWM_TZ_SIGNAL_OSHT3 - One-shot TZ3
EPWM_TZ_SIGNAL_OSHT4 - One-shot TZ4
EPWM_TZ_SIGNAL_OSHT5 - One-shot TZ5
EPWM_TZ_SIGNAL_OSHT6 - One-shot TZ6
EPWM_TZ_SIGNAL_DCAEVT1 - One-shot DCAEVT1
EPWM_TZ_SIGNAL_DCBEVT1 - One-shot DCBEVT1
- Parameters
base
: is the base address of the EPWM module.tzSignal
: is the Trip Zone signal.
note: A logical OR of the valid values can be passed as the tzSignal parameter.
- Return
None.
-
void
EPWM_disableTripZoneSignals
(uint32_t base, uint16_t tzSignal)¶ Disables Trip Zone signal.
This function disables the Trip Zone signal specified by tzSignal as a source for the Trip Zone module. Valid values for tzSignal are:
EPWM_TZ_SIGNAL_CBC1 - TZ1 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC2 - TZ2 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC3 - TZ3 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC4 - TZ4 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC5 - TZ5 Cycle By Cycle
EPWM_TZ_SIGNAL_CBC6 - TZ6 Cycle By Cycle
EPWM_TZ_SIGNAL_DCAEVT2 - DCAEVT2 Cycle By Cycle
EPWM_TZ_SIGNAL_DCBEVT2 - DCBEVT2 Cycle By Cycle
EPWM_TZ_SIGNAL_OSHT1 - One-shot TZ1
EPWM_TZ_SIGNAL_OSHT2 - One-shot TZ2
EPWM_TZ_SIGNAL_OSHT3 - One-shot TZ3
EPWM_TZ_SIGNAL_OSHT4 - One-shot TZ4
EPWM_TZ_SIGNAL_OSHT5 - One-shot TZ5
EPWM_TZ_SIGNAL_OSHT6 - One-shot TZ6
EPWM_TZ_SIGNAL_DCAEVT1 - One-shot DCAEVT1
EPWM_TZ_SIGNAL_DCBEVT1 - One-shot DCBEVT1
- Parameters
base
: is the base address of the EPWM module.tzSignal
: is the Trip Zone signal.
note: A logical OR of the valid values can be passed as the tzSignal parameter.
- Return
None.
-
void
EPWM_setTripZoneDigitalCompareEventCondition
(uint32_t base, EPWM_TripZoneDigitalCompareOutput dcType, EPWM_TripZoneDigitalCompareOutputEvent dcEvent)¶ Set Digital compare conditions that cause Trip Zone event.
This function sets up the Digital Compare output Trip Zone event sources. The dcType variable specifies the event source to be whether Digital Compare output A or Digital Compare output B. The dcEvent parameter specifies the event that causes Trip Zone. Valid values for the parameters are:
dcType
EPWM_TZ_DC_OUTPUT_A1 - Digital Compare output 1 A
EPWM_TZ_DC_OUTPUT_A2 - Digital Compare output 2 A
EPWM_TZ_DC_OUTPUT_B1 - Digital Compare output 1 B
EPWM_TZ_DC_OUTPUT_B2 - Digital Compare output 2 B
dcEvent
EPWM_TZ_EVENT_DC_DISABLED - Event Trigger is disabled
EPWM_TZ_EVENT_DCXH_LOW - Trigger event when DCxH low
EPWM_TZ_EVENT_DCXH_HIGH - Trigger event when DCxH high
EPWM_TZ_EVENT_DCXL_LOW - Trigger event when DCxL low
EPWM_TZ_EVENT_DCXL_HIGH - Trigger event when DCxL high
EPWM_TZ_EVENT_DCXL_HIGH_DCXH_LOW - Trigger event when DCxL high DCxH low
- Parameters
base
: is the base address of the EPWM module.dcType
: is the Digital compare output type.dcEvent
: is the Digital Compare output event.
- Note
x in DCxH/DCxL represents DCAH/DCAL or DCBH/DCBL
- Return
None.
-
void
EPWM_enableTripZoneAdvAction
(uint32_t base)¶ Enable advanced Trip Zone event Action.
This function enables the advanced actions of the Trip Zone events. The advanced features combine the trip zone events with the direction of the counter.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableTripZoneAdvAction
(uint32_t base)¶ Disable advanced Trip Zone event Action.
This function disables the advanced actions of the Trip Zone events.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setTripZoneAction
(uint32_t base, EPWM_TripZoneEvent tzEvent, EPWM_TripZoneAction tzAction)¶ Set Trip Zone Action.
This function sets the Trip Zone Action to be taken when a Trip Zone event occurs. Valid values for the parameters are:
tzEvent
EPWM_TZ_ACTION_EVENT_DCBEVT2 - DCBEVT2 (Digital Compare B event 2)
EPWM_TZ_ACTION_EVENT_DCBEVT1 - DCBEVT1 (Digital Compare B event 1)
EPWM_TZ_ACTION_EVENT_DCAEVT2 - DCAEVT2 (Digital Compare A event 2)
EPWM_TZ_ACTION_EVENT_DCAEVT1 - DCAEVT1 (Digital Compare A event 1)
EPWM_TZ_ACTION_EVENT_TZB - TZ1 - TZ6, DCBEVT2, DCBEVT1
EPWM_TZ_ACTION_EVENT_TZA - TZ1 - TZ6, DCAEVT2, DCAEVT1
tzAction
EPWM_TZ_ACTION_HIGH_Z - high impedance output
EPWM_TZ_ACTION_HIGH - high output
EPWM_TZ_ACTION_LOW - low low
EPWM_TZ_ACTION_DISABLE - disable action
- Parameters
base
: is the base address of the EPWM module.tzEvent
: is the Trip Zone event type.tzAction
: is the Trip zone Action.
- Note
Disable the advanced Trip Zone event using EPWM_disableTripZoneAdvAction() before calling this function.
- Note
This function operates on both ePWMA and ePWMB depending on the tzEvent parameter.
- Return
None.
-
void
EPWM_setTripZoneAdvAction
(uint32_t base, EPWM_TripZoneAdvancedEvent tzAdvEvent, EPWM_TripZoneAdvancedAction tzAdvAction)¶ Set Advanced Trip Zone Action.
This function sets the Advanced Trip Zone Action to be taken when an advanced Trip Zone event occurs.
- Parameters
base
: is the base address of the EPWM module.tzAdvEvent
: is the Trip Zone event type.tzAdvAction
: is the Trip zone Action.
Valid values for the parameters are:
tzAdvEvent
EPWM_TZ_ADV_ACTION_EVENT_TZB_D - TZ1 - TZ6, DCBEVT2, DCBEVT1 while counting down
EPWM_TZ_ADV_ACTION_EVENT_TZB_U - TZ1 - TZ6, DCBEVT2, DCBEVT1 while counting up
EPWM_TZ_ADV_ACTION_EVENT_TZA_D - TZ1 - TZ6, DCAEVT2, DCAEVT1 while counting down
EPWM_TZ_ADV_ACTION_EVENT_TZA_U - TZ1 - TZ6, DCAEVT2, DCAEVT1 while counting up
tzAdvAction
EPWM_TZ_ADV_ACTION_HIGH_Z - high impedance output
EPWM_TZ_ADV_ACTION_HIGH - high voltage state
EPWM_TZ_ADV_ACTION_LOW - low voltage state
EPWM_TZ_ADV_ACTION_TOGGLE - Toggle output
EPWM_TZ_ADV_ACTION_DISABLE - disable action
- Note
This function enables the advanced Trip Zone event.
- Note
This function operates on both ePWMA and ePWMB depending on the tzAdvEvent parameter.
- Note
Advanced Trip Zone events take into consideration the direction of the counter in addition to Trip Zone events.
- Return
None.
-
void
EPWM_setTripZoneAdvDigitalCompareActionA
(uint32_t base, EPWM_TripZoneAdvDigitalCompareEvent tzAdvDCEvent, EPWM_TripZoneAdvancedAction tzAdvDCAction)¶ Set Advanced Digital Compare Trip Zone Action on ePWMA.
This function sets the Digital Compare (DC) Advanced Trip Zone Action to be taken on ePWMA when an advanced Digital Compare Trip Zone A event occurs. Valid values for the parameters are:
tzAdvDCEvent
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_D - Digital Compare event A2 while counting down
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_U - Digital Compare event A2 while counting up
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_D - Digital Compare event A1 while counting down
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_U - Digital Compare event A1 while counting up
tzAdvDCAction
EPWM_TZ_ADV_ACTION_HIGH_Z - high impedance output
EPWM_TZ_ADV_ACTION_HIGH - high voltage state
EPWM_TZ_ADV_ACTION_LOW - low voltage state
EPWM_TZ_ADV_ACTION_TOGGLE - Toggle output
EPWM_TZ_ADV_ACTION_DISABLE - disable action
- Parameters
base
: is the base address of the EPWM module.tzAdvDCEvent
: is the Digital Compare Trip Zone event type.tzAdvDCAction
: is the Digital Compare Trip zone Action.
- Note
This function enables the advanced Trip Zone event.
- Note
Advanced Trip Zone events take into consideration the direction of the counter in addition to Digital Compare Trip Zone events.
- Return
None.
-
void
EPWM_setTripZoneAdvDigitalCompareActionB
(uint32_t base, EPWM_TripZoneAdvDigitalCompareEvent tzAdvDCEvent, EPWM_TripZoneAdvancedAction tzAdvDCAction)¶ Set Advanced Digital Compare Trip Zone Action on ePWMB.
This function sets the Digital Compare (DC) Advanced Trip Zone Action to be taken on ePWMB when an advanced Digital Compare Trip Zone B event occurs. Valid values for the parameters are:
tzAdvDCEvent
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_D - Digital Compare event B2 while counting down
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_U - Digital Compare event B2 while counting up
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_D - Digital Compare event B1 while counting down
EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_U - Digital Compare event B1 while counting up
tzAdvDCAction
EPWM_TZ_ADV_ACTION_HIGH_Z - high impedance output
EPWM_TZ_ADV_ACTION_HIGH - high voltage state
EPWM_TZ_ADV_ACTION_LOW - low voltage state
EPWM_TZ_ADV_ACTION_TOGGLE - Toggle output
EPWM_TZ_ADV_ACTION_DISABLE - disable action
- Parameters
base
: is the base address of the EPWM module.tzAdvDCEvent
: is the Digital Compare Trip Zone event type.tzAdvDCAction
: is the Digital Compare Trip zone Action.
- Note
This function enables the advanced Trip Zone event.
- Note
Advanced Trip Zone events take into consideration the direction of the counter in addition to Digital Compare Trip Zone events.
- Return
None.
-
void
EPWM_enableTripZoneInterrupt
(uint32_t base, uint16_t tzInterrupt)¶ Enable Trip Zone interrupts.
This function enables the Trip Zone interrupts. Valid values for tzInterrupt are:
EPWM_TZ_INTERRUPT_CBC - Trip Zones Cycle By Cycle interrupt
EPWM_TZ_INTERRUPT_OST - Trip Zones One Shot interrupt
EPWM_TZ_INTERRUPT_DCAEVT1 - Digital Compare A Event 1 interrupt
EPWM_TZ_INTERRUPT_DCAEVT2 - Digital Compare A Event 2 interrupt
EPWM_TZ_INTERRUPT_DCBEVT1 - Digital Compare B Event 1 interrupt
EPWM_TZ_INTERRUPT_DCBEVT2 - Digital Compare B Event 2 interrupt
- Parameters
base
: is the base address of the EPWM module.tzInterrupt
: is the Trip Zone interrupt.
note: A logical OR of the valid values can be passed as the tzInterrupt parameter.
- Return
None.
-
void
EPWM_disableTripZoneInterrupt
(uint32_t base, uint16_t tzInterrupt)¶ Disable Trip Zone interrupts.
This function disables the Trip Zone interrupts. Valid values for tzInterrupt are:
EPWM_TZ_INTERRUPT_CBC - Trip Zones Cycle By Cycle interrupt
EPWM_TZ_INTERRUPT_OST - Trip Zones One Shot interrupt
EPWM_TZ_INTERRUPT_DCAEVT1 - Digital Compare A Event 1 interrupt
EPWM_TZ_INTERRUPT_DCAEVT2 - Digital Compare A Event 2 interrupt
EPWM_TZ_INTERRUPT_DCBEVT1 - Digital Compare B Event 1 interrupt
EPWM_TZ_INTERRUPT_DCBEVT2 - Digital Compare B Event 2 interrupt
- Parameters
base
: is the base address of the EPWM module.tzInterrupt
: is the Trip Zone interrupt.
note: A logical OR of the valid values can be passed as the tzInterrupt parameter.
- Return
None.
-
uint16_t
EPWM_getTripZoneFlagStatus
(uint32_t base)¶ Gets the Trip Zone status flag
This function returns the Trip Zone status flag.
- Parameters
base
: is the base address of the EPWM module.
- Return
The function returns the following or the bitwise OR value of the following values.
EPWM_TZ_INTERRUPT - Trip Zone interrupt was generated due to the following TZ events.
EPWM_TZ_FLAG_CBC - Trip Zones Cycle By Cycle event status flag
EPWM_TZ_FLAG_OST - Trip Zones One Shot event status flag
EPWM_TZ_FLAG_DCAEVT1 - Digital Compare A Event 1 status flag
EPWM_TZ_FLAG_DCAEVT2 - Digital Compare A Event 2 status flag
EPWM_TZ_FLAG_DCBEVT1 - Digital Compare B Event 1 status flag
EPWM_TZ_FLAG_DCBEVT2 - Digital Compare B Event 2 status flag
-
uint16_t
EPWM_getCycleByCycleTripZoneFlagStatus
(uint32_t base)¶ Gets the Trip Zone Cycle by Cycle flag status
This function returns the specific Cycle by Cycle Trip Zone flag status.
- Parameters
base
: is the base address of the EPWM module.
- Return
The function returns the following values.
EPWM_TZ_CBC_FLAG_1 - CBC 1 status flag
EPWM_TZ_CBC_FLAG_2 - CBC 2 status flag
EPWM_TZ_CBC_FLAG_3 - CBC 3 status flag
EPWM_TZ_CBC_FLAG_4 - CBC 4 status flag
EPWM_TZ_CBC_FLAG_5 - CBC 5 status flag
EPWM_TZ_CBC_FLAG_6 - CBC 6 status flag
EPWM_TZ_CBC_FLAG_DCAEVT2 - CBC status flag for Digital compare event A2
EPWM_TZ_CBC_FLAG_DCBEVT2 - CBC status flag for Digital compare event B2
-
uint16_t
EPWM_getOneShotTripZoneFlagStatus
(uint32_t base)¶ Gets the Trip Zone One Shot flag status
This function returns the specific One Shot Trip Zone flag status.
- Parameters
base
: is the base address of the EPWM module.
- Return
The function returns the bitwise OR of the following flags.
EPWM_TZ_OST_FLAG_OST1 - OST status flag for OST1
EPWM_TZ_OST_FLAG_OST2 - OST status flag for OST2
EPWM_TZ_OST_FLAG_OST3 - OST status flag for OST3
EPWM_TZ_OST_FLAG_OST4 - OST status flag for OST4
EPWM_TZ_OST_FLAG_OST5 - OST status flag for OST5
EPWM_TZ_OST_FLAG_OST6 - OST status flag for OST6
EPWM_TZ_OST_FLAG_DCAEVT1 - OST status flag for Digital compare event A1
EPWM_TZ_OST_FLAG_DCBEVT1 - OST status flag for Digital compare event B1
-
void
EPWM_selectCycleByCycleTripZoneClearEvent
(uint32_t base, EPWM_CycleByCycleTripZoneClearMode clearEvent)¶ Set the Trip Zone CBC pulse clear event.
This function set the event which automatically clears the CBC (Cycle by Cycle) latch. Valid values for clearEvent are:
EPWM_TZ_CBC_PULSE_CLR_CNTR_ZERO - Clear CBC pulse when counter equals zero
EPWM_TZ_CBC_PULSE_CLR_CNTR_PERIOD - Clear CBC pulse when counter equals period
EPWM_TZ_CBC_PULSE_CLR_CNTR_ZERO_PERIOD - Clear CBC pulse when counter equals zero or period
- Parameters
base
: is the base address of the EPWM module.clearEvent
: is the CBC trip zone clear event.
- Return
None.
-
void
EPWM_clearTripZoneFlag
(uint32_t base, uint16_t tzFlags)¶ Clear Trip Zone flag
This function clears the Trip Zone flags Valid values for tzFlags are:
EPWM_TZ_INTERRUPT - Global Trip Zone interrupt flag
EPWM_TZ_FLAG_CBC - Trip Zones Cycle By Cycle flag
EPWM_TZ_FLAG_OST - Trip Zones One Shot flag
EPWM_TZ_FLAG_DCAEVT1 - Digital Compare A Event 1 flag
EPWM_TZ_FLAG_DCAEVT2 - Digital Compare A Event 2 flag
EPWM_TZ_FLAG_DCBEVT1 - Digital Compare B Event 1 flag
EPWM_TZ_FLAG_DCBEVT2 - Digital Compare B Event 2 flag
- Parameters
base
: is the base address of the EPWM module.tzFlags
: is the Trip Zone flags.
note: A bitwise OR of the valid values can be passed as the tzFlags parameter.
- Return
None.
-
void
EPWM_clearCycleByCycleTripZoneFlag
(uint32_t base, uint16_t tzCBCFlags)¶ Clear the Trip Zone Cycle by Cycle flag.
This function clears the specific Cycle by Cycle Trip Zone flag. The following are valid values for tzCBCFlags.
EPWM_TZ_CBC_FLAG_1 - CBC 1 flag
EPWM_TZ_CBC_FLAG_2 - CBC 2 flag
EPWM_TZ_CBC_FLAG_3 - CBC 3 flag
EPWM_TZ_CBC_FLAG_4 - CBC 4 flag
EPWM_TZ_CBC_FLAG_5 - CBC 5 flag
EPWM_TZ_CBC_FLAG_6 - CBC 6 flag
EPWM_TZ_CBC_FLAG_DCAEVT2 - CBC flag Digital compare event A2
EPWM_TZ_CBC_FLAG_DCBEVT2 - CBC flag Digital compare event B2
- Parameters
base
: is the base address of the EPWM module.tzCBCFlags
: is the CBC flag to be cleared.
- Return
None.
-
void
EPWM_clearOneShotTripZoneFlag
(uint32_t base, uint16_t tzOSTFlags)¶ Clear the Trip Zone One Shot flag.
This function clears the specific One Shot (OST) Trip Zone flag. The following are valid values for tzOSTFlags.
EPWM_TZ_OST_FLAG_OST1 - OST flag for OST1
EPWM_TZ_OST_FLAG_OST2 - OST flag for OST2
EPWM_TZ_OST_FLAG_OST3 - OST flag for OST3
EPWM_TZ_OST_FLAG_OST4 - OST flag for OST4
EPWM_TZ_OST_FLAG_OST5 - OST flag for OST5
EPWM_TZ_OST_FLAG_OST6 - OST flag for OST6
EPWM_TZ_OST_FLAG_DCAEVT1 - OST flag for Digital compare event A1
EPWM_TZ_OST_FLAG_DCBEVT1 - OST flag for Digital compare event B1
- Parameters
base
: is the base address of the EPWM module.tzOSTFlags
: is the OST flags to be cleared.
- Return
None.
-
void
EPWM_forceTripZoneEvent
(uint32_t base, uint16_t tzForceEvent)¶ Force Trip Zone events.
This function forces a Trip Zone event. Valid values for tzForceEvent are:
EPWM_TZ_FORCE_EVENT_CBC - Force Trip Zones Cycle By Cycle event
EPWM_TZ_FORCE_EVENT_OST - Force Trip Zones One Shot Event
EPWM_TZ_FORCE_EVENT_DCAEVT1 - Force Digital Compare A Event 1
EPWM_TZ_FORCE_EVENT_DCAEVT2 - Force Digital Compare A Event 2
EPWM_TZ_FORCE_EVENT_DCBEVT1 - Force Digital Compare B Event 1
EPWM_TZ_FORCE_EVENT_DCBEVT2 - Force Digital Compare B Event 2
- Parameters
base
: is the base address of the EPWM module.tzForceEvent
: is the forced Trip Zone event.
- Return
None.
-
void
EPWM_enableInterrupt
(uint32_t base)¶ Enable ePWM interrupt.
This function enables the ePWM interrupt.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableInterrupt
(uint32_t base)¶ disable ePWM interrupt.
This function disables the ePWM interrupt.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setInterruptSource
(uint32_t base, uint16_t interruptSource)¶ Sets the ePWM interrupt source.
This function sets the ePWM interrupt source. Valid values for interruptSource are:
EPWM_INT_TBCTR_ZERO - Time-base counter equal to zero
EPWM_INT_TBCTR_PERIOD - Time-base counter equal to period
EPWM_INT_TBCTR_ZERO_OR_PERIOD - Time-base counter equal to zero or period
EPWM_INT_TBCTR_U_CMPx - Where x is A,B,C or D Time-base counter equal to CMPA, CMPB, CMPC or CMPD (depending the value of x) when the timer is incrementing
EPWM_INT_TBCTR_D_CMPx - Where x is A,B,C or D Time-base counter equal to CMPA, CMPB, CMPC or CMPD (depending the value of x) when the timer is decrementing
- Parameters
base
: is the base address of the EPWM module.interruptSource
: is the ePWM interrupt source.
- Return
None.
-
void
EPWM_setInterruptEventCount
(uint32_t base, uint16_t eventCount)¶ Sets the ePWM interrupt event counts.
This function sets the interrupt event count that determines the number of events that have to occur before an interrupt is issued. Maximum value for eventCount is 15.
- Parameters
base
: is the base address of the EPWM module.eventCount
: is the event count for interrupt scale
- Return
None.
-
bool
EPWM_getEventTriggerInterruptStatus
(uint32_t base)¶ Return the interrupt status.
This function returns the ePWM interrupt status.
Note This function doesn’t return the Trip Zone status.- Parameters
base
: is the base address of the EPWM module.
- Return
Returns true if ePWM interrupt was generated. Returns false if no interrupt was generated
-
void
EPWM_clearEventTriggerInterruptFlag
(uint32_t base)¶ Clear interrupt flag.
This function clears the ePWM interrupt flag.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_enableInterruptEventCountInit
(uint32_t base)¶ Enable Pre-interrupt count load.
This function enables the ePWM interrupt counter to be pre-interrupt loaded with a count value.
- Parameters
base
: is the base address of the EPWM module.
- Note
This is valid only for advanced/expanded interrupt mode
- Return
None.
-
void
EPWM_disableInterruptEventCountInit
(uint32_t base)¶ Disable interrupt count load.
This function disables the ePWM interrupt counter from being loaded with pre-interrupt count value.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_forceInterruptEventCountInit
(uint32_t base)¶ Force a software pre interrupt event counter load.
This function forces the ePWM interrupt counter to be loaded with the contents set by EPWM_setPreInterruptEventCount().
- Parameters
base
: is the base address of the EPWM module.
- Note
make sure the EPWM_enablePreInterruptEventCountLoad() function is is called before invoking this function.
- Return
None.
-
void
EPWM_setInterruptEventCountInitValue
(uint32_t base, uint16_t eventCount)¶ Set interrupt count.
This function sets the ePWM interrupt count. eventCount is the value of the pre-interrupt value that is to be loaded. The maximum value of eventCount is 15.
- Parameters
base
: is the base address of the EPWM module.eventCount
: is the ePWM interrupt count value.
- Return
None.
-
uint16_t
EPWM_getInterruptEventCount
(uint32_t base)¶ Get the interrupt count.
This function returns the ePWM interrupt event count.
- Parameters
base
: is the base address of the EPWM module.
- Return
The interrupt event counts that have occurred.
-
void
EPWM_forceEventTriggerInterrupt
(uint32_t base)¶ Force ePWM interrupt.
This function forces an ePWM interrupt.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_enableADCTrigger
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Enable ADC SOC event.
This function enables the ePWM module to trigger an ADC SOC event. Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Return
None.
-
void
EPWM_disableADCTrigger
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Disable ADC SOC event.
This function disables the ePWM module from triggering an ADC SOC event. Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Return
None.
-
void
EPWM_setADCTriggerSource
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType, EPWM_ADCStartOfConversionSource socSource)¶ Sets the ePWM SOC source.
This function sets the ePWM ADC SOC source. Valid values for socSource are:
adcSOCType
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
socSource
EPWM_SOC_DCxEVT1 - Event is based on DCxEVT1
EPWM_SOC_TBCTR_ZERO - Time-base counter equal to zero
EPWM_SOC_TBCTR_PERIOD - Time-base counter equal to period
EPWM_SOC_TBCTR_ZERO_OR_PERIOD - Time-base counter equal to zero or period
EPWM_SOC_TBCTR_U_CMPx - Where x is A,B,C or D Time-base counter equal to CMPA, CMPB, CMPC or CMPD(depending the value of x) when the timer is incrementing
EPWM_SOC_TBCTR_D_CMPx - Where x is A,B,C or D Time-base counter equal to CMPA, CMPB, CMPC or CMPD(depending the value of x) when the timer is decrementing
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.socSource
: is the SOC source.
- Return
None.
-
void
EPWM_setADCTriggerEventPrescale
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType, uint16_t preScaleCount)¶ Sets the ePWM SOC event counts.
This function sets the SOC event count that determines the number of events that have to occur before an SOC is issued. Valid values for the parameters are:
adcSOCType
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
preScaleCount
[1 - 15] - Generate SOC pulse every preScaleCount up to 15 events.
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.preScaleCount
: is the event count number.
- Note
A preScaleCount value of 0 disables the prescale.
- Return
None.
-
bool
EPWM_getADCTriggerFlagStatus
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Return the SOC event status.
This function returns the ePWM SOC status. Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Return
Returns true if the selected adcSOCType SOC was generated. Returns false if the selected adcSOCType SOC was not generated.
-
void
EPWM_clearADCTriggerFlag
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Clear SOC flag.
This function clears the ePWM SOC flag. Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Return
None
-
void
EPWM_enableADCTriggerEventCountInit
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Enable Pre-SOC event count load.
This function enables the ePWM SOC event counter which is set by the
EPWM_setADCTriggerEventCountInitValue() function to be loaded before an SOC event. Valid values for adcSOCType are:EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Note
This is valid only for advanced/expanded SOC mode
- Return
None.
-
void
EPWM_disableADCTriggerEventCountInit
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Disable Pre-SOC event count load.
This function disables the ePWM SOC event counter from being loaded before an SOC event (only an SOC event causes an increment of the counter value). Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Note
This is valid only for advanced/expanded SOC mode
- Return
None.
-
void
EPWM_forceADCTriggerEventCountInit
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Force a software pre SOC event counter load.
This function forces the ePWM SOC counter to be loaded with the contents set by EPWM_setPreADCStartOfConversionEventCount().
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type
- Note
make sure the EPWM_enableADCTriggerEventCountInit() function is called before invoking this function.
- Return
None.
-
void
EPWM_setADCTriggerEventCountInitValue
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType, uint16_t eventCount)¶ Set ADC Trigger count values.
This function sets the ePWM ADC Trigger count values. Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B The eventCount has a maximum value of 15.
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.eventCount
: is the ePWM interrupt count value.
- Return
None.
-
uint16_t
EPWM_getADCTriggerEventCount
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Get the SOC event count.
This function returns the ePWM SOC event count. Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Return
The SOC event counts that have occurred.
-
void
EPWM_forceADCTrigger
(uint32_t base, EPWM_ADCStartOfConversionType adcSOCType)¶ Force SOC event.
This function forces an ePWM SOC event. Valid values for adcSOCType are:
EPWM_SOC_A - SOC A
EPWM_SOC_B - SOC B
- Parameters
base
: is the base address of the EPWM module.adcSOCType
: is the ADC SOC type.
- Return
None
-
void
EPWM_selectDigitalCompareTripInput
(uint32_t base, EPWM_DigitalCompareTripInput tripSource, EPWM_DigitalCompareType dcType)¶ Set the DC trip input.
This function sets the trip input to the Digital Compare (DC). For a given dcType the function sets the tripSource to be the input to the DC. Valid values for the parameter are:
tripSource
EPWM_DC_TRIP_TRIPINx - Trip x,where x ranges from 1 to 15 excluding 13
EPWM_DC_TRIP_COMBINATION - selects all the Trip signals whose input is enabled by the following function EPWM_enableDigitalCompareTripCombinationInput()
dcType
EPWM_DC_TYPE_DCAH - Digital Compare A High
EPWM_DC_TYPE_DCAL - Digital Compare A Low
EPWM_DC_TYPE_DCBH - Digital Compare B High
EPWM_DC_TYPE_DCBL - Digital Compare B Low
- Parameters
base
: is the base address of the EPWM module.tripSource
: is the tripSource.dcType
: is the Digital Compare type.
- Return
None
-
void
EPWM_enableDigitalCompareBlankingWindow
(uint32_t base)¶ Enable DC filter blanking window.
This function enables the DC filter blanking window.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_disableDigitalCompareBlankingWindow
(uint32_t base)¶ Disable DC filter blanking window.
This function disables the DC filter blanking window.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_enableDigitalCompareWindowInverseMode
(uint32_t base)¶ Enable Digital Compare Window inverse mode.
This function enables the Digital Compare Window inverse mode. This will invert the blanking window.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_disableDigitalCompareWindowInverseMode
(uint32_t base)¶ Disable Digital Compare Window inverse mode.
This function disables the Digital Compare Window inverse mode.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_setDigitalCompareBlankingEvent
(uint32_t base, EPWM_DigitalCompareBlankingPulse blankingPulse)¶ Set the Digital Compare filter blanking pulse.
This function sets the input pulse that starts the Digital Compare blanking window. Valid values for blankingPulse are:
EPWM_DC_WINDOW_START_TBCTR_PERIOD - Time base counter equals period
EPWM_DC_WINDOW_START_TBCTR_ZERO - Time base counter equals zero
EPWM_DC_WINDOW_START_TBCTR_ZERO_PERIOD - Time base counter equals zero or period.
- Parameters
base
: is the base address of the EPWM module.blankingPulse
: is Pulse that starts blanking window.
- Return
None
-
void
EPWM_setDigitalCompareFilterInput
(uint32_t base, EPWM_DigitalCompareFilterInput filterInput)¶ Set up the Digital Compare filter input.
This function sets the signal input source that will be filtered by the Digital Compare module. Valid values for filterInput are:
EPWM_DC_WINDOW_SOURCE_DCAEVT1 - DC filter signal source is DCAEVT1
EPWM_DC_WINDOW_SOURCE_DCAEVT2 - DC filter signal source is DCAEVT2
EPWM_DC_WINDOW_SOURCE_DCBEVT1 - DC filter signal source is DCBEVT1
EPWM_DC_WINDOW_SOURCE_DCBEVT2 - DC filter signal source is DCBEVT2
- Parameters
base
: is the base address of the EPWM module.filterInput
: is Digital Compare signal source.
- Return
None
-
void
EPWM_enableDigitalCompareEdgeFilter
(uint32_t base)¶ Enable Digital Compare Edge Filter.
This function enables the Digital Compare Edge filter to generate event after configured number of edges.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_disableDigitalCompareEdgeFilter
(uint32_t base)¶ Disable Digital Compare Edge Filter.
This function disables the Digital Compare Edge filter.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_setDigitalCompareEdgeFilterMode
(uint32_t base, EPWM_DigitalCompareEdgeFilterMode edgeMode)¶ Set the Digital Compare Edge Filter Mode.
This function sets the Digital Compare Event filter mode. Valid values for edgeMode are:
EPWM_DC_EDGEFILT_MODE_RISING - DC edge filter mode is rising edge
EPWM_DC_EDGEFILT_MODE_FALLING - DC edge filter mode is falling edge
EPWM_DC_EDGEFILT_MODE_BOTH - DC edge filter mode is both edges
- Parameters
base
: is the base address of the EPWM module.edgeMode
: is Digital Compare Edge filter mode.
- Return
None
-
void
EPWM_setDigitalCompareEdgeFilterEdgeCount
(uint32_t base, uint16_t edgeCount)¶ Set the Digital Compare Edge Filter Edge Count.
This function sets the Digital Compare Event filter Edge Count to generate events. Valid values for edgeCount can be:
EPWM_DC_EDGEFILT_EDGECNT_0 - No edge is required to generate event
EPWM_DC_EDGEFILT_EDGECNT_1 - 1 edge is required for event generation
EPWM_DC_EDGEFILT_EDGECNT_2 - 2 edges are required for event generation
EPWM_DC_EDGEFILT_EDGECNT_3 - 3 edges are required for event generation
EPWM_DC_EDGEFILT_EDGECNT_4 - 4 edges are required for event generation
EPWM_DC_EDGEFILT_EDGECNT_5 - 5 edges are required for event generation
EPWM_DC_EDGEFILT_EDGECNT_6 - 6 edges are required for event generation
EPWM_DC_EDGEFILT_EDGECNT_7 - 7 edges are required for event generation
- Parameters
base
: is the base address of the EPWM module.edgeCount
: is Digital Compare event filter count
- Return
None
-
uint16_t
EPWM_getDigitalCompareEdgeFilterEdgeCount
(uint32_t base)¶ Returns the Digital Compare Edge Filter Edge Count.
This function returns the configured Digital Compare Edge filter edge count required to generate events. It can return values from 0-7.
- Parameters
base
: is the base address of the EPWM module.
- Return
Returns the configured DigitalCompare Edge filter edge count.
-
uint16_t
EPWM_getDigitalCompareEdgeFilterEdgeStatus
(uint32_t base)¶ Returns the Digital Compare Edge filter captured edge count status.
This function returns the count of edges captured by Digital Compare Edge filter. It can return values from 0-7.
- Parameters
base
: is the base address of the EPWM module.
- Return
Returns the count of captured edges
-
void
EPWM_setDigitalCompareWindowOffset
(uint32_t base, uint16_t windowOffsetCount)¶ Set up the Digital Compare filter window offset
This function sets the offset between window start pulse and blanking window in TBCLK count. The function take a 16bit count value for the offset value.
- Parameters
base
: is the base address of the EPWM module.windowOffsetCount
: is blanking window offset length.
- Return
None
-
void
EPWM_setDigitalCompareWindowLength
(uint32_t base, uint16_t windowLengthCount)¶ Set up the Digital Compare filter window length
This function sets up the Digital Compare filter blanking window length in TBCLK count.The function takes a 16bit count value for the window length.
- Parameters
base
: is the base address of the EPWM module.windowLengthCount
: is blanking window length.
- Return
None
-
uint16_t
EPWM_getDigitalCompareBlankingWindowOffsetCount
(uint32_t base)¶ Return DC filter blanking window offset count.
This function returns DC filter blanking window offset count.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
uint16_t
EPWM_getDigitalCompareBlankingWindowLengthCount
(uint32_t base)¶ Return DC filter blanking window length count.
This function returns DC filter blanking window length count.
- Parameters
base
: is the base address of the EPWM module.
- Return
None
-
void
EPWM_setDigitalCompareEventSource
(uint32_t base, EPWM_DigitalCompareModule dcModule, EPWM_DigitalCompareEvent dcEvent, EPWM_DigitalCompareEventSource dcEventSource)¶ Set up the Digital Compare Event source.
This function sets up the Digital Compare module Event sources. The following are valid values for the parameters.
dcModule
EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
dcEvent
EPWM_DC_EVENT_1 - Digital Compare Event number 1
EPWM_DC_EVENT_2 - Digital Compare Event number 2
dcEventSource
EPWM_DC_EVENT_SOURCE_FILT_SIGNAL - signal source is filtered
- Note
The signal source for this option is DCxEVTy, where the value of x is dependent on dcModule and the value of y is dependent on dcEvent. Possible signal sources are DCAEVT1, DCBEVT1, DCAEVT2 or DCBEVT2 depending on the value of both dcModule and dcEvent.
EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL - signal source is unfiltered The signal source for this option is DCEVTFILT.
- Return
None
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.dcEvent
: is the Digital Compare Event number.dcEventSource
: is the - Digital Compare Event source.
-
void
EPWM_setDigitalCompareEventSyncMode
(uint32_t base, EPWM_DigitalCompareModule dcModule, EPWM_DigitalCompareEvent dcEvent, EPWM_DigitalCompareSyncMode syncMode)¶ Set up the Digital Compare input sync mode.
This function sets up the Digital Compare module Event sources. The following are valid values for the parameters.
dcModule
EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
dcEvent
EPWM_DC_EVENT_1 - Digital Compare Event number 1
EPWM_DC_EVENT_2 - Digital Compare Event number 2
syncMode
EPWM_DC_EVENT_INPUT_SYNCED - DC input signal is synced with TBCLK
EPWM_DC_EVENT_INPUT_NOT SYNCED - DC input signal is not synced with TBCLK
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.dcEvent
: is the Digital Compare Event number.syncMode
: is the Digital Compare Event sync mode.
- Return
None
-
void
EPWM_enableDigitalCompareADCTrigger
(uint32_t base, EPWM_DigitalCompareModule dcModule)¶ Enable Digital Compare to generate Start of Conversion.
This function enables the Digital Compare Event 1 to generate Start of Conversion. The following are valid values for the
dcModule parameter.EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.
- Return
None
-
void
EPWM_disableDigitalCompareADCTrigger
(uint32_t base, EPWM_DigitalCompareModule dcModule)¶ Disable Digital Compare from generating Start of Conversion.
This function disables the Digital Compare Event 1 from generating Start of Conversion. The following are valid values for the
dcModule parameter.EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.
- Return
None
-
void
EPWM_enableDigitalCompareSyncEvent
(uint32_t base, EPWM_DigitalCompareModule dcModule)¶ Enable Digital Compare to generate sync out pulse.
This function enables the Digital Compare Event 1 to generate sync out pulse The following are valid values for the
dcModule parameter.EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.
- Return
None
-
void
EPWM_disableDigitalCompareSyncEvent
(uint32_t base, EPWM_DigitalCompareModule dcModule)¶ Disable Digital Compare from generating Start of Conversion.
This function disables the Digital Compare Event 1 from generating synch out pulse. The following are valid values for the
dcModule parameters.EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.
- Return
None
-
void
EPWM_setDigitalCompareCBCLatchMode
(uint32_t base, EPWM_DigitalCompareModule dcModule, EPWM_DigitalCompareEvent dcEvent, EPWM_DigitalCompareCBCLatchMode latchMode)¶ Set up the Digital Compare CBC latch mode.
This function sets up the Digital Compare CBC latch mode. The following are valid values for the parameters.
dcModule
EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
dcEvent
EPWM_DC_EVENT_1 - Digital Compare Event number 1
EPWM_DC_EVENT_2 - Digital Compare Event number 2
latchMode
EPWM_DC_CBC_LATCH_DISABLED - DC cycle-by-cycle(CBC) latch is disabled
EPWM_DC_CBC_LATCH_ENABLED - DC cycle-by-cycle(CBC) latch is enabled
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.dcEvent
: is the Digital Compare Event number.latchMode
: is the Digital Compare CBC latch mode.
- Return
None
-
void
EPWM_selectDigitalCompareCBCLatchClearEvent
(uint32_t base, EPWM_DigitalCompareModule dcModule, EPWM_DigitalCompareEvent dcEvent, EPWM_DigitalCompareCBCLatchClearEvent clearEvent)¶ Sets the Digital Compare CBC latch clear event.
This function sets the Digital Compare CBC latch clear event. The following are valid values for the parameters.
dcModule
EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
dcEvent
EPWM_DC_EVENT_1 - Digital Compare Event number 1
EPWM_DC_EVENT_2 - Digital Compare Event number 2
clearEvent
EPWM_DC_CBC_LATCH_CLR_CNTR_ZERO - DC CBC latch is cleared when counter is zero
EPWM_DC_CBC_LATCH_CLR_ON_CNTR_PERIOD - DC CBC latch is cleared when counter is equal to period
EPWM_DC_CBC_LATCH_CLR_ON_CNTR_ZERO_PERIOD - DC CBC latch is cleared when either counter is zero or equal to period
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.dcEvent
: is the Digital Compare Event number.clearEvent
: is the Digital Compare CBC latch clear event.
- Return
None
-
bool
EPWM_getDigitalCompareCBCLatchStatus
(uint32_t base, EPWM_DigitalCompareModule dcModule, EPWM_DigitalCompareEvent dcEvent)¶ Gets the Digital Compare CBC latch status
This function returns the Digital Compare module cycle-by-cycle(CBC) latch status. The following are valid values for the parameters.
dcModule
EPWM_DC_MODULE_A - Digital Compare Module A
EPWM_DC_MODULE_B - Digital Compare Module B
dcEvent
EPWM_DC_EVENT_1 - Digital Compare Event number 1
EPWM_DC_EVENT_2 - Digital Compare Event number 2
- Parameters
base
: is the base address of the EPWM module.dcModule
: is the Digital Compare module.dcEvent
: is the Digital Compare Event number.
- Return
Returns Digital Compare CBC latch status. -true - CBC latch is enabled -false - CBC latch is disabled
-
void
EPWM_enableDigitalCompareCounterCapture
(uint32_t base)¶ Enables the Time Base Counter Capture controller.
This function enables the time Base Counter Capture.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableDigitalCompareCounterCapture
(uint32_t base)¶ Disables the Time Base Counter Capture controller.
This function disable the time Base Counter Capture.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setDigitalCompareCounterShadowMode
(uint32_t base, bool enableShadowMode)¶ Set the Time Base Counter Capture mode.
This function sets the mode the Time Base Counter value is read from. If enableShadowMode is true, CPU reads of the DCCAP register will return the shadow register contents.If enableShadowMode is false, CPU reads of the DCCAP register will return the active register contents.
- Parameters
base
: is the base address of the EPWM module.enableShadowMode
: is the shadow read mode flag.
- Return
None.
-
bool
EPWM_getDigitalCompareCaptureStatus
(uint32_t base)¶ Return the DC Capture event status.
This function returns the DC capture event status.
- Parameters
base
: is the base address of the EPWM module.
- Return
Returns true if a DC capture event has occurs. Returns false if no DC Capture event has occurred.
- Return
None.
-
uint16_t
EPWM_getDigitalCompareCaptureCount
(uint32_t base)¶ Return the DC Time Base Counter capture value.
This function returns the DC Time Base Counter capture value. The value read is determined by the mode as set in the EPWM_setTimeBaseCounterReadMode() function.
- Parameters
base
: is the base address of the EPWM module.
- Return
Returns the DC Time Base Counter Capture count value.
-
void
EPWM_enableDigitalCompareTripCombinationInput
(uint32_t base, uint16_t tripInput, EPWM_DigitalCompareType dcType)¶ Enable DC TRIP combinational input.
This function enables the specified Trip input. Valid values for the parameters are:
tripInput
EPWM_DC_COMBINATIONAL_TRIPINx, where x is 1,2,…12,14,15
dcType
EPWM_DC_TYPE_DCAH - Digital Compare A High
EPWM_DC_TYPE_DCAL - Digital Compare A Low
EPWM_DC_TYPE_DCBH - Digital Compare B High
EPWM_DC_TYPE_DCBL - Digital Compare B Low
- Parameters
base
: is the base address of the EPWM module.tripInput
: is the Trip number.dcType
: is the Digital Compare module.
- Return
None.
-
void
EPWM_disableDigitalCompareTripCombinationInput
(uint32_t base, uint16_t tripInput, EPWM_DigitalCompareType dcType)¶ Disable DC TRIP combinational input.
This function disables the specified Trip input. Valid values for the parameters are:
tripInput
EPWM_DC_COMBINATIONAL_TRIPINx, where x is 1,2,…12,14,15
dcType
EPWM_DC_TYPE_DCAH - Digital Compare A High
EPWM_DC_TYPE_DCAL - Digital Compare A Low
EPWM_DC_TYPE_DCBH - Digital Compare B High
EPWM_DC_TYPE_DCBL - Digital Compare B Low
- Parameters
base
: is the base address of the EPWM module.tripInput
: is the Trip number.dcType
: is the Digital Compare module.
- Return
None.
-
void
EPWM_enableValleyCapture
(uint32_t base)¶ Enable valley capture mode.
This function enables Valley Capture mode.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableValleyCapture
(uint32_t base)¶ Disable valley capture mode.
This function disables Valley Capture mode.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_startValleyCapture
(uint32_t base)¶ Start valley capture mode.
This function starts Valley Capture sequence.
- Parameters
base
: is the base address of the EPWM module.
Make sure you invoke EPWM_setValleyTriggerSource with the trigger variable set to EPWM_VALLEY_TRIGGER_EVENT_SOFTWARE before calling this function.
- Return
None.
-
void
EPWM_setValleyTriggerSource
(uint32_t base, EPWM_ValleyTriggerSource trigger)¶ Set valley capture trigger.
This function sets the trigger value that initiates Valley Capture sequence
- Parameters
base
: is the base address of the EPWM module.trigger
: is the Valley counter trigger.
Set the number of Trigger source events for starting and stopping the valley capture using EPWM_setValleyTriggerEdgeCounts().
- Return
None.
-
void
EPWM_setValleyTriggerEdgeCounts
(uint32_t base, uint16_t startCount, uint16_t stopCount)¶ Set valley capture trigger source count.
Note: A startCount value of 0 prevents starting the valley counter. A stopCount value of 0 prevents the valley counter from stopping.
- Parameters
base
: is the base address of the EPWM module.startCount
:stopCount
: This function sets the number of trigger events required to start and stop the valley capture count. Maximum values for both startCount and stopCount is 15 corresponding to the 15th edge of the trigger event.
- Return
None.
-
void
EPWM_enableValleyHWDelay
(uint32_t base)¶ Enable valley switching delay.
This function enables Valley switching delay.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableValleyHWDelay
(uint32_t base)¶ Disable valley switching delay.
This function disables Valley switching delay.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setValleySWDelayValue
(uint32_t base, uint16_t delayOffsetValue)¶ Set Valley delay values.
This function sets the Valley delay value.
- Parameters
base
: is the base address of the EPWM module.delayOffsetValue
: is the software defined delay offset value.
- Return
None.
-
void
EPWM_setValleyDelayDivider
(uint32_t base, EPWM_ValleyDelayMode delayMode)¶ Set Valley delay mode.
This function sets the Valley delay mode values.
- Parameters
base
: is the base address of the EPWM module.delayMode
: is the Valley delay mode.
- Return
None.
-
bool
EPWM_getValleyEdgeStatus
(uint32_t base, EPWM_ValleyCounterEdge edge)¶ Get the valley edge status bit.
This function returns the status of the start or stop valley status depending on the value of edge. If a start or stop edge has occurred, the function returns true, if not it returns false.
- Parameters
base
: is the base address of the EPWM module.edge
: is the start or stop edge.
- Return
Returns true if the specified edge has occurred, Returns false if the specified edge has not occurred.
-
uint16_t
EPWM_getValleyCount
(uint32_t base)¶ Get the Valley Counter value.
This function returns the valley time base count value which is captured upon occurrence of the stop edge condition selected by
EPWM_setValleyTriggerSource() and by the stopCount variable of the EPWM_setValleyTriggerEdgeCounts() function.- Parameters
base
: is the base address of the EPWM module.
- Return
Returns the valley base time count.
-
uint16_t
EPWM_getValleyHWDelay
(uint32_t base)¶ Get the Valley delay value.
This function returns the hardware valley delay count.
- Parameters
base
: is the base address of the EPWM module.
- Return
Returns the valley delay count.
-
void
EPWM_enableGlobalLoad
(uint32_t base)¶ Enable Global shadow load mode.
This function enables Global shadow to active load mode of registers. The trigger source for loading shadow to active is determined by
EPWM_setGlobalLoadTrigger() function.- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableGlobalLoad
(uint32_t base)¶ Disable Global shadow load mode.
This function disables Global shadow to active load mode of registers. Loading shadow to active is determined individually.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setGlobalLoadTrigger
(uint32_t base, EPWM_GlobalLoadTrigger loadTrigger)¶ Set the Global shadow load pulse.
This function sets the pulse that causes Global shadow to active load. Valid values for the loadTrigger parameter are:
- Parameters
base
: is the base address of the EPWM module.loadTrigger
: is the pulse that causes global shadow load.
EPWM_GL_LOAD_PULSE_CNTR_ZERO - load when counter is equal to zero
EPWM_GL_LOAD_PULSE_CNTR_PERIOD - load when counter is equal to period
EPWM_GL_LOAD_PULSE_CNTR_ZERO_PERIOD - load when counter is equal to zero or period
EPWM_GL_LOAD_PULSE_SYNC - load on sync event
EPWM_GL_LOAD_PULSE_SYNC_OR_CNTR_ZERO - load on sync event or when counter is equal to zero
EPWM_GL_LOAD_PULSE_SYNC_OR_CNTR_PERIOD - load on sync event or when counter is equal to period
EPWM_GL_LOAD_PULSE_SYNC_CNTR_ZERO_PERIOD - load on sync event or when counter is equal to period or zero
EPWM_GL_LOAD_PULSE_GLOBAL_FORCE - load on global force
- Return
None.
-
void
EPWM_setGlobalLoadEventPrescale
(uint32_t base, uint16_t prescalePulseCount)¶ Set the number of Global load pulse event counts
This function sets the number of Global Load pulse events that have to occurred before a global load pulse is issued. Valid values for prescaleCount range from 0 to 7. 0 being no event (disables counter), and 7 representing 7 events.
- Parameters
base
: is the base address of the EPWM module.prescalePulseCount
: is the pulse event counts.
- Return
None.
-
uint16_t
EPWM_getGlobalLoadEventCount
(uint32_t base)¶ Return the number of Global load pulse event counts
This function returns the number of Global Load pulse events that have occurred. These pulse events are set by the
EPWM_setGlobalLoadTrigger() function.- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_disableGlobalLoadOneShotMode
(uint32_t base)¶ Enable continuous global shadow to active load.
This function enables global continuous shadow to active load. Register load happens every time the event set by the
EPWM_setGlobalLoadTrigger() occurs.- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_enableGlobalLoadOneShotMode
(uint32_t base)¶ Enable One shot global shadow to active load.
This function enables a one time global shadow to active load. Register load happens every time the event set by the
EPWM_setGlobalLoadTrigger() occurs.- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_setGlobalLoadOneShotLatch
(uint32_t base)¶ Set One shot global shadow to active load pulse.
This function sets a one time global shadow to active load pulse. The pulse propagates to generate a load signal if any of the events set by
EPWM_setGlobalLoadTrigger() occur.- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_forceGlobalLoadOneShotEvent
(uint32_t base)¶ Force a software One shot global shadow to active load pulse.
This function forces a software a one time global shadow to active load pulse.
- Parameters
base
: is the base address of the EPWM module.
- Return
None.
-
void
EPWM_enableGlobalLoadRegisters
(uint32_t base, uint16_t loadRegister)¶ Enable a register to be loaded Globally.
This function enables the register specified by loadRegister to be globally loaded. Valid values for loadRegister are:
EPWM_GL_REGISTER_TBPRD_TBPRDHR - Register TBPRD:TBPRDHR
EPWM_GL_REGISTER_CMPA_CMPAHR - Register CMPA:CMPAHR
EPWM_GL_REGISTER_CMPB_CMPBHR - Register CMPB:CMPBHR
EPWM_GL_REGISTER_CMPC - Register CMPC
EPWM_GL_REGISTER_CMPD - Register CMPD
EPWM_GL_REGISTER_DBRED_DBREDHR - Register DBRED:DBREDHR
EPWM_GL_REGISTER_DBFED_DBFEDHR - Register DBFED:DBFEDHR
EPWM_GL_REGISTER_DBCTL - Register DBCTL
EPWM_GL_REGISTER_AQCTLA_AQCTLA2 - Register AQCTLA/A2
EPWM_GL_REGISTER_AQCTLB_AQCTLB2 - Register AQCTLB/B2
EPWM_GL_REGISTER_AQCSFRC - Register AQCSFRC
- Parameters
base
: is the base address of the EPWM module.loadRegister
: is the register.
- Return
None.
-
void
EPWM_disableGlobalLoadRegisters
(uint32_t base, uint16_t loadRegister)¶ Disable a register to be loaded Globally.
This function disables the register specified by loadRegister from being loaded globally. The shadow to active load happens as specified by the register control Valid values for loadRegister are:
EPWM_GL_REGISTER_TBPRD_TBPRDHR - Register TBPRD:TBPRDHR
EPWM_GL_REGISTER_CMPA_CMPAHR - Register CMPA:CMPAHR
EPWM_GL_REGISTER_CMPB_CMPBHR - Register CMPB:CMPBHR
EPWM_GL_REGISTER_CMPC - Register CMPC
EPWM_GL_REGISTER_CMPD - Register CMPD
EPWM_GL_REGISTER_DBRED_DBREDHR - Register DBRED:DBREDHR
EPWM_GL_REGISTER_DBFED_DBFEDHR - Register DBFED:DBFEDHR
EPWM_GL_REGISTER_DBCTL - Register DBCTL
EPWM_GL_REGISTER_AQCTLA_AQCTLA2 - Register AQCTLA/A2
EPWM_GL_REGISTER_AQCTLB_AQCTLB2 - Register AQCTLB/B2
EPWM_GL_REGISTER_AQCSFRC - Register AQCSFRC
- Parameters
base
: is the base address of the EPWM module.loadRegister
: is the register.
- Return
None.
-
void
EPWM_lockRegisters
(uint32_t base, EPWM_LockRegisterGroup registerGroup)¶ Lock EALLOW protected register groups
This functions locks the EALLOW protected register groups specified by the registerGroup variable.
- Parameters
base
: is the base address of the EPWM module.registerGroup
: is the EALLOW register groups.
- Return
None.
-
void
EPWM_setEmulationMode
(uint32_t base, EPWM_EmulationMode emulationMode)¶ Set emulation mode
This function sets the emulation behaviours of the time base counter. Valid values for emulationMode are:
EPWM_EMULATION_STOP_AFTER_NEXT_TB - Stop after next Time Base counter increment or decrement.
EPWM_EMULATION_STOP_AFTER_FULL_CYCLE - Stop when counter completes whole cycle.
EPWM_EMULATION_FREE_RUN - Free run.
- Parameters
base
: is the base address of the EPWM module.emulationMode
: is the emulation mode.
- Return
None.
-
void
EPWM_configureSignal
(uint32_t base, const EPWM_SignalParams *signalParams)¶ Configures ePWM signal with desired frequency & duty
This function configures the ePWM module to generate a signal with desired frequency & duty.
- Parameters
base
: is the base address of the EPWM module.signalParams
: is the desired signal parameters.
- Return
None.
-
struct
EPWM_SignalParams
¶ - #include <epwm.h>
Values that can be passed to EPWM_configureSignal() as the signalParams parameter.
-
The code for this module is contained in driverlib/epwm.c, with driverlib/epwm.h containing the API declarations for use by applications.