# 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_setTimeBaseCounter` EPWM_setTimeBaseCounter
  `HRPWM_setCountModeAfterSync` EPWM_setCountModeAfterSync
  `HRPWM_setClockPrescaler` EPWM_setClockPrescaler
  `HRPWM_swForceSyncPulse` EPWM_forceSyncPulse
  `HRPWM_setSyncOutPulseMode` EPWM_setSyncOutPulseMode
  `HRPWM_setPeriodLoadMode` EPWM_setPeriodLoadMode
  `HRPWM_setTimeBaseCounterMode` EPWM_setTimeBaseCounterMode
  `HRPWM_selectPeriodLoadEvent` EPWM_selectPeriodLoadEvent
  `HRPWM_enableOneShotSync` EPWM_enableOneShotSync
  `HRPWM_disableOneShotSync` EPWM_disableOneShotSync
  `HRPWM_startOneShotSync` EPWM_startOneShotSync
  `HRPWM_getTimeBaseCounterOverflowStatus` EPWM_getTimeBaseCounterOverflowStatus
  `HRPWM_clearTimeBaseCounterOverflowEvent` EPWM_clearTimeBaseCounterOverflowEvent
  `HRPWM_getSyncStatus` EPWM_getSyncStatus
  `HRPWM_clearSyncEvent` EPWM_clearSyncEvent
  `HRPWM_getTimeBaseCounterDirection` EPWM_getTimeBaseCounterDirection
  `HRPWM_setupEPWMLinks` EPWM_setupEPWMLinks
  `HRPWM_setCounterCompareShadowLoadMode` EPWM_setCounterCompareShadowLoadMode
  `HRPWM_disableCounterCompareShadowLoadMode` EPWM_disableCounterCompareShadowLoadMode
  `HRPWM_getCounterCompareShadowStatus` EPWM_getCounterCompareShadowStatus
  `HRPWM_setActionQualifierShadowLoadMode` EPWM_setActionQualifierShadowLoadMode
  `HRPWM_disableActionQualifierShadowLoadMode` EPWM_disableActionQualifierShadowLoadMode
  `HRPWM_setActionQualifierT1TriggerSource` EPWM_setActionQualifierT1TriggerSource
  `HRPWM_setActionQualifierT2TriggerSource` EPWM_setActionQualifierT2TriggerSource
  `HRPWM_setActionQualifierAction` EPWM_setActionQualifierAction
  `HRPWM_setActionQualifierContSWForceShadowMode` EPWM_setActionQualifierContSWForceShadowMode
  `HRPWM_setActionQualifierContSWForceAction` EPWM_setActionQualifierContSWForceAction
  `HRPWM_setActionQualifierSwAction` EPWM_setActionQualifierSwAction
  `HRPWM_setActionQualifierSWAction` EPWM_setActionQualifierSWAction
  `HRPWM_forceActionQualifierSwAction` EPWM_forceActionQualifierSwAction
  `HRPWM_forceActionQualifierSWAction` EPWM_forceActionQualifierSWAction
  `HRPWM_setDeadBandOutputSwapMode` EPWM_setDeadBandOutputSwapMode
  `HRPWM_setDeadBandDelayMode` EPWM_setDeadBandDelayMode
  `HRPWM_setDeadBandDelayPolarity` EPWM_setDeadBandDelayPolarity
  `HRPWM_setRisingEdgeDeadBandDelayInput` EPWM_setRisingEdgeDeadBandDelayInput
  `HRPWM_setFallingEdgeDeadBandDelayInput` EPWM_setFallingEdgeDeadBandDelayInput
  `HRPWM_setDeadBandControlShadowLoadMode` EPWM_setDeadBandControlShadowLoadMode
  `HRPWM_disableDeadBandControlShadowLoadMode` EPWM_disableDeadBandControlShadowLoadMode
  `HRPWM_setRisingEdgeDelayCountShadowLoadMode` EPWM_setRisingEdgeDelayCountShadowLoadMode
  `HRPWM_disableRisingEdgeDelayCountShadowLoadMode` EPWM_disableRisingEdgeDelayCountShadowLoadMode
  `HRPWM_setFallingEdgeDelayCountShadowLoadMode` EPWM_setFallingEdgeDelayCountShadowLoadMode
  `HRPWM_disableFallingEdgeDelayCountShadowLoadMode` EPWM_disableFallingEdgeDelayCountShadowLoadMode
  `HRPWM_setDeadBandCounterClock` EPWM_setDeadBandCounterClock
  `HRPWM_setRisingEdgeDelayCount` EPWM_setRisingEdgeDelayCount
  `HRPWM_setFallingEdgeDelayCount` EPWM_setFallingEdgeDelayCount
  `HRPWM_enableChopper` EPWM_enableChopper
  `HRPWM_disableChopper` EPWM_disableChopper
  `HRPWM_setChopperDutyCycle` EPWM_setChopperDutyCycle
  `HRPWM_setChopperFreq` EPWM_setChopperFreq
  `HRPWM_setChopperFirstPulseWidt` EPWM_setChopperFirstPulseWidth
  `HRPWM_enableTripZoneSignals` EPWM_enableTripZoneSignals
  `HRPWM_disableTripZoneSignals` EPWM_disableTripZoneSignals
  `HRPWM_setTripZoneDigitalCompareEventCondition` EPWM_setTripZoneDigitalCompareEventCondition
  `HRPWM_enableTripZoneAdvAction` EPWM_enableTripZoneAdvAction
  `HRPWM_disableTripZoneAdvAction` EPWM_disableTripZoneAdvAction
  `HRPWM_setTripZoneAction` EPWM_setTripZoneAction
  `HRPWM_setTripZoneAdvAction` EPWM_setTripZoneAdvAction
  `HRPWM_setTripZoneAdvDigitalCompareActionA` EPWM_setTripZoneAdvDigitalCompareActionA
  `HRPWM_setTripZoneAdvDigitalCompareActionB` EPWM_setTripZoneAdvDigitalCompareActionB
  `HRPWM_enableTripZoneInterrupt` EPWM_enableTripZoneInterrupt
  `HRPWM_disableTripZoneInterrupt` EPWM_disableTripZoneInterrupt
  `HRPWM_getTripZoneInterruptStatus` EPWM_getTripZoneFlagStatus
  `HRPWM_getTripZoneFlagStatus` EPWM_getTripZoneFlagStatus
  `HRPWM_getCycleByCycleTripZoneInterruptStatus` HRPWM_getCycleByCycleTripZoneFlagStatus
  `HRPWM_getCycleByCycleTripZoneFlagStatus` EPWM_getCycleByCycleTripZoneFlagStatus
  `HRPWM_getOneShotTripZoneInterruptStatus` HRPWM_getOneShotTripZoneFlagStatus
  `HRPWM_getOneShotTripZoneFlagStatus` EPWM_getOneShotTripZoneFlagStatus
  `HRPWM_selectCycleByCycleTripZoneClearEvent` EPWM_selectCycleByCycleTripZoneClearEvent
  `HRPWM_clearTripZoneInterruptFlag` HRPWM_clearTripZoneFlag
  `HRPWM_clearTripZoneFlag` EPWM_clearTripZoneFlag
  `HRPWM_clearCycleByCycleTripZoneInterruptFlag` HRPWM_clearCycleByCycleTripZoneFlag
  `HRPWM_clearCycleByCycleTripZoneFlag` EPWM_clearCycleByCycleTripZoneFlag
  `HRPWM_clearOneShotTripZoneInterruptFlag` HRPWM_clearOneShotTripZoneFlag
  `HRPWM_clearOneShotTripZoneFlag` EPWM_clearOneShotTripZoneFlag
  `HRPWM_forceTripZoneEvent` EPWM_forceTripZoneEvent
  `HRPWM_enableInterrupt` EPWM_enableInterrupt
  `HRPWM_disableInterrupt` EPWM_disableInterrupt
  `HRPWM_setInterruptSource` EPWM_setInterruptSource
  `HRPWM_setInterruptEventCount` EPWM_setInterruptEventCount
  `HRPWM_getEventTriggerInterruptStatus` EPWM_getEventTriggerInterruptStatus
  `HRPWM_clearEventTriggerInterruptFlag` EPWM_clearEventTriggerInterruptFlag
  `HRPWM_enableInterruptEventCountInit` EPWM_enableInterruptEventCountInit
  `HRPWM_disableInterruptEventCountInit` EPWM_disableInterruptEventCountInit
  `HRPWM_forceInterruptEventCountInit` EPWM_forceInterruptEventCountInit
  `HRPWM_setInterruptEventCountInitValue` EPWM_setInterruptEventCountInitValue
  `HRPWM_getInterruptEventCount` EPWM_getInterruptEventCount
  `HRPWM_forceEventTriggerInterrupt` EPWM_forceEventTriggerInterrupt
  `HRPWM_enableADCTrigger` EPWM_enableADCTrigger
  `HRPWM_disableADCTrigger` EPWM_disableADCTrigger
  `HRPWM_setADCTriggerSource` EPWM_setADCTriggerSource
  `HRPWM_setADCTriggerEventPrescale` EPWM_setADCTriggerEventPrescale
  `HRPWM_getADCTriggerFlagStatus` EPWM_getADCTriggerFlagStatus
  `HRPWM_clearADCTriggerFlag` EPWM_clearADCTriggerFlag
  `HRPWM_enableADCTriggerEventCountInit` EPWM_enableADCTriggerEventCountInit
  `HRPWM_disableADCTriggerEventCountInit` EPWM_disableADCTriggerEventCountInit
  `HRPWM_forceADCTriggerEventCountInit` EPWM_forceADCTriggerEventCountInit
  `HRPWM_setADCTriggerEventCountInitValue` EPWM_setADCTriggerEventCountInitValue
  `HRPWM_getADCTriggerEventCount` EPWM_getADCTriggerEventCount
  `HRPWM_forceADCTrigger` EPWM_forceADCTrigger
  `HRPWM_selectDigitalCompareTripInput` EPWM_selectDigitalCompareTripInput
  `HRPWM_enableDigitalCompareBlankingWindow` EPWM_enableDigitalCompareBlankingWindow
  `HRPWM_disableDigitalCompareBlankingWindow` EPWM_disableDigitalCompareBlankingWindow
  `HRPWM_enableDigitalCompareWindowInverseMode` EPWM_enableDigitalCompareWindowInverseMode
  `HRPWM_disableDigitalCompareWindowInverseMode` EPWM_disableDigitalCompareWindowInverseMode
  `HRPWM_setDigitalCompareBlankingEvent` EPWM_setDigitalCompareBlankingEvent
  `HRPWM_setDigitalCompareFilterInput` EPWM_setDigitalCompareFilterInput
  `HRPWM_setDigitalCompareWindowOffset` EPWM_setDigitalCompareWindowOffset
  `HRPWM_setDigitalCompareWindowLength` EPWM_setDigitalCompareWindowLength
  `HRPWM_getDigitalCompareBlankingWindowOffsetCount` EPWM_getDigitalCompareBlankingWindowOffsetCount
  `HRPWM_getDigitalCompareBlankingWindowLengthCount` EPWM_getDigitalCompareBlankingWindowLengthCount
  `HRPWM_setDigitalCompareEventSource` EPWM_setDigitalCompareEventSource
  `HRPWM_setDigitalCompareEventSyncMode` EPWM_setDigitalCompareEventSyncMode
  `HRPWM_enableDigitalCompareADCTrigger` EPWM_enableDigitalCompareADCTrigger
  `HRPWM_disableDigitalCompareADCTrigger` EPWM_disableDigitalCompareADCTrigger
  `HRPWM_enableDigitalCompareSyncEvent` EPWM_enableDigitalCompareSyncEvent
  `HRPWM_disableDigitalCompareSyncEvent` EPWM_disableDigitalCompareSyncEvent
  `HRPWM_enableDigitalCompareCounterCapture` EPWM_enableDigitalCompareCounterCapture
  `HRPWM_disableDigitalCompareCounterCapture` EPWM_disableDigitalCompareCounterCapture
  `HRPWM_setDigitalCompareCounterShadowMode` EPWM_setDigitalCompareCounterShadowMode
  `HRPWM_getDigitalCompareCaptureStatus` EPWM_getDigitalCompareCaptureStatus
  `HRPWM_getDigitalCompareCaptureCount` EPWM_getDigitalCompareCaptureCount
  `HRPWM_enableDigitalCompareTripCombinationInput` EPWM_enableDigitalCompareTripCombinationInput
  `HRPWM_disableDigitalCompareTripCombinationInput` EPWM_disableDigitalCompareTripCombinationInput
  `HRPWM_enableValleyCapture` EPWM_enableValleyCapture
  `HRPWM_disableValleyCapture` EPWM_disableValleyCapture
  `HRPWM_startValleyCapture` EPWM_startValleyCapture
  `HRPWM_setValleyTriggerSource` EPWM_setValleyTriggerSource
  `HRPWM_setValleyTriggerEdgeCounts` EPWM_setValleyTriggerEdgeCounts
  `HRPWM_enableValleyHWDelay` EPWM_enableValleyHWDelay
  `HRPWM_disableValleyHWDelay` EPWM_disableValleyHWDelay
  `HRPWM_setValleySWDelayValue` EPWM_setValleySWDelayValue
  `HRPWM_setValleyDelayDivider` EPWM_setValleyDelayDivider
  `HRPWM_getValleyEdgeStatus` EPWM_getValleyEdgeStatus
  `HRPWM_getValleyCount` EPWM_getValleyCount
  `HRPWM_getValleyHWDelay` EPWM_getValleyHWDelay
  `HRPWM_enableGlobalLoad` EPWM_enableGlobalLoad
  `HRPWM_disableGlobalLoad` EPWM_disableGlobalLoad
  `HRPWM_setGlobalLoadTrigger` EPWM_setGlobalLoadTrigger
  `HRPWM_setGlobalLoadEventPrescale` EPWM_setGlobalLoadEventPrescale
  `HRPWM_getGlobalLoadEventCount` EPWM_getGlobalLoadEventCount
  `HRPWM_disableGlobalLoadOneShotMode` EPWM_disableGlobalLoadOneShotMode
  `HRPWM_enableGlobalLoadOneShotMode` EPWM_enableGlobalLoadOneShotMode
  `HRPWM_setGlobalLoadOneShotLatch` EPWM_setGlobalLoadOneShotLatch
  `HRPWM_forceGlobalLoadOneShotEvent` EPWM_forceGlobalLoadOneShotEvent
  `HRPWM_enableGlobalLoadRegisters` EPWM_enableGlobalLoadRegisters
  `HRPWM_disableGlobalLoadRegisters` EPWM_disableGlobalLoadRegisters
  `HRPWM_setEmulationMode` EPWM_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.

  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.

  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.

  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 `HRPWM_LOAD_ON_CMPx_EQ` = 3

      load on translator event CMPA/B-3

  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

  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.

  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

  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.

  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.

  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

      - HRPWM_LOAD_ON_CMPx_EQ - load on translator event CMPA/B-3

    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.

  void `HRPWM_lockRegisters`(uint32_t base, HRPWM_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 `HRPWM_setXCMPRegValue`(uint32_t base, EPWM_XCMPReg xcmpReg, uint32_t xcmpValue)

    Sets the consolidated XCMP values in HR mode.

    This function sets the consolidated counter compare(XCMPx:XCMPxHR) value required in high resolution mode for XCMP registers. Valid values for xcmpReg are: EPWM_XCMP[1-8]_[ACTIVE/SHADOW1/SHADOW2/SHADOW3] -XCMP[1-8]_[ACTIVE/SHADOW1/SHADOW2/SHADOW3] EPWM_XTBPRD_ACTIVE -XTBPRD_ACTIVE EPWM_XTBPRD_SHADOW1 -XTBPRD_SHADOW1 EPWM_XTBPRD_SHADOW2 -XTBPRD_SHADOW2 EPWM_XTBPRD_SHADOW3 -XTBPRD_SHADOW3

    Parameters

      - `base`: is the base address of the EPWM module

      - `xcmpReg`: is the XCMP register offset

      - `xcmpValue`: is the consolidated value to be written to XCMP registers

    Note: For configuring XCMPx = 0x3E8, XCMPxHR = 0x64; value of xcmpValue = 0x03E80064

    Return

      None.

  void `HRPWM_setHiResXCMPRegValueOnly`(uint32_t base, EPWM_XCMPReg xcmpReg, uint32_t hrXcmpValue)

    Sets only the high resolution XCMP value.

    This function sets the high resolution counter compare value(XCMPx_HR) for XCMP registers. Valid values for xcmpReg are: EPWM_XCMP[1-8]_[ACTIVE/SHADOW1/SHADOW2/SHADOW3] -XCMP[1-8]_[ACTIVE/SHADOW1/SHADOW2/SHADOW3] EPWM_XTBPRD_ACTIVE -XTBPRD_ACTIVE EPWM_XTBPRD_SHADOW1 -XTBPRD_SHADOW1 EPWM_XTBPRD_SHADOW2 -XTBPRD_SHADOW2 EPWM_XTBPRD_SHADOW3 -XTBPRD_SHADOW3

    Parameters

      - `base`: is the base address of the EPWM module

      - `xcmpReg`: is the XCMP register offset

      - `hrXcmpValue`: is the HR value to be written to XCMP registers

    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.