HRPWM Module¶
The HRPWM (High Resolution Pulse width Modulator) API provides a set of functions for configuring and using the HRPWM module. The functions provided give access to the HRPWM module which extends the time resolution capability of the ePWM module thus achieving a finer resolution than would be attainable just using the main CPU clock.
-
group
hrpwm_api Defines
-
HRPWM_setTimeBaseCounterEPWM_setTimeBaseCounter¶
-
HRPWM_setCountModeAfterSyncEPWM_setCountModeAfterSync¶
-
HRPWM_setClockPrescalerEPWM_setClockPrescaler¶
-
HRPWM_swForceSyncPulseEPWM_forceSyncPulse¶
-
HRPWM_setSyncOutPulseModeEPWM_setSyncOutPulseMode¶
-
HRPWM_setPeriodLoadModeEPWM_setPeriodLoadMode¶
-
HRPWM_setTimeBaseCounterModeEPWM_setTimeBaseCounterMode¶
-
HRPWM_selectPeriodLoadEventEPWM_selectPeriodLoadEvent¶
-
HRPWM_enableOneShotSyncEPWM_enableOneShotSync¶
-
HRPWM_disableOneShotSyncEPWM_disableOneShotSync¶
-
HRPWM_startOneShotSyncEPWM_startOneShotSync¶
-
HRPWM_getTimeBaseCounterOverflowStatusEPWM_getTimeBaseCounterOverflowStatus¶
-
HRPWM_clearTimeBaseCounterOverflowEventEPWM_clearTimeBaseCounterOverflowEvent¶
-
HRPWM_getSyncStatusEPWM_getSyncStatus¶
-
HRPWM_clearSyncEventEPWM_clearSyncEvent¶
-
HRPWM_getTimeBaseCounterDirectionEPWM_getTimeBaseCounterDirection¶
-
HRPWM_setupEPWMLinksEPWM_setupEPWMLinks¶
-
HRPWM_setCounterCompareShadowLoadModeEPWM_setCounterCompareShadowLoadMode¶
-
HRPWM_disableCounterCompareShadowLoadModeEPWM_disableCounterCompareShadowLoadMode¶
-
HRPWM_getCounterCompareShadowStatusEPWM_getCounterCompareShadowStatus¶
-
HRPWM_setActionQualifierShadowLoadModeEPWM_setActionQualifierShadowLoadMode¶
-
HRPWM_disableActionQualifierShadowLoadModeEPWM_disableActionQualifierShadowLoadMode¶
-
HRPWM_setActionQualifierT1TriggerSourceEPWM_setActionQualifierT1TriggerSource¶
-
HRPWM_setActionQualifierT2TriggerSourceEPWM_setActionQualifierT2TriggerSource¶
-
HRPWM_setActionQualifierActionEPWM_setActionQualifierAction¶
-
HRPWM_setActionQualifierContSWForceShadowModeEPWM_setActionQualifierContSWForceShadowMode¶
-
HRPWM_setActionQualifierContSWForceActionEPWM_setActionQualifierContSWForceAction¶
-
HRPWM_setActionQualifierSwActionEPWM_setActionQualifierSwAction¶
-
HRPWM_setActionQualifierSWActionEPWM_setActionQualifierSWAction¶
-
HRPWM_forceActionQualifierSwActionEPWM_forceActionQualifierSwAction¶
-
HRPWM_forceActionQualifierSWActionEPWM_forceActionQualifierSWAction¶
-
HRPWM_setDeadBandOutputSwapModeEPWM_setDeadBandOutputSwapMode¶
-
HRPWM_setDeadBandDelayModeEPWM_setDeadBandDelayMode¶
-
HRPWM_setDeadBandDelayPolarityEPWM_setDeadBandDelayPolarity¶
-
HRPWM_setRisingEdgeDeadBandDelayInputEPWM_setRisingEdgeDeadBandDelayInput¶
-
HRPWM_setFallingEdgeDeadBandDelayInputEPWM_setFallingEdgeDeadBandDelayInput¶
-
HRPWM_setDeadBandControlShadowLoadModeEPWM_setDeadBandControlShadowLoadMode¶
-
HRPWM_disableDeadBandControlShadowLoadModeEPWM_disableDeadBandControlShadowLoadMode¶
-
HRPWM_setRisingEdgeDelayCountShadowLoadModeEPWM_setRisingEdgeDelayCountShadowLoadMode¶
-
HRPWM_disableRisingEdgeDelayCountShadowLoadModeEPWM_disableRisingEdgeDelayCountShadowLoadMode¶
-
HRPWM_setFallingEdgeDelayCountShadowLoadModeEPWM_setFallingEdgeDelayCountShadowLoadMode¶
-
HRPWM_disableFallingEdgeDelayCountShadowLoadModeEPWM_disableFallingEdgeDelayCountShadowLoadMode¶
-
HRPWM_setDeadBandCounterClockEPWM_setDeadBandCounterClock¶
-
HRPWM_setRisingEdgeDelayCountEPWM_setRisingEdgeDelayCount¶
-
HRPWM_setFallingEdgeDelayCountEPWM_setFallingEdgeDelayCount¶
-
HRPWM_enableChopperEPWM_enableChopper¶
-
HRPWM_disableChopperEPWM_disableChopper¶
-
HRPWM_setChopperDutyCycleEPWM_setChopperDutyCycle¶
-
HRPWM_setChopperFreqEPWM_setChopperFreq¶
-
HRPWM_setChopperFirstPulseWidtEPWM_setChopperFirstPulseWidth¶
-
HRPWM_enableTripZoneSignalsEPWM_enableTripZoneSignals¶
-
HRPWM_disableTripZoneSignalsEPWM_disableTripZoneSignals¶
-
HRPWM_setTripZoneDigitalCompareEventConditionEPWM_setTripZoneDigitalCompareEventCondition¶
-
HRPWM_enableTripZoneAdvActionEPWM_enableTripZoneAdvAction¶
-
HRPWM_disableTripZoneAdvActionEPWM_disableTripZoneAdvAction¶
-
HRPWM_setTripZoneActionEPWM_setTripZoneAction¶
-
HRPWM_setTripZoneAdvActionEPWM_setTripZoneAdvAction¶
-
HRPWM_setTripZoneAdvDigitalCompareActionAEPWM_setTripZoneAdvDigitalCompareActionA¶
-
HRPWM_setTripZoneAdvDigitalCompareActionBEPWM_setTripZoneAdvDigitalCompareActionB¶
-
HRPWM_enableTripZoneInterruptEPWM_enableTripZoneInterrupt¶
-
HRPWM_disableTripZoneInterruptEPWM_disableTripZoneInterrupt¶
-
HRPWM_getTripZoneInterruptStatusEPWM_getTripZoneFlagStatus¶
-
HRPWM_getTripZoneFlagStatusEPWM_getTripZoneFlagStatus¶
-
HRPWM_getCycleByCycleTripZoneInterruptStatusHRPWM_getCycleByCycleTripZoneFlagStatus¶
-
HRPWM_getCycleByCycleTripZoneFlagStatusEPWM_getCycleByCycleTripZoneFlagStatus¶
-
HRPWM_getOneShotTripZoneInterruptStatusHRPWM_getOneShotTripZoneFlagStatus¶
-
HRPWM_getOneShotTripZoneFlagStatusEPWM_getOneShotTripZoneFlagStatus¶
-
HRPWM_selectCycleByCycleTripZoneClearEventEPWM_selectCycleByCycleTripZoneClearEvent¶
-
HRPWM_clearTripZoneInterruptFlagHRPWM_clearTripZoneFlag¶
-
HRPWM_clearTripZoneFlagEPWM_clearTripZoneFlag¶
-
HRPWM_clearCycleByCycleTripZoneInterruptFlagHRPWM_clearCycleByCycleTripZoneFlag¶
-
HRPWM_clearCycleByCycleTripZoneFlagEPWM_clearCycleByCycleTripZoneFlag¶
-
HRPWM_clearOneShotTripZoneInterruptFlagHRPWM_clearOneShotTripZoneFlag¶
-
HRPWM_clearOneShotTripZoneFlagEPWM_clearOneShotTripZoneFlag¶
-
HRPWM_forceTripZoneEventEPWM_forceTripZoneEvent¶
-
HRPWM_enableInterruptEPWM_enableInterrupt¶
-
HRPWM_disableInterruptEPWM_disableInterrupt¶
-
HRPWM_setInterruptSourceEPWM_setInterruptSource¶
-
HRPWM_setInterruptEventCountEPWM_setInterruptEventCount¶
-
HRPWM_getEventTriggerInterruptStatusEPWM_getEventTriggerInterruptStatus¶
-
HRPWM_clearEventTriggerInterruptFlagEPWM_clearEventTriggerInterruptFlag¶
-
HRPWM_enableInterruptEventCountInitEPWM_enableInterruptEventCountInit¶
-
HRPWM_disableInterruptEventCountInitEPWM_disableInterruptEventCountInit¶
-
HRPWM_forceInterruptEventCountInitEPWM_forceInterruptEventCountInit¶
-
HRPWM_setInterruptEventCountInitValueEPWM_setInterruptEventCountInitValue¶
-
HRPWM_getInterruptEventCountEPWM_getInterruptEventCount¶
-
HRPWM_forceEventTriggerInterruptEPWM_forceEventTriggerInterrupt¶
-
HRPWM_enableADCTriggerEPWM_enableADCTrigger¶
-
HRPWM_disableADCTriggerEPWM_disableADCTrigger¶
-
HRPWM_setADCTriggerSourceEPWM_setADCTriggerSource¶
-
HRPWM_setADCTriggerEventPrescaleEPWM_setADCTriggerEventPrescale¶
-
HRPWM_getADCTriggerFlagStatusEPWM_getADCTriggerFlagStatus¶
-
HRPWM_clearADCTriggerFlagEPWM_clearADCTriggerFlag¶
-
HRPWM_enableADCTriggerEventCountInitEPWM_enableADCTriggerEventCountInit¶
-
HRPWM_disableADCTriggerEventCountInitEPWM_disableADCTriggerEventCountInit¶
-
HRPWM_forceADCTriggerEventCountInitEPWM_forceADCTriggerEventCountInit¶
-
HRPWM_setADCTriggerEventCountInitValueEPWM_setADCTriggerEventCountInitValue¶
-
HRPWM_getADCTriggerEventCountEPWM_getADCTriggerEventCount¶
-
HRPWM_forceADCTriggerEPWM_forceADCTrigger¶
-
HRPWM_selectDigitalCompareTripInputEPWM_selectDigitalCompareTripInput¶
-
HRPWM_enableDigitalCompareBlankingWindowEPWM_enableDigitalCompareBlankingWindow¶
-
HRPWM_disableDigitalCompareBlankingWindowEPWM_disableDigitalCompareBlankingWindow¶
-
HRPWM_enableDigitalCompareWindowInverseModeEPWM_enableDigitalCompareWindowInverseMode¶
-
HRPWM_disableDigitalCompareWindowInverseModeEPWM_disableDigitalCompareWindowInverseMode¶
-
HRPWM_setDigitalCompareBlankingEventEPWM_setDigitalCompareBlankingEvent¶
-
HRPWM_setDigitalCompareFilterInputEPWM_setDigitalCompareFilterInput¶
-
HRPWM_setDigitalCompareWindowOffsetEPWM_setDigitalCompareWindowOffset¶
-
HRPWM_setDigitalCompareWindowLengthEPWM_setDigitalCompareWindowLength¶
-
HRPWM_getDigitalCompareBlankingWindowOffsetCountEPWM_getDigitalCompareBlankingWindowOffsetCount¶
-
HRPWM_getDigitalCompareBlankingWindowLengthCountEPWM_getDigitalCompareBlankingWindowLengthCount¶
-
HRPWM_setDigitalCompareEventSourceEPWM_setDigitalCompareEventSource¶
-
HRPWM_setDigitalCompareEventSyncModeEPWM_setDigitalCompareEventSyncMode¶
-
HRPWM_enableDigitalCompareADCTriggerEPWM_enableDigitalCompareADCTrigger¶
-
HRPWM_disableDigitalCompareADCTriggerEPWM_disableDigitalCompareADCTrigger¶
-
HRPWM_enableDigitalCompareSyncEventEPWM_enableDigitalCompareSyncEvent¶
-
HRPWM_disableDigitalCompareSyncEventEPWM_disableDigitalCompareSyncEvent¶
-
HRPWM_enableDigitalCompareCounterCaptureEPWM_enableDigitalCompareCounterCapture¶
-
HRPWM_disableDigitalCompareCounterCaptureEPWM_disableDigitalCompareCounterCapture¶
-
HRPWM_setDigitalCompareCounterShadowModeEPWM_setDigitalCompareCounterShadowMode¶
-
HRPWM_getDigitalCompareCaptureStatusEPWM_getDigitalCompareCaptureStatus¶
-
HRPWM_getDigitalCompareCaptureCountEPWM_getDigitalCompareCaptureCount¶
-
HRPWM_enableDigitalCompareTripCombinationInputEPWM_enableDigitalCompareTripCombinationInput¶
-
HRPWM_disableDigitalCompareTripCombinationInputEPWM_disableDigitalCompareTripCombinationInput¶
-
HRPWM_enableValleyCaptureEPWM_enableValleyCapture¶
-
HRPWM_disableValleyCaptureEPWM_disableValleyCapture¶
-
HRPWM_startValleyCaptureEPWM_startValleyCapture¶
-
HRPWM_setValleyTriggerSourceEPWM_setValleyTriggerSource¶
-
HRPWM_setValleyTriggerEdgeCountsEPWM_setValleyTriggerEdgeCounts¶
-
HRPWM_enableValleyHWDelayEPWM_enableValleyHWDelay¶
-
HRPWM_disableValleyHWDelayEPWM_disableValleyHWDelay¶
-
HRPWM_setValleySWDelayValueEPWM_setValleySWDelayValue¶
-
HRPWM_setValleyDelayDividerEPWM_setValleyDelayDivider¶
-
HRPWM_getValleyEdgeStatusEPWM_getValleyEdgeStatus¶
-
HRPWM_getValleyCountEPWM_getValleyCount¶
-
HRPWM_getValleyHWDelayEPWM_getValleyHWDelay¶
-
HRPWM_enableGlobalLoadEPWM_enableGlobalLoad¶
-
HRPWM_disableGlobalLoadEPWM_disableGlobalLoad¶
-
HRPWM_setGlobalLoadTriggerEPWM_setGlobalLoadTrigger¶
-
HRPWM_setGlobalLoadEventPrescaleEPWM_setGlobalLoadEventPrescale¶
-
HRPWM_getGlobalLoadEventCountEPWM_getGlobalLoadEventCount¶
-
HRPWM_disableGlobalLoadOneShotModeEPWM_disableGlobalLoadOneShotMode¶
-
HRPWM_enableGlobalLoadOneShotModeEPWM_enableGlobalLoadOneShotMode¶
-
HRPWM_setGlobalLoadOneShotLatchEPWM_setGlobalLoadOneShotLatch¶
-
HRPWM_forceGlobalLoadOneShotEventEPWM_forceGlobalLoadOneShotEvent¶
-
HRPWM_enableGlobalLoadRegistersEPWM_enableGlobalLoadRegisters¶
-
HRPWM_disableGlobalLoadRegistersEPWM_disableGlobalLoadRegisters¶
-
HRPWM_setEmulationModeEPWM_setEmulationMode¶
Enums
-
enum
HRPWM_Channel¶ Values that can be passed to HRPWM_setMEPEdgeSelect(), HRPWM_setMEPControlMode(), HRPWM_setCounterCompareShadowLoadEvent() as the channel parameter.
Values:
-
enumerator
HRPWM_CHANNEL_A= 0¶ HRPWM A.
-
enumerator
HRPWM_CHANNEL_B= 8¶ HRPWM B.
-
enumerator
-
enum
HRPWM_MEPEdgeMode¶ Values that can be passed to HRPWM_setMEPEdgeSelect() as the mepEdgeMode parameter.
Values:
-
enumerator
HRPWM_MEP_CTRL_DISABLE= 0¶ HRPWM is disabled.
-
enumerator
HRPWM_MEP_CTRL_RISING_EDGE= 1¶ MEP controls rising edge.
-
enumerator
HRPWM_MEP_CTRL_FALLING_EDGE= 2¶ MEP controls falling edge.
-
enumerator
HRPWM_MEP_CTRL_RISING_AND_FALLING_EDGE= 3¶ MEP controls both rising and falling edge.
-
enumerator
-
enum
HRPWM_MEPCtrlMode¶ Values that can be passed to HRPWM_setHRMEPCtrlMode() as the parameter.
Values:
-
enumerator
HRPWM_MEP_DUTY_PERIOD_CTRL= 0¶ CMPAHR/CMPBHR or TBPRDHR controls MEP edge.
-
enumerator
HRPWM_MEP_PHASE_CTRL= 1¶ TBPHSHR controls MEP edge.
-
enumerator
-
enum
HRPWM_LoadMode¶ Values that can be passed to HRPWM_setCounterCompareShadowLoadEvent(), HRPWM_setRisingEdgeDelayLoadMode() and HRPWM_setFallingEdgeDelayLoadMode as the loadEvent parameter.
Values:
-
enumerator
HRPWM_LOAD_ON_CNTR_ZERO= 0¶ load when counter equals zero
-
enumerator
HRPWM_LOAD_ON_CNTR_PERIOD= 1¶ load when counter equals period
-
enumerator
HRPWM_LOAD_ON_CNTR_ZERO_PERIOD= 2¶ load when counter equals zero or period
-
enumerator
-
enum
HRPWM_ChannelBOutput¶ Values that can be passed to HRPWM_setChannelBOutputPath() as the outputOnB parameter.
Values:
-
enumerator
HRPWM_OUTPUT_ON_B_NORMAL= 0¶ ePWMxB output is normal.
-
enumerator
HRPWM_OUTPUT_ON_B_INV_A= 1¶ ePWMxB output is inverted version of ePWMxA signal
-
enumerator
-
enum
HRPWM_SyncPulseSource¶ Values that can be passed to HRPWM_setSyncPulseSource() as the syncPulseSource parameter.
Values:
-
enumerator
HRPWM_PWMSYNC_SOURCE_PERIOD= 0¶ Counter equals Period.
-
enumerator
HRPWM_PWMSYNC_SOURCE_ZERO= 1¶ Counter equals zero.
-
enumerator
HRPWM_PWMSYNC_SOURCE_COMPC_UP= 4¶ Counter equals COMPC when counting up.
-
enumerator
HRPWM_PWMSYNC_SOURCE_COMPC_DOWN= 5¶ Counter equals COMPC when counting down.
-
enumerator
HRPWM_PWMSYNC_SOURCE_COMPD_UP= 6¶ Counter equals COMPD when counting up.
-
enumerator
HRPWM_PWMSYNC_SOURCE_COMPD_DOWN= 7¶ Counter equals COMPD when counting down.
-
enumerator
-
enum
HRPWM_CounterCompareModule¶ Values that can be passed to HRPWM_setCounterCompareValue() as the compModule parameter.
Values:
-
enumerator
HRPWM_COUNTER_COMPARE_A= 0¶ counter compare A
-
enumerator
HRPWM_COUNTER_COMPARE_B= 4¶ counter compare B
-
enumerator
-
enum
HRPWM_MEPDeadBandEdgeMode¶ Values that can be passed to HRPWM_setDeadbandMEPEdgeSelect() as the mepDBEdge.
Values:
-
enumerator
HRPWM_DB_MEP_CTRL_DISABLE= 0¶ HRPWM is disabled.
-
enumerator
HRPWM_DB_MEP_CTRL_RED= 1¶ MEP controls Rising Edge Delay.
-
enumerator
HRPWM_DB_MEP_CTRL_FED= 2¶ MEP controls Falling Edge Delay.
-
enumerator
HRPWM_DB_MEP_CTRL_RED_FED= 3¶ MEP controls both Falling and Rising edge delay.
-
enumerator
-
enum
HRPWM_LockRegisterGroup¶ Values that can be passed to HRPWM_lockRegisters() as the registerGroup parameter.
Values:
-
enumerator
HRPWM_REGISTER_GROUP_HRPWM= 0x1¶ HRPWM register group.
-
enumerator
HRPWM_REGISTER_GROUP_GLOBAL_LOAD= 0x2¶ Global load register group.
-
enumerator
HRPWM_REGISTER_GROUP_TRIP_ZONE= 0x4¶ Trip zone register group.
-
enumerator
HRPWM_REGISTER_GROUP_TRIP_ZONE_CLEAR= 0x8¶ Trip zone clear group.
-
enumerator
HRPWM_REGISTER_GROUP_DIGITAL_COMPARE= 0x10¶ Digital compare group.
-
enumerator
Functions
-
void
HRPWM_setPhaseShift(uint32_t base, uint32_t phaseCount)¶ Sets the consolidated phase shift value in high resolution mode.
This function sets the consolidated phase shift value, that is, both TBPHS and TBPHSHR values are configured together.
- Parameters
base: is the base address of the EPWM module.phaseCount: is the consolidated phase shift count value.
Call EPWM_enablePhaseShiftLoad & HRPWM_enableHRPhaseShiftLoad() functions to enable loading of the phaseCount in high resolution mode.
Note: phaseCount is a 24-bit value. Note: For configuring TBPHS = 0x3C, TBPHSHR = 0x2; phaseCount = 0x3C02
- Return
None.
-
void
HRPWM_setHiResPhaseShiftOnly(uint32_t base, uint16_t hrPhaseCount)¶ Sets only the high resolution phase shift value.
This function sets only the high resolution phase shift(TBPHSHR) value. Call the HRPWM_enableHRPhaseShiftLoad() function to enable loading of the hrPhaseCount.
- Parameters
base: is the base address of the EPWM module.hrPhaseCount: is the high resolution phase shift count value.
Note: hrPhaseCount is an 8-bit value.
- Return
None.
-
void
HRPWM_setTimeBasePeriod(uint32_t base, uint32_t periodCount)¶ Sets the consolidated period of time base counter used in HR mode.
This function sets the consolidated period of time base counter value (TBPRD:TBPRDHR) required in high resolution mode.
- Parameters
base: is the base address of the EPWM module.periodCount: is the consolidated period count value.
User should map the desired period or frequency of the waveform into the correct periodCount.
Note: periodCount is a 24 bit value. Note: For configuring TBPRD = 0x3C, TBPRDHR = 0xA; periodCount = 0x3C0A
- Return
None.
-
void
HRPWM_setHiResTimeBasePeriodOnly(uint32_t base, uint16_t hrPeriodCount)¶ Sets only the high resolution time base counter.
This function sets only the high resolution time base counter(TBPRDHR) value.
- Parameters
base: is the base address of the EPWM module.hrPeriodCount: is the high resolution period count value.
User should map the desired period or frequency of the waveform into the correct hrPeriodCount.
Note: hrPeriodCount is an 8-bit value.
- Return
None.
-
uint32_t
HRPWM_getTimeBasePeriod(uint32_t base)¶ Gets the consolidated time base period count used in HR mode
This function gets the consolidated time base period(TBPRD:TBPRDHR) value used in high resolution mode.
- Parameters
base: is the base address of the EPWM module.
- Return
The consolidated time base period count value.
-
uint16_t
HRPWM_getHiResTimeBasePeriodOnly(uint32_t base)¶ Gets the only the high resolution time base period count.
This function gets only the high resolution time base period(TBPRDHR) value.
- Parameters
base: is the base address of the EPWM module.
- Return
The high resolution time base period count value.
-
void
HRPWM_setMEPEdgeSelect(uint32_t base, HRPWM_Channel channel, HRPWM_MEPEdgeMode mepEdgeMode)¶ Sets the high resolution edge controlled by MEP (Micro Edge Positioner).
This function sets the edge of the PWM that is controlled by MEP (Micro Edge Positioner). Valid values for the parameters are:
channel
HRPWM_CHANNEL_A - HRPWM A
HRPWM_CHANNEL_B - HRPWM B
mepEdgeMode
HRPWM_MEP_CTRL_DISABLE - HRPWM is disabled
HRPWM_MEP_CTRL_RISING_EDGE - MEP (Micro Edge Positioner) controls rising edge.
HRPWM_MEP_CTRL_FALLING_EDGE - MEP (Micro Edge Positioner) controls falling edge.
HRPWM_MEP_CTRL_RISING_AND_FALLING_EDGE - MEP (Micro Edge Positioner) controls both edges.
- Parameters
base: is the base address of the EPWM module.channel: is high resolution period module.mepEdgeMode: edge of the PWM that is controlled by MEP (Micro Edge Positioner).
- Return
None.
-
void
HRPWM_setMEPControlMode(uint32_t base, HRPWM_Channel channel, HRPWM_MEPCtrlMode mepCtrlMode)¶ Sets the MEP (Micro Edge Positioner) control mode.
This function sets the mode (register type) the MEP (Micro Edge Positioner) will control. Valid values for the parameters are:
channel
HRPWM_CHANNEL_A - HRPWM A
HRPWM_CHANNEL_B - HRPWM B
mepCtrlMode
HRPWM_MEP_DUTY_PERIOD_CTRL - MEP (Micro Edge Positioner) is controlled by value of CMPAHR/ CMPBHR(depending on the value of channel) or TBPRDHR.
HRPWM_MEP_PHASE_CTRL - MEP (Micro Edge Positioner) is controlled by TBPHSHR.
- Parameters
base: is the base address of the EPWM module.channel: is high resolution period module.mepCtrlMode: is the MEP (Micro Edge Positioner) control mode.
- Return
None.
-
void
HRPWM_setCounterCompareShadowLoadEvent(uint32_t base, HRPWM_Channel channel, HRPWM_LoadMode loadEvent)¶ Sets the high resolution comparator load mode.
This function sets the shadow load mode of the high resolution comparator. The function sets the COMPA or COMPB register depending on the channel variable. Valid values for the parameters are:
channel
HRPWM_CHANNEL_A - HRPWM A
HRPWM_CHANNEL_B - HRPWM B
loadEvent
HRPWM_LOAD_ON_CNTR_ZERO - load when counter equals zero
HRPWM_LOAD_ON_CNTR_PERIOD - load when counter equals period
HRPWM_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period
- Parameters
base: is the base address of the EPWM module.channel: is high resolution period module.loadEvent: is the MEP (Micro Edge Positioner) control mode.
- Return
None.
-
void
HRPWM_setOutputSwapMode(uint32_t base, bool enableOutputSwap)¶ Sets the high resolution output swap mode.
This function sets the HRPWM output swap mode. If enableOutputSwap is true, ePWMxA signal appears on ePWMxB output and ePWMxB signal appears on ePWMxA output. If it is false ePWMxA and ePWMxB outputs are unchanged.
- Parameters
base: is the base address of the EPWM module.enableOutputSwap: is the output swap flag.
- Return
None.
-
void
HRPWM_setChannelBOutputPath(uint32_t base, HRPWM_ChannelBOutput outputOnB)¶ Sets the high resolution output on ePWMxB
This function sets the HRPWM output signal on ePWMxB. If outputOnB is HRPWM_OUTPUT_ON_B_INV_A, ePWMxB output is an inverted version of ePWMxA. If outputOnB is HRPWM_OUTPUT_ON_B_NORMAL, ePWMxB output is ePWMxB.
- Parameters
base: is the base address of the EPWM module.outputOnB: is the output signal on ePWMxB.
- Return
None.
-
void
HRPWM_enableAutoConversion(uint32_t base)¶ Enables MEP (Micro Edge Positioner) automatic scale mode.
This function enables the MEP (Micro Edge Positioner) to automatically scale HRMSTEP.
- Parameters
base: is the base address of the EPWM module.
The SFO library will calculate required MEP steps per coarse steps and feed it to HRMSTEP register. The MEP calibration module will use the value in HRMSTEP to determine appropriate number of MEP steps represented by fractional duty cycle.
- Return
None.
-
void
HRPWM_disableAutoConversion(uint32_t base)¶ Disables MEP automatic scale mode.
This function disables the MEP (Micro Edge Positioner) from automatically scaling HRMSTEP.
- Parameters
base: is the base address of the EPWM module.
- Return
None.
-
void
HRPWM_enablePeriodControl(uint32_t base)¶ Enable high resolution period feature.
This function enables the high resolution period feature.
- Parameters
base: is the base address of the EPWM module.
- Return
None.
-
void
HRPWM_disablePeriodControl(uint32_t base)¶ Disable high resolution period feature.
This function disables the high resolution period feature.
- Parameters
base: is the base address of the EPWM module.
- Return
None.
-
void
HRPWM_enablePhaseShiftLoad(uint32_t base)¶ Enable high resolution phase load
This function enables loading of high resolution phase shift value which is set by the function
HRPWM_setPhaseShift().- Parameters
base: is the base address of the EPWM module.
- Return
None.
-
void
HRPWM_disablePhaseShiftLoad(uint32_t base)¶ Disable high resolution phase load
This function disables loading of high resolution phase shift value.
- Parameters
base: is the base address of the EPWM module.
- Return
-
void
HRPWM_setSyncPulseSource(uint32_t base, HRPWM_SyncPulseSource syncPulseSource)¶ Set high resolution PWMSYNC source.
This function sets the high resolution PWMSYNC pulse source. Valid values for syncPulseSource are:
HRPWM_PWMSYNC_SOURCE_PERIOD - Counter equals Period.
HRPWM_PWMSYNC_SOURCE_ZERO - Counter equals zero.
HRPWM_PWMSYNC_SOURCE_COMPC_UP - Counter equals COMPC when counting up.
HRPWM_PWMSYNC_SOURCE_COMPC_DOWN - Counter equals COMPC when counting down.
HRPWM_PWMSYNC_SOURCE_COMPD_UP - Counter equals COMPD when counting up.
HRPWM_PWMSYNC_SOURCE_COMPD_DOWN - Counter equals COMPD when counting down.
- Parameters
base: is the base address of the EPWM module.syncPulseSource: is the PWMSYNC source.
- Return
None.
-
void
HRPWM_setTranslatorRemainder(uint32_t base, uint16_t trremVal)¶ Sets the Translator Remainder value.
This function sets the Translator Remainder value.
- Parameters
base: is the base address of the EPWM module.trremVal: is the translator remainder value.
- Return
None.
-
void
HRPWM_setCounterCompareValue(uint32_t base, HRPWM_CounterCompareModule compModule, uint32_t compCount)¶ Sets the consolidated counter compare values in HR mode.
This function sets the consolidated counter compare(CMPx:CMPxHR) value required in high resolution mode for counter compare registers. Valid values for compModule are:
HRPWM_COUNTER_COMPARE_A - counter compare A.
HRPWM_COUNTER_COMPARE_B - counter compare B.
- Parameters
base: is the base address of the EPWM module.compModule: is the Counter Compare module.compCount: is the consolidated counter compare count value.
Note: compCount is a 24 bit value. Note: For configuring CMPA = 0xB4, CMPAHR = 0x64; value of compCount = 0xB464
- Return
None.
-
void
HRPWM_setHiResCounterCompareValueOnly(uint32_t base, HRPWM_CounterCompareModule compModule, uint16_t hrCompCount)¶ Sets only the high resolution counter compare value.
This function sets the high resolution counter compare value(CMPxHR) for counter compare registers. Valid values for compModule are:
HRPWM_COUNTER_COMPARE_A - counter compare A.
HRPWM_COUNTER_COMPARE_B - counter compare B.
- Parameters
base: is the base address of the EPWM module.compModule: is the Counter Compare module.hrCompCount: is the high resolution counter compare count value.
Note: hrCompCount is an 8-bit value.
- Return
None.
-
uint32_t
HRPWM_getCounterCompareValue(uint32_t base, HRPWM_CounterCompareModule compModule)¶ Gets the consolidated counter compare values.
This function gets the consolidated counter compare(CMPx:CMPxHR) value used in high resolution for the counter compare module specified. Valid values for compModule are:
HRPWM_COUNTER_COMPARE_A - counter compare A.
HRPWM_COUNTER_COMPARE_B - counter compare B.
- Parameters
base: is the base address of the EPWM module.compModule: is the Counter Compare module value.
- Return
None.
-
uint16_t
HRPWM_getHiResCounterCompareValueOnly(uint32_t base, HRPWM_CounterCompareModule compModule)¶ Gets only the high resolution counter compare values.
This function gets only the high resolution counter compare(CMPxHR) value for the counter compare module specified. Valid values for compModule are:
HRPWM_COUNTER_COMPARE_A - counter compare A.
HRPWM_COUNTER_COMPARE_B - counter compare B.
- Parameters
base: is the base address of the EPWM module.compModule: is the Counter Compare module value.
- Return
None.
-
void
HRPWM_setRisingEdgeDelay(uint32_t base, uint32_t redCount)¶ Sets the consolidated RED count in high resolution mode.
This function sets the consolidated RED (Rising Edge Delay) count (DBRED:DBREDHR) value used in high resolution mode. The value of redCount should be less than 0x200000.
- Parameters
base: is the base address of the EPWM module.redCount: is the high resolution RED count.
Note: redCount is a 21 bit value. Note: For configuring DBRED = 0x4, DBREDHR = 0x1; value of redCount = ((0x4 << 7) | 0x1) = 0x201
- Return
None.
-
void
HRPWM_setHiResRisingEdgeDelayOnly(uint32_t base, uint16_t hrRedCount)¶ Sets the high resolution RED count only.
This function sets only the high resolution RED (Rising Edge Delay) count(DBREDHR) value. The value of hrRedCount should be less than 128.
- Parameters
base: is the base address of the EPWM module.hrRedCount: is the high resolution RED count.
Note: hrRedCount is a 7-bit value.
- Return
None.
-
void
HRPWM_setFallingEdgeDelay(uint32_t base, uint32_t fedCount)¶ Sets the consolidated FED value in high resolution mode.
This function sets the consolidated FED (Falling Edge Delay) count (DBFED: DBFEDHR) value used in high resolution mode. The value of fedCount should be less than 0x200000.
- Parameters
base: is the base address of the EPWM module.fedCount: is the high resolution FED count.
Note: fedCount is a 21 bit value. Note: For configuring DBFED = 0x4, DBFEDHR = 0x1; value of fedCount = ((0x4 << 7) | 0x1) = 0x201
- Return
None.
-
void
HRPWM_setHiResFallingEdgeDelayOnly(uint32_t base, uint16_t hrFedCount)¶ Sets high resolution FED count only.
This function sets only the high resolution FED (Falling Edge Delay) count (DBFEDHR)value. The value of hrFedCount should be less than 128.
- Parameters
base: is the base address of the EPWM module.hrFedCount: is the high resolution FED count.
Note: hrFedCount is a 7-bit value.
- Return
None.
-
void
HRPWM_setMEPStep(uint32_t base, uint16_t mepCount)¶ Set high resolution MEP (Micro Edge Positioner) step.
This function sets the high resolution MEP (Micro Edge Positioner) step count. The maximum value for the MEP count step is 255.
- Parameters
base: is the base address of the EPWM module.mepCount: is the high resolution MEP (Micro Edge Positioner) step count.
- Return
None.
-
void
HRPWM_setDeadbandMEPEdgeSelect(uint32_t base, HRPWM_MEPDeadBandEdgeMode mepDBEdge)¶ Set high resolution Dead Band MEP (Micro Edge Positioner) control.
This function sets the high resolution Dead Band edge that the MEP (Micro Edge Positioner) controls Valid values for mepDBEdge are:
HRPWM_DB_MEP_CTRL_DISABLE - HRPWM is disabled
HRPWM_DB_MEP_CTRL_RED - MEP (Micro Edge Positioner) controls Rising Edge Delay
HRPWM_DB_MEP_CTRL_FED - MEP (Micro Edge Positioner) controls Falling Edge Delay
HRPWM_DB_MEP_CTRL_RED_FED - MEP (Micro Edge Positioner) controls both Falling and Rising edge delays
- Parameters
base: is the base address of the EPWM module.mepDBEdge: is the high resolution MEP (Micro Edge Positioner) control edge.
- Return
None.
-
void
HRPWM_setRisingEdgeDelayLoadMode(uint32_t base, HRPWM_LoadMode loadEvent)¶ Set the high resolution Dead Band RED load mode.
This function sets the high resolution Rising Edge Delay(RED)Dead Band count load mode. Valid values for loadEvent are:
HRPWM_LOAD_ON_CNTR_ZERO - load when counter equals zero.
HRPWM_LOAD_ON_CNTR_PERIOD - load when counter equals period
HRPWM_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period.
- Parameters
base: is the base address of the EPWM module.loadEvent: is the shadow to active load event.
- Return
None.
-
void
HRPWM_setFallingEdgeDelayLoadMode(uint32_t base, HRPWM_LoadMode loadEvent)¶ Set the high resolution Dead Band FED load mode.
This function sets the high resolution Falling Edge Delay(FED) Dead Band count load mode. Valid values for loadEvent are:
HRPWM_LOAD_ON_CNTR_ZERO - load when counter equals zero.
HRPWM_LOAD_ON_CNTR_PERIOD - load when counter equals period
HRPWM_LOAD_ON_CNTR_ZERO_PERIOD - load when counter equals zero or period.
- Parameters
base: is the base address of the EPWM module.loadEvent: is the shadow to active load event.
- Return
None.
-
The code for this module is contained in driverlib/hrpwm.c, with driverlib/hrpwm.h containing the API declarations for use by applications.