Driverlib ECAP API
Module: Driverlib (AM13E232X) APIs
Structures
Name |
|
|---|---|
struct |
DL_ECAP_ApwmModeConfig |
struct |
DL_ECAP_CaptureModeConfig |
struct |
DL_ECAP_SyncConfig |
struct |
DL_ECAP_InterruptsConfig |
struct |
DL_ECAP_Config |
Types
Name |
|
|---|---|
enum |
DL_ECAP_EMULATION_MODE { DL_ECAP_EMULATION_STOP = 0x0U, DL_ECAP_EMULATION_RUN_TO_ZERO = 0x1U, DL_ECAP_EMULATION_FREE_RUN = 0x2U} |
enum |
DL_ECAP_CAPTURE_MODE { DL_ECAP_CONTINUOUS_CAPTURE_MODE = 0U, DL_ECAP_ONE_SHOT_CAPTURE_MODE = 1U} |
enum |
DL_ECAP_EVENT { DL_ECAP_EVENT_1 = 0U, DL_ECAP_EVENT_2 = 1U, DL_ECAP_EVENT_3 = 2U, DL_ECAP_EVENT_4 = 3U} |
enum |
DL_ECAP_SYNC_OUT_MODE { DL_ECAP_SYNC_OUT_SYNCI = 0U, DL_ECAP_SYNC_OUT_COUNTER_PRD = 1U, DL_ECAP_SYNC_OUT_DISABLED = 2U} |
enum |
DL_ECAP_APWM_POLARITY { DL_ECAP_APWM_ACTIVE_HIGH = 0U, DL_ECAP_APWM_ACTIVE_LOW = 1U} |
enum |
DL_ECAP_EVENT_POLARITY { DL_ECAP_EVENT_RISING_EDGE = 0U, DL_ECAP_EVENT_FALLING_EDGE = 1U} |
enum |
DL_ECAP_INPUT { DL_ECAP_INPUT_INPUTXBAR1 = 0U, DL_ECAP_INPUT_INPUTXBAR2 = 1U, DL_ECAP_INPUT_INPUTXBAR3 = 2U, DL_ECAP_INPUT_INPUTXBAR4 = 3U, DL_ECAP_INPUT_INPUTXBAR5 = 4U, DL_ECAP_INPUT_INPUTXBAR6 = 5U, DL_ECAP_INPUT_INPUTXBAR7 = 6U, DL_ECAP_INPUT_INPUTXBAR8 = 7U, DL_ECAP_INPUT_INPUTXBAR9 = 8U, DL_ECAP_INPUT_INPUTXBAR10 = 9U, DL_ECAP_INPUT_INPUTXBAR11 = 10U, DL_ECAP_INPUT_INPUTXBAR12 = 11U, DL_ECAP_INPUT_INPUTXBAR13 = 12U, DL_ECAP_INPUT_INPUTXBAR14 = 13U, DL_ECAP_INPUT_INPUTXBAR15 = 14U, DL_ECAP_INPUT_INPUTXBAR16 = 15U, DL_ECAP_INPUT_MCAN0_INT0 = 16U, DL_ECAP_INPUT_OUTPUTXBAR1 = 17U, DL_ECAP_INPUT_OUTPUTXBAR2 = 18U, DL_ECAP_INPUT_OUTPUTXBAR3 = 19U, DL_ECAP_INPUT_OUTPUTXBAR4 = 20U, DL_ECAP_INPUT_OUTPUTXBAR5 = 21U, DL_ECAP_INPUT_OUTPUTXBAR6 = 22U, DL_ECAP_INPUT_OUTPUTXBAR7 = 23U, DL_ECAP_INPUT_OUTPUTXBAR8 = 24U, DL_ECAP_INPUT_MCAN1_INT0 = 25U, DL_ECAP_INPUT_ADC0_EVT1 = 29U, DL_ECAP_INPUT_ADC0_EVT2 = 30U, DL_ECAP_INPUT_ADC0_EVT3 = 31U, DL_ECAP_INPUT_ADC0_EVT4 = 32U, DL_ECAP_INPUT_ADC1_EVT1 = 33U, DL_ECAP_INPUT_ADC1_EVT2 = 34U, DL_ECAP_INPUT_ADC1_EVT3 = 35U, DL_ECAP_INPUT_ADC1_EVT4 = 36U, DL_ECAP_INPUT_ADC2_EVT1 = 37U, DL_ECAP_INPUT_ADC2_EVT2 = 38U, DL_ECAP_INPUT_ADC2_EVT3 = 39U, DL_ECAP_INPUT_ADC2_EVT4 = 40U, DL_ECAP_INPUT_CMPSS0_CTRIPL = 41U, DL_ECAP_INPUT_CMPSS1_CTRIPL = 42U, DL_ECAP_INPUT_CMPSS2_CTRIPL = 43U, DL_ECAP_INPUT_CMPSS3_CTRIPL = 44U, DL_ECAP_INPUT_CMPSS0_CTRIPH = 45U, DL_ECAP_INPUT_CMPSS1_CTRIPH = 46U, DL_ECAP_INPUT_CMPSS2_CTRIPH = 47U, DL_ECAP_INPUT_CMPSS3_CTRIPH = 48U, DL_ECAP_INPUT_CMPSS0_CTRIPH_OR_CTRIPL = 49U, DL_ECAP_INPUT_CMPSS1_CTRIPH_OR_CTRIPL = 50U, DL_ECAP_INPUT_CMPSS2_CTRIPH_OR_CTRIPL = 51U, DL_ECAP_INPUT_CMPSS3_CTRIPH_OR_CTRIPL = 52U, DL_ECAP_INPUT_ECAP0_INPUTXBAR7 = 53U, DL_ECAP_INPUT_ECAP1_INPUTXBAR8 = 53U, DL_ECAP_INPUT_ECAP2_INPUTXBAR9 = 53U, DL_ECAP_INPUT_FSIRXA_MEASURE = 54U, DL_ECAP_INPUT_FSIRXA_MEASURE_RISE = 55U, DL_ECAP_INPUT_FSIRXA_MEASURE_FALL = 56U, DL_ECAP_INPUT_SDFM0FLT1_COMPL = 57U, DL_ECAP_INPUT_SDFM0FLT2_COMPL = 58U, DL_ECAP_INPUT_SDFM0FLT3_COMPL = 59U, DL_ECAP_INPUT_SDFM0FLT4_COMPL = 60U, DL_ECAP_INPUT_SDFM0FLT1_COMPZ = 61U, DL_ECAP_INPUT_SDFM0FLT2_COMPZ = 62U, DL_ECAP_INPUT_SDFM0FLT3_COMPZ = 63U, DL_ECAP_INPUT_SDFM0FLT4_COMPZ = 64U, DL_ECAP_INPUT_SDFM0FLT1_COMPH = 65U, DL_ECAP_INPUT_SDFM0FLT2_COMPH = 66U, DL_ECAP_INPUT_SDFM0FLT3_COMPH = 67U, DL_ECAP_INPUT_SDFM0FLT4_COMPH = 68U, DL_ECAP_INPUT_SDFM0FLT1_COMPH_OR_COMPL = 69U, DL_ECAP_INPUT_SDFM0FLT2_COMPH_OR_COMPL = 70U, DL_ECAP_INPUT_SDFM0FLT3_COMPH_OR_COMPL = 71U, DL_ECAP_INPUT_SDFM0FLT4_COMPH_OR_COMPL = 72U, DL_ECAP_INPUT_ECAT_SYNC0 = 73U, DL_ECAP_INPUT_ECAT_SYNC1 = 74U, DL_ECAP_INPUT_GPIO8 = 75U, DL_ECAP_INPUT_GPIO9 = 76U, DL_ECAP_INPUT_GPIO22 = 77U, DL_ECAP_INPUT_GPIO23 = 78U} |
enum |
DL_ECAP_SYNC_IN_PULSE_SRC { DL_ECAP_SYNC_IN_PULSE_SRC_DISABLE = 0U, DL_ECAP_SYNC_IN_PULSE_SRC_ECAP0_SYNCOUT = 3U, DL_ECAP_SYNC_IN_PULSE_SRC_ECAP1_SYNCOUT = 4U, DL_ECAP_SYNC_IN_PULSE_SRC_MCPWM0_SYNCOUT = 5U, DL_ECAP_SYNC_IN_PULSE_SRC_MCPWM1_SYNCOUT = 6U, DL_ECAP_SYNC_IN_PULSE_SRC_MCPWM2_SYNCOUT = 7U, DL_ECAP_SYNC_IN_PULSE_SRC_ECAP2_SYNCOUT = 10U, DL_ECAP_SYNC_IN_PULSE_SRC_EPWM0_SYNCOUT = 11U, DL_ECAP_SYNC_IN_PULSE_SRC_EPWM1_SYNCOUT = 12U, DL_ECAP_SYNC_IN_PULSE_SRC_EPWM2_SYNCOUT = 13U, DL_ECAP_SYNC_IN_PULSE_SRC_EPWM3_SYNCOUT = 14U, DL_ECAP_SYNC_IN_PULSE_SRC_EPWM4_SYNCOUT = 15U, DL_ECAP_SYNC_IN_PULSE_SRC_EPWM5_SYNCOUT = 16U, DL_ECAP_SYNC_IN_PULSE_SRC_ECAT_SYNC0 = 17U, DL_ECAP_SYNC_IN_PULSE_SRC_ECAT_SYNC1 = 18U, DL_ECAP_SYNC_IN_PULSE_SRC_FSIRXA_TRIG1 = 19U, DL_ECAP_SYNC_IN_PULSE_SRC_INPUTXBAR5 = 20U, DL_ECAP_SYNC_IN_PULSE_SRC_INPUTXBAR6 = 21U} |
enum |
DL_ECAP_OPERATING_MODE { DL_ECAP_OPERATING_MODE_CAPTURE = 0x0U, DL_ECAP_OPERATING_MODE_APWM = 0x1U} |
enum |
DL_ECAP_HRCAP_CALIBRATION_CLOCK { DL_ECAP_HRCAP_CALIBRATION_CLOCK_SYSCLK = 0U, DL_ECAP_HRCAP_CALIBRATION_CLOCK_HRCLK = 1U} |
Functions
Name |
|
|---|---|
__STATIC_INLINE void |
DL_ECAP_setEventPrescaler(ECAP_Regs * ecap, uint16_t prescalerValue) |
__STATIC_INLINE void |
DL_ECAP_setEventPolarity(ECAP_Regs * ecap, DL_ECAP_EVENT event, DL_ECAP_EVENT_POLARITY polarity) |
__STATIC_INLINE void |
DL_ECAP_setCaptureMode(ECAP_Regs * ecap, DL_ECAP_CAPTURE_MODE mode, DL_ECAP_EVENT event) |
__STATIC_INLINE void |
DL_ECAP_reArm(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_enableInterrupt(ECAP_Regs * ecap, uint16_t intFlags) |
__STATIC_INLINE void |
DL_ECAP_disableInterrupt(ECAP_Regs * ecap, uint16_t intFlags) |
__STATIC_INLINE uint16_t |
DL_ECAP_getInterruptSource(ECAP_Regs * ecap) |
__STATIC_INLINE bool |
DL_ECAP_getGlobalInterruptStatus(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_clearInterrupt(ECAP_Regs * ecap, uint16_t intFlags) |
__STATIC_INLINE void |
DL_ECAP_clearGlobalInterrupt(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_forceInterrupt(ECAP_Regs * ecap, uint16_t intFlags) |
__STATIC_INLINE void |
DL_ECAP_enableCaptureMode(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_enableAPWMMode(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_enableCounterResetOnEvent(ECAP_Regs * ecap, DL_ECAP_EVENT event) |
__STATIC_INLINE void |
DL_ECAP_disableCounterResetOnEvent(ECAP_Regs * ecap, DL_ECAP_EVENT event) |
__STATIC_INLINE void |
DL_ECAP_enableTimeStampCapture(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_disableTimeStampCapture(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_setPhaseShiftCount(ECAP_Regs * ecap, uint32_t shiftCount) |
__STATIC_INLINE void |
DL_ECAP_setSyncInPulseSource(ECAP_Regs * ecap, DL_ECAP_SYNC_IN_PULSE_SRC source) |
__STATIC_INLINE void |
DL_ECAP_enableLoadCounter(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_disableLoadCounter(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_loadCounter(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_setSyncOutMode(ECAP_Regs * ecap, DL_ECAP_SYNC_OUT_MODE mode) |
__STATIC_INLINE void |
DL_ECAP_stopCounter(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_startCounter(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_setAPWMPolarity(ECAP_Regs * ecap, DL_ECAP_APWM_POLARITY polarity) |
__STATIC_INLINE void |
DL_ECAP_setAPWMPeriod(ECAP_Regs * ecap, uint32_t periodCount) |
__STATIC_INLINE void |
DL_ECAP_setAPWMCompare(ECAP_Regs * ecap, uint32_t compareCount) |
__STATIC_INLINE void |
DL_ECAP_setAPWMShadowPeriod(ECAP_Regs * ecap, uint32_t periodCount) |
__STATIC_INLINE void |
DL_ECAP_setAPWMShadowCompare(ECAP_Regs * ecap, uint32_t compareCount) |
__STATIC_INLINE uint32_t |
DL_ECAP_getTimeStampCounter(ECAP_Regs * ecap) |
__STATIC_INLINE uint32_t |
DL_ECAP_getEventTimeStamp(ECAP_Regs * ecap, DL_ECAP_EVENT event) |
__STATIC_INLINE void |
DL_ECAP_selectECAPInput(ECAP_Regs * ecap, DL_ECAP_INPUT input) |
__STATIC_INLINE void |
DL_ECAP_resetCounters(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_setDMASource(ECAP_Regs * ecap, DL_ECAP_EVENT event) |
__STATIC_INLINE DL_ECAP_EVENT |
DL_ECAP_getModuloCounterStatus(ECAP_Regs * ecap) |
__STATIC_INLINE void |
DL_ECAP_setEmulationMode(ECAP_Regs * ecap, DL_ECAP_EMULATION_MODE mode) |
void |
DL_ECAP_initParamsSetDefault(DL_ECAP_Config * config) |
void |
DL_ECAP_init(ECAP_Regs * ecap, DL_ECAP_Config * config) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_enableHighResolution(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_disableHighResolution(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_enableHighResolutionClock(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_disableHighResolutionClock(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_startCalibration(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_setCalibrationMode(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE bool |
DL_ECAP_HRCAP_isCalibrationBusy(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_enableCalibrationInterrupt(ECAP_HRCAP_Regs * hrcap, uint32_t intFlags) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_disableCalibrationInterrupt(ECAP_HRCAP_Regs * hrcap, uint32_t intFlags) |
__STATIC_INLINE uint32_t |
DL_ECAP_HRCAP_getCalibrationFlags(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_clearCalibrationFlags(ECAP_HRCAP_Regs * hrcap, uint32_t flags) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_forceCalibrationFlags(ECAP_HRCAP_Regs * hrcap, uint32_t flags) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_setCalibrationPeriod(ECAP_HRCAP_Regs * hrcap, uint32_t sysclkHz) |
__STATIC_INLINE void |
DL_ECAP_HRCAP_configCalibrationPeriod(ECAP_HRCAP_Regs * hrcap, uint32_t sysclkHz, float periodInMs) |
__STATIC_INLINE uint32_t |
DL_ECAP_HRCAP_getCalibrationClockPeriod(ECAP_HRCAP_Regs * hrcap, DL_ECAP_HRCAP_CALIBRATION_CLOCK clockSource) |
__STATIC_INLINE float |
DL_ECAP_HRCAP_getScaleFactor(ECAP_HRCAP_Regs * hrcap) |
__STATIC_INLINE float |
DL_ECAP_HRCAP_convertEventTimeStampNanoseconds(uint32_t timeStamp, float scaleFactor) |
Defines
Name |
|
|---|---|
DL_ECAP_MAX_PRESCALER_VALUE |
|
DL_ECAP_ISR_SOURCE_CEVT1 |
|
DL_ECAP_ISR_SOURCE_CEVT2 |
|
DL_ECAP_ISR_SOURCE_CEVT3 |
|
DL_ECAP_ISR_SOURCE_CEVT4 |
|
DL_ECAP_ISR_SOURCE_CTROVF |
|
DL_ECAP_ISR_SOURCE_CTR_PRD |
|
DL_ECAP_ISR_SOURCE_CTR_CMP |
|
DL_ECAP_HRCAP_ISR_SOURCE_GLOBAL_CALIBRATION |
|
DL_ECAP_HRCAP_ISR_SOURCE_CALIBDONE |
|
DL_ECAP_HRCAP_ISR_SOURCE_CALPRDCHKSTS |
|
DL_ECAP_HRCAP_CALIBRATION_PERIOD_US |
|
DL_ECAP_US_PER_SEC |
|
DL_ECAP_MS_PER_SEC |
|
DL_ECAP_HRCAP_SYSCLK_PERIOD_NS |
|
DL_ECAP_HRCAP_MEP_STEPS_PER_SYSCLK |
|
DL_ECAP_INPUT_COUNT |
Types Documentation
enum DL_ECAP_EMULATION_MODE
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_EMULATION_STOP |
0x0U |
TSCTR is stopped on emulation suspension |
DL_ECAP_EMULATION_RUN_TO_ZERO |
0x1U |
TSCTR runs until 0 before stopping on emulation suspension |
DL_ECAP_EMULATION_FREE_RUN |
0x2U |
TSCTR is not affected by emulation suspension |
ECAP emulation modes.
enum DL_ECAP_CAPTURE_MODE
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_CONTINUOUS_CAPTURE_MODE |
0U |
eCAP operates in continuous capture mode |
DL_ECAP_ONE_SHOT_CAPTURE_MODE |
1U |
eCAP operates in one shot capture mode |
ECAP capture modes.
enum DL_ECAP_EVENT
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_EVENT_1 |
0U |
eCAP event 1 |
DL_ECAP_EVENT_2 |
1U |
eCAP event 2 |
DL_ECAP_EVENT_3 |
2U |
eCAP event 3 |
DL_ECAP_EVENT_4 |
3U |
eCAP event 4 |
ECAP event numbers.
enum DL_ECAP_SYNC_OUT_MODE
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_SYNC_OUT_SYNCI |
0U |
Sync out on the sync in signal and software force |
DL_ECAP_SYNC_OUT_COUNTER_PRD |
1U |
Sync out on counter equals period |
DL_ECAP_SYNC_OUT_DISABLED |
2U |
Disable sync out signal |
ECAP sync out mode.
enum DL_ECAP_APWM_POLARITY
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_APWM_ACTIVE_HIGH |
0U |
APWM is active high |
DL_ECAP_APWM_ACTIVE_LOW |
1U |
APWM is active low |
ECAP APWM polarity.
enum DL_ECAP_EVENT_POLARITY
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_EVENT_RISING_EDGE |
0U |
Rising edge polarity |
DL_ECAP_EVENT_FALLING_EDGE |
1U |
Falling edge polarity |
ECAP event polarity.
enum DL_ECAP_INPUT
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_INPUT_INPUTXBAR1 |
0U |
Input signal from INPUTXBAR1 |
DL_ECAP_INPUT_INPUTXBAR2 |
1U |
Input signal from INPUTXBAR2 |
DL_ECAP_INPUT_INPUTXBAR3 |
2U |
Input signal from INPUTXBAR3 |
DL_ECAP_INPUT_INPUTXBAR4 |
3U |
Input signal from INPUTXBAR4 |
DL_ECAP_INPUT_INPUTXBAR5 |
4U |
Input signal from INPUTXBAR5 |
DL_ECAP_INPUT_INPUTXBAR6 |
5U |
Input signal from INPUTXBAR6 |
DL_ECAP_INPUT_INPUTXBAR7 |
6U |
Input signal from INPUTXBAR7 |
DL_ECAP_INPUT_INPUTXBAR8 |
7U |
Input signal from INPUTXBAR8 |
DL_ECAP_INPUT_INPUTXBAR9 |
8U |
Input signal from INPUTXBAR9 |
DL_ECAP_INPUT_INPUTXBAR10 |
9U |
Input signal from INPUTXBAR10 |
DL_ECAP_INPUT_INPUTXBAR11 |
10U |
Input signal from INPUTXBAR11 |
DL_ECAP_INPUT_INPUTXBAR12 |
11U |
Input signal from INPUTXBAR12 |
DL_ECAP_INPUT_INPUTXBAR13 |
12U |
Input signal from INPUTXBAR13 |
DL_ECAP_INPUT_INPUTXBAR14 |
13U |
Input signal from INPUTXBAR14 |
DL_ECAP_INPUT_INPUTXBAR15 |
14U |
Input signal from INPUTXBAR15 |
DL_ECAP_INPUT_INPUTXBAR16 |
15U |
Input signal from INPUTXBAR16 |
DL_ECAP_INPUT_MCAN0_INT0 |
16U |
Input signal from MCAN0_INT0 |
DL_ECAP_INPUT_OUTPUTXBAR1 |
17U |
Input signal from OUTPUTXBAR1 |
DL_ECAP_INPUT_OUTPUTXBAR2 |
18U |
Input signal from OUTPUTXBAR2 |
DL_ECAP_INPUT_OUTPUTXBAR3 |
19U |
Input signal from OUTPUTXBAR3 |
DL_ECAP_INPUT_OUTPUTXBAR4 |
20U |
Input signal from OUTPUTXBAR4 |
DL_ECAP_INPUT_OUTPUTXBAR5 |
21U |
Input signal from OUTPUTXBAR5 |
DL_ECAP_INPUT_OUTPUTXBAR6 |
22U |
Input signal from OUTPUTXBAR6 |
DL_ECAP_INPUT_OUTPUTXBAR7 |
23U |
Input signal from OUTPUTXBAR7 |
DL_ECAP_INPUT_OUTPUTXBAR8 |
24U |
Input signal from OUTPUTXBAR8 |
DL_ECAP_INPUT_MCAN1_INT0 |
25U |
Input signal from MCAN1_INT0 |
DL_ECAP_INPUT_ADC0_EVT1 |
29U |
Input signal from ADC0_EVT1 |
DL_ECAP_INPUT_ADC0_EVT2 |
30U |
Input signal from ADC0_EVT2 |
DL_ECAP_INPUT_ADC0_EVT3 |
31U |
Input signal from ADC0_EVT3 |
DL_ECAP_INPUT_ADC0_EVT4 |
32U |
Input signal from ADC0_EVT4 |
DL_ECAP_INPUT_ADC1_EVT1 |
33U |
Input signal from ADC1_EVT1 |
DL_ECAP_INPUT_ADC1_EVT2 |
34U |
Input signal from ADC1_EVT2 |
DL_ECAP_INPUT_ADC1_EVT3 |
35U |
Input signal from ADC1_EVT3 |
DL_ECAP_INPUT_ADC1_EVT4 |
36U |
Input signal from ADC1_EVT4 |
DL_ECAP_INPUT_ADC2_EVT1 |
37U |
Input signal from ADC2_EVT1 |
DL_ECAP_INPUT_ADC2_EVT2 |
38U |
Input signal from ADC2_EVT2 |
DL_ECAP_INPUT_ADC2_EVT3 |
39U |
Input signal from ADC2_EVT3 |
DL_ECAP_INPUT_ADC2_EVT4 |
40U |
Input signal from ADC2_EVT4 |
DL_ECAP_INPUT_CMPSS0_CTRIPL |
41U |
Input signal from CMPSS0_CTRIPL |
DL_ECAP_INPUT_CMPSS1_CTRIPL |
42U |
Input signal from CMPSS1_CTRIPL |
DL_ECAP_INPUT_CMPSS2_CTRIPL |
43U |
Input signal from CMPSS2_CTRIPL |
DL_ECAP_INPUT_CMPSS3_CTRIPL |
44U |
Input signal from CMPSS3_CTRIPL |
DL_ECAP_INPUT_CMPSS0_CTRIPH |
45U |
Input signal from CMPSS0_CTRIPH |
DL_ECAP_INPUT_CMPSS1_CTRIPH |
46U |
Input signal from CMPSS1_CTRIPH |
DL_ECAP_INPUT_CMPSS2_CTRIPH |
47U |
Input signal from CMPSS2_CTRIPH |
DL_ECAP_INPUT_CMPSS3_CTRIPH |
48U |
Input signal from CMPSS3_CTRIPH |
DL_ECAP_INPUT_CMPSS0_CTRIPH_OR_CTRIPL |
49U |
Input signal from CMPSS0_CTRIPH_OR_CTRIPL |
DL_ECAP_INPUT_CMPSS1_CTRIPH_OR_CTRIPL |
50U |
Input signal from CMPSS1_CTRIPH_OR_CTRIPL |
DL_ECAP_INPUT_CMPSS2_CTRIPH_OR_CTRIPL |
51U |
Input signal from CMPSS2_CTRIPH_OR_CTRIPL |
DL_ECAP_INPUT_CMPSS3_CTRIPH_OR_CTRIPL |
52U |
Input signal from CMPSS3_CTRIPH_OR_CTRIPL |
DL_ECAP_INPUT_ECAP0_INPUTXBAR7 |
53U |
Input signal from ECAP0_INPUTXBAR7 |
DL_ECAP_INPUT_ECAP1_INPUTXBAR8 |
53U |
Input signal from ECAP1_INPUTXBAR8 |
DL_ECAP_INPUT_ECAP2_INPUTXBAR9 |
53U |
Input signal from ECAP2_INPUTXBAR9 |
DL_ECAP_INPUT_FSIRXA_MEASURE |
54U |
Input signal from FSIRXA_MEASURE |
DL_ECAP_INPUT_FSIRXA_MEASURE_RISE |
55U |
Input signal from FSIRXA_MEASURE_RISE |
DL_ECAP_INPUT_FSIRXA_MEASURE_FALL |
56U |
Input signal from FSIRXA_MEASURE_FALL |
DL_ECAP_INPUT_SDFM0FLT1_COMPL |
57U |
Input signal from SDFM0FLT1_COMPL |
DL_ECAP_INPUT_SDFM0FLT2_COMPL |
58U |
Input signal from SDFM0FLT2_COMPL |
DL_ECAP_INPUT_SDFM0FLT3_COMPL |
59U |
Input signal from SDFM0FLT3_COMPL |
DL_ECAP_INPUT_SDFM0FLT4_COMPL |
60U |
Input signal from SDFM0FLT4_COMPL |
DL_ECAP_INPUT_SDFM0FLT1_COMPZ |
61U |
Input signal from SDFM0FLT1_COMPZ |
DL_ECAP_INPUT_SDFM0FLT2_COMPZ |
62U |
Input signal from SDFM0FLT2_COMPZ |
DL_ECAP_INPUT_SDFM0FLT3_COMPZ |
63U |
Input signal from SDFM0FLT3_COMPZ |
DL_ECAP_INPUT_SDFM0FLT4_COMPZ |
64U |
Input signal from SDFM0FLT4_COMPZ |
DL_ECAP_INPUT_SDFM0FLT1_COMPH |
65U |
Input signal from SDFM0FLT1_COMPH |
DL_ECAP_INPUT_SDFM0FLT2_COMPH |
66U |
Input signal from SDFM0FLT2_COMPH |
DL_ECAP_INPUT_SDFM0FLT3_COMPH |
67U |
Input signal from SDFM0FLT3_COMPH |
DL_ECAP_INPUT_SDFM0FLT4_COMPH |
68U |
Input signal from SDFM0FLT4_COMPH |
DL_ECAP_INPUT_SDFM0FLT1_COMPH_OR_COMPL |
69U |
Input signal from SDFM0FLT1_COMPH_OR_COMPL |
DL_ECAP_INPUT_SDFM0FLT2_COMPH_OR_COMPL |
70U |
Input signal from SDFM0FLT2_COMPH_OR_COMPL |
DL_ECAP_INPUT_SDFM0FLT3_COMPH_OR_COMPL |
71U |
Input signal from SDFM0FLT3_COMPH_OR_COMPL |
DL_ECAP_INPUT_SDFM0FLT4_COMPH_OR_COMPL |
72U |
Input signal from SDFM0FLT4_COMPH_OR_COMPL |
DL_ECAP_INPUT_ECAT_SYNC0 |
73U |
Input signal from ECAT_SYNC0 |
DL_ECAP_INPUT_ECAT_SYNC1 |
74U |
Input signal from ECAT_SYNC1 |
DL_ECAP_INPUT_GPIO8 |
75U |
Input signal from GPIO8 |
DL_ECAP_INPUT_GPIO9 |
76U |
Input signal from GPIO9 |
DL_ECAP_INPUT_GPIO22 |
77U |
Input signal from GPIO22 |
DL_ECAP_INPUT_GPIO23 |
78U |
Input signal from GPIO23 |
ECAP input capture signal sources.
enum DL_ECAP_SYNC_IN_PULSE_SRC
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_SYNC_IN_PULSE_SRC_DISABLE |
0U |
Sync-in source is DISABLE |
DL_ECAP_SYNC_IN_PULSE_SRC_ECAP0_SYNCOUT |
3U |
Sync-in source is ECAP0_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_ECAP1_SYNCOUT |
4U |
Sync-in source is ECAP1_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_MCPWM0_SYNCOUT |
5U |
Sync-in source is MCPWM0_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_MCPWM1_SYNCOUT |
6U |
Sync-in source is MCPWM1_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_MCPWM2_SYNCOUT |
7U |
Sync-in source is MCPWM2_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_ECAP2_SYNCOUT |
10U |
Sync-in source is ECAP2_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_EPWM0_SYNCOUT |
11U |
Sync-in source is EPWM0_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_EPWM1_SYNCOUT |
12U |
Sync-in source is EPWM1_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_EPWM2_SYNCOUT |
13U |
Sync-in source is EPWM2_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_EPWM3_SYNCOUT |
14U |
Sync-in source is EPWM3_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_EPWM4_SYNCOUT |
15U |
Sync-in source is EPWM4_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_EPWM5_SYNCOUT |
16U |
Sync-in source is EPWM5_SYNCOUT |
DL_ECAP_SYNC_IN_PULSE_SRC_ECAT_SYNC0 |
17U |
Sync-in source is ECAT_SYNC0 |
DL_ECAP_SYNC_IN_PULSE_SRC_ECAT_SYNC1 |
18U |
Sync-in source is ECAT_SYNC1 |
DL_ECAP_SYNC_IN_PULSE_SRC_FSIRXA_TRIG1 |
19U |
Sync-in source is FSIRXA_TRIG1 |
DL_ECAP_SYNC_IN_PULSE_SRC_INPUTXBAR5 |
20U |
Sync-in source is INPUTXBAR5 |
DL_ECAP_SYNC_IN_PULSE_SRC_INPUTXBAR6 |
21U |
Sync-in source is INPUTXBAR6 |
ECAP sync-in pulse sources.
enum DL_ECAP_OPERATING_MODE
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_OPERATING_MODE_CAPTURE |
0x0U |
Capture mode |
DL_ECAP_OPERATING_MODE_APWM |
0x1U |
APWM mode |
ECAP operating modes.
enum DL_ECAP_HRCAP_CALIBRATION_CLOCK
Enumerator |
Value |
Description |
|---|---|---|
DL_ECAP_HRCAP_CALIBRATION_CLOCK_SYSCLK |
0U |
Use SYSCLK for calibration period match |
DL_ECAP_HRCAP_CALIBRATION_CLOCK_HRCLK |
1U |
Use HRCLK for calibration period match |
HRCAP calibration clock source.
Functions Documentation
function DL_ECAP_setEventPrescaler
__STATIC_INLINE void DL_ECAP_setEventPrescaler(
ECAP_Regs * ecap,
uint16_t prescalerValue
)
Sets the input prescaler.
Parameters:
ecap Pointer to the register overlay for the peripheral
prescalerValue is the prescaler value for ECAP input
This API divides the ECAP input scaler. The input capture signal (pulse train) can be prescaled in multiples of 2 or can bypass the prescaler.
Valid range of prescalerValue 0 = Divide by 1 (i.e,. no prescale, by-pass the prescaler) 1 = Divide by 2 2 = Divide by 4 3 = Divide by 6 4 = Divide by 8 5 = Divide by 10 … 0x1E (30) = Divide by 60 0x1F (31) = Divide by 62 Must be less than DL_ECAP_MAX_PRESCALER_VALUE
function DL_ECAP_setEventPolarity
__STATIC_INLINE void DL_ECAP_setEventPolarity(
ECAP_Regs * ecap,
DL_ECAP_EVENT event,
DL_ECAP_EVENT_POLARITY polarity
)
Sets the Capture Event polarity.
Parameters:
ecap Pointer to the register overlay for the peripheral
event The event number to be used
polarity is polarity of the event
For each event the Capture event polarity value determines the edge on which the capture is activated.
function DL_ECAP_setCaptureMode
__STATIC_INLINE void DL_ECAP_setCaptureMode(
ECAP_Regs * ecap,
DL_ECAP_CAPTURE_MODE mode,
DL_ECAP_EVENT event
)
Sets the capture mode.
Parameters:
ecap Pointer to the register overlay for the peripheral
mode is the capture mode
event is the event number at which the counter stops or wraps
This API sets the eCAP module to a continuous or one-shot mode. The value of event determines the event number at which the counter stops (in one-shot mode) or the counter wraps (in continuous mode).
function DL_ECAP_reArm
__STATIC_INLINE void DL_ECAP_reArm(
ECAP_Regs * ecap
)
Re-arms the eCAP module.
Parameters:
ecap Pointer to the register overlay for the peripheral
function DL_ECAP_enableInterrupt
__STATIC_INLINE void DL_ECAP_enableInterrupt(
ECAP_Regs * ecap,
uint16_t intFlags
)
Enables interrupt source.
Parameters:
ecap Pointer to the register overlay for the peripheral
intFlags Bit mask of the interrupt sources to be enabled [DL_ECAP_ISR_SOURCE]
This API sets and enables eCAP interrupt source. The following are valid interrupt sources.
DL_ECAP_ISR_SOURCE_CEVT1 - Event 1 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT2 - Event 2 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT3 - Event 3 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT4 - Event 4 generates interrupt
DL_ECAP_ISR_SOURCE_CTROVF - Counter overflow generates interrupt
DL_ECAP_ISR_SOURCE_CTR_PRD - Counter equal period generates interrupt
DL_ECAP_ISR_SOURCE_CTR_CMP - Counter equal compare generates interrupt
function DL_ECAP_disableInterrupt
__STATIC_INLINE void DL_ECAP_disableInterrupt(
ECAP_Regs * ecap,
uint16_t intFlags
)
Disables interrupt source.
Parameters:
ecap Pointer to the register overlay for the peripheral
intFlags Bit mask of the interrupt sources to be disabled [DL_ECAP_ISR_SOURCE]
This API disables eCAP interrupt source. The following are valid interrupt sources.
DL_ECAP_ISR_SOURCE_CEVT1 - Event 1 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT2 - Event 2 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT3 - Event 3 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT4 - Event 4 generates interrupt
DL_ECAP_ISR_SOURCE_CTROVF - Counter overflow generates interrupt
DL_ECAP_ISR_SOURCE_CTR_PRD - Counter equal period generates interrupt
DL_ECAP_ISR_SOURCE_CTR_CMP - Counter equal compare generates interrupt
function DL_ECAP_getInterruptSource
__STATIC_INLINE uint16_t DL_ECAP_getInterruptSource(
ECAP_Regs * ecap
)
Returns the interrupt flag.
Parameters:
ecap Pointer to the register overlay for the peripheral
Return: Returns the eCAP interrupt that has occurred. The following are valid return values:
DL_ECAP_ISR_SOURCE_CEVT1 - Event 1 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT2 - Event 2 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT3 - Event 3 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT4 - Event 4 generates interrupt
DL_ECAP_ISR_SOURCE_CTROVF - Counter overflow generates interrupt
DL_ECAP_ISR_SOURCE_CTR_PRD - Counter equal period generates interrupt
DL_ECAP_ISR_SOURCE_CTR_CMP - Counter equal compare generates interrupt
Note: - User can check if a combination of various interrupts have occurred by ORing the above return values.
function DL_ECAP_getGlobalInterruptStatus
__STATIC_INLINE bool DL_ECAP_getGlobalInterruptStatus(
ECAP_Regs * ecap
)
Returns the global interrupt flag status.
Parameters:
ecap Pointer to the register overlay for the peripheral
Return:
true if there is a global eCAP interrupt occured
false if there is no global eCAP interrupt occured
function DL_ECAP_clearInterrupt
__STATIC_INLINE void DL_ECAP_clearInterrupt(
ECAP_Regs * ecap,
uint16_t intFlags
)
Clears interrupt flags.
Parameters:
ecap Pointer to the register overlay for the peripheral
intFlags Bit mask of the interrupt sources to be cleared [DL_ECAP_ISR_SOURCE]
This API clears eCAP interrupt flags. The following are valid interrupt sources.
DL_ECAP_ISR_SOURCE_CEVT1 - Event 1 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT2 - Event 2 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT3 - Event 3 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT4 - Event 4 generates interrupt
DL_ECAP_ISR_SOURCE_CTROVF - Counter overflow generates interrupt
DL_ECAP_ISR_SOURCE_CTR_PRD - Counter equal period generates interrupt
DL_ECAP_ISR_SOURCE_CTR_CMP - Counter equal compare generates interrupt
function DL_ECAP_clearGlobalInterrupt
__STATIC_INLINE void DL_ECAP_clearGlobalInterrupt(
ECAP_Regs * ecap
)
Clears global interrupt flag.
Parameters:
ecap Pointer to the register overlay for the peripheral
This API clears the global interrupt bit, allowing further interrupts to be generated if any of the event flags are set.
function DL_ECAP_forceInterrupt
__STATIC_INLINE void DL_ECAP_forceInterrupt(
ECAP_Regs * ecap,
uint16_t intFlags
)
Forces interrupt flags.
Parameters:
ecap Pointer to the register overlay for the peripheral
intFlags Bit mask of the interrupt sources to be forced [DL_ECAP_ISR_SOURCE]
This API forces eCAP interrupt flags. The following are valid interrupt sources.
DL_ECAP_ISR_SOURCE_CEVT1 - Event 1 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT2 - Event 2 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT3 - Event 3 generates interrupt
DL_ECAP_ISR_SOURCE_CEVT4 - Event 4 generates interrupt
DL_ECAP_ISR_SOURCE_CTROVF - Counter overflow generates interrupt
DL_ECAP_ISR_SOURCE_CTR_PRD - Counter equal period generates interrupt
DL_ECAP_ISR_SOURCE_CTR_CMP - Counter equal compare generates interrupt
function DL_ECAP_enableCaptureMode
__STATIC_INLINE void DL_ECAP_enableCaptureMode(
ECAP_Regs * ecap
)
Enables capture mode.
Parameters:
ecap Pointer to the register overlay for the peripheral
This API sets the eCAP module to operate in Capture mode.
function DL_ECAP_enableAPWMMode
__STATIC_INLINE void DL_ECAP_enableAPWMMode(
ECAP_Regs * ecap
)
Enables APWM mode.
Parameters:
ecap Pointer to the register overlay for the peripheral
This API sets the eCAP module to operate in APWM mode.
function DL_ECAP_enableCounterResetOnEvent
__STATIC_INLINE void DL_ECAP_enableCounterResetOnEvent(
ECAP_Regs * ecap,
DL_ECAP_EVENT event
)
Enables counter reset on an event.
Parameters:
ecap Pointer to the register overlay for the peripheral
event The event number on which the counter should reset
This API enables the base timer (TSCTR) to be reset when the specified capture event occurs.
function DL_ECAP_disableCounterResetOnEvent
__STATIC_INLINE void DL_ECAP_disableCounterResetOnEvent(
ECAP_Regs * ecap,
DL_ECAP_EVENT event
)
Disables counter reset on an event.
Parameters:
ecap Pointer to the register overlay for the peripheral
event The event number for which counter reset should be disabled
This API disables the base timer (TSCTR) reset on the specified capture event.
function DL_ECAP_enableTimeStampCapture
__STATIC_INLINE void DL_ECAP_enableTimeStampCapture(
ECAP_Regs * ecap
)
Enables time stamp count capture.
Parameters:
ecap Pointer to the register overlay for the peripheral
function DL_ECAP_disableTimeStampCapture
__STATIC_INLINE void DL_ECAP_disableTimeStampCapture(
ECAP_Regs * ecap
)
Disables time stamp count capture.
Parameters:
ecap Pointer to the register overlay for the peripheral
function DL_ECAP_setPhaseShiftCount
__STATIC_INLINE void DL_ECAP_setPhaseShiftCount(
ECAP_Regs * ecap,
uint32_t shiftCount
)
Sets the counter phase shift value.
Parameters:
ecap Pointer to the register overlay for the peripheral
shiftCount The phase shift value to be loaded
This function configures the counter phase shift value to be loaded into the main timestamp counter when a sync-in event occurs.
function DL_ECAP_setSyncInPulseSource
__STATIC_INLINE void DL_ECAP_setSyncInPulseSource(
ECAP_Regs * ecap,
DL_ECAP_SYNC_IN_PULSE_SRC source
)
Sets the source for sync-in pulse.
Parameters:
ecap Pointer to the register overlay for the peripheral
source The source for the sync-in pulse
This API configures the source for the sync-in pulse to the eCAP module.
function DL_ECAP_enableLoadCounter
__STATIC_INLINE void DL_ECAP_enableLoadCounter(
ECAP_Regs * ecap
)
Enables counter loading with phase shift value.
Parameters:
ecap Pointer to the register overlay for the peripheral
This API enables loading of the counter with the value present in the phase shift counter as defined by the DL_ECAP_setPhaseShiftCount() API.
function DL_ECAP_disableLoadCounter
__STATIC_INLINE void DL_ECAP_disableLoadCounter(
ECAP_Regs * ecap
)
Disables counter loading with phase shift value.
Parameters:
ecap Pointer to the register overlay for the peripheral
This function disables loading of the counter with the phase shift value as defined by the DL_ECAP_setPhaseShiftCount() API.
function DL_ECAP_loadCounter
__STATIC_INLINE void DL_ECAP_loadCounter(
ECAP_Regs * ecap
)
Loads timestamp counter.
Parameters:
ecap Pointer to the register overlay for the peripheral
This API forces the value in the phase shift counter register to be loaded into the timestamp counter register. Make sure to enable loading of timestamp counter by calling DL_ECAP_enableLoadCounter() API before calling this API.
function DL_ECAP_setSyncOutMode
__STATIC_INLINE void DL_ECAP_setSyncOutMode(
ECAP_Regs * ecap,
DL_ECAP_SYNC_OUT_MODE mode
)
Configures Sync out signal mode.
Parameters:
ecap Pointer to the register overlay for the peripheral
mode isthe sync-out mode to set
This function sets the sync-out mode for the eCAP module. Valid values for mode are:
DL_ECAP_SYNC_OUT_SYNCI - Trigger sync out on sync-in event and software force.
DL_ECAP_SYNC_OUT_COUNTER_PRD - Trigger sync out when counter equals period.
DL_ECAP_SYNC_OUT_DISABLED - Disable sync out.
function DL_ECAP_stopCounter
__STATIC_INLINE void DL_ECAP_stopCounter(
ECAP_Regs * ecap
)
Stops the timestamp counter.
Parameters:
ecap Pointer to the register overlay for the peripheral
This API stops the ECAP timestamp counter (TSCTR) from running.
function DL_ECAP_startCounter
__STATIC_INLINE void DL_ECAP_startCounter(
ECAP_Regs * ecap
)
Starts the timestamp counter.
Parameters:
ecap Pointer to the register overlay for the peripheral
This API starts the ECAP timestamp counter (TSCTR) running.
function DL_ECAP_setAPWMPolarity
__STATIC_INLINE void DL_ECAP_setAPWMPolarity(
ECAP_Regs * ecap,
DL_ECAP_APWM_POLARITY polarity
)
Sets eCAP APWM polarity.
Parameters:
ecap Pointer to the register overlay for the peripheral
polarity is the polarity to set (active high or active low)
This API sets the polarity of the eCAP in APWM mode.
function DL_ECAP_setAPWMPeriod
__STATIC_INLINE void DL_ECAP_setAPWMPeriod(
ECAP_Regs * ecap,
uint32_t periodCount
)
Sets eCAP APWM period.
Parameters:
ecap Pointer to the register overlay for the peripheral
periodCount is the period count to set for APWM
This function sets the period count of the APWM waveform. periodCount takes the actual count which is written to the register. The user is responsible for converting the desired frequency or time into the period count.
function DL_ECAP_setAPWMCompare
__STATIC_INLINE void DL_ECAP_setAPWMCompare(
ECAP_Regs * ecap,
uint32_t compareCount
)
Sets eCAP APWM on or off time count.
Parameters:
ecap Pointer to the register overlay for the peripheral
compareCount is the compare count for APWM
This function sets the on or off time count of the APWM waveform depending on the polarity of the output. If the output , as set by DL_ECAP_setAPWMPolarity(), is active high then compareCount determines the on time. If the output is active low then compareCount determines the off time. compareCount takes the actual count which is written to the register. The user is responsible for converting the desired frequency or time into the appropriate count value.
function DL_ECAP_setAPWMShadowPeriod
__STATIC_INLINE void DL_ECAP_setAPWMShadowPeriod(
ECAP_Regs * ecap,
uint32_t periodCount
)
Sets eCAP APWM shadow period.
Parameters:
ecap Pointer to the register overlay for the peripheral
periodCount is the shadow period count to set for APWM
This API sets the shadow period count of the APWM waveform. periodCount takes the actual count which is written to the register. The user is responsible for converting the desired frequency or time into the period count.
function DL_ECAP_setAPWMShadowCompare
__STATIC_INLINE void DL_ECAP_setAPWMShadowCompare(
ECAP_Regs * ecap,
uint32_t compareCount
)
Sets eCAP APWM shadow on or off time count.
Parameters:
ecap Pointer to the register overlay for the peripheral
compareCount is the shadow on or off time count for APWM
This function sets the shadow on or off time count of the APWM waveform depending on the polarity of the output. If the output, as set by DL_ECAP_setAPWMPolarity(), is active high then compareCount determines the on time. If the output is active low then compareCount determines the off time. compareCount takes the actual count which is written to the register. The user is responsible for converting the desired frequency or time into the appropriate count value.
function DL_ECAP_getTimeStampCounter
__STATIC_INLINE uint32_t DL_ECAP_getTimeStampCounter(
ECAP_Regs * ecap
)
Returns the time-stamp counter value.
Parameters:
ecap Pointer to the register overlay for the peripheral
Return: The current timestamp counter value
function DL_ECAP_getEventTimeStamp
__STATIC_INLINE uint32_t DL_ECAP_getEventTimeStamp(
ECAP_Regs * ecap,
DL_ECAP_EVENT event
)
Returns event time stamp.
Parameters:
ecap Pointer to the register overlay for the peripheral
event is the event number
Return: Event time stamp value
This function returns the current time stamp count of the given event.
function DL_ECAP_selectECAPInput
__STATIC_INLINE void DL_ECAP_selectECAPInput(
ECAP_Regs * ecap,
DL_ECAP_INPUT input
)
Select eCAP input.
Parameters:
ecap Pointer to the register overlay for the peripheral
input is the eCAP input signal source to select
This function selects the eCAP input signal.
function DL_ECAP_resetCounters
__STATIC_INLINE void DL_ECAP_resetCounters(
ECAP_Regs * ecap
)
Resets eCAP counters and flags.
Parameters:
ecap Pointer to the register overlay for the peripheral
This function resets the main counter (TSCTR), event filter, modulo counter, and interrupt flags.
function DL_ECAP_setDMASource
__STATIC_INLINE void DL_ECAP_setDMASource(
ECAP_Regs * ecap,
DL_ECAP_EVENT event
)
Sets the eCAP DMA source event.
Parameters:
ecap Pointer to the register overlay for the peripheral
event is the event number to be used as DMA source
This function sets the eCAP event source for the DMA trigger.
function DL_ECAP_getModuloCounterStatus
__STATIC_INLINE DL_ECAP_EVENT DL_ECAP_getModuloCounterStatus(
ECAP_Regs * ecap
)
Returns the modulo counter status.
Parameters:
ecap Pointer to the register overlay for the peripheral
Return: DL_ECAP_EVENT value indicating which CAPn register will be loaded on the next event
This API returns the modulo counter status, indicating which register gets loaded on the next capture event.
function DL_ECAP_setEmulationMode
__STATIC_INLINE void DL_ECAP_setEmulationMode(
ECAP_Regs * ecap,
DL_ECAP_EMULATION_MODE mode
)
Configures the emulation mode.
Parameters:
ecap Pointer to the register overlay for the peripheral
mode is the emulation mode to set
This function configures the eCAP counter (TSCTR) to the desired emulation mode when emulation suspension occurs. Valid values for modes are:
DL_ECAP_EMULATION_STOP - Counter stops immediately on emulation suspension
DL_ECAP_EMULATION_RUN_TO_ZERO - Counter runs until 0 on emulation suspension
DL_ECAP_EMULATION_FREE_RUN - Counter is unaffected by emulation suspension
function DL_ECAP_initParamsSetDefault
void DL_ECAP_initParamsSetDefault(
DL_ECAP_Config * config
)
Initializes the ECAP configuration parameters.
Parameters:
config Pointer to the ECAP configuration structure.
This function initializes all the parameters of the ECAP configuration structure to their default values.
function DL_ECAP_init
void DL_ECAP_init(
ECAP_Regs * ecap,
DL_ECAP_Config * config
)
Initializes the ECAP module.
Parameters:
ecap Pointer to the ECAP register overlay
config Pointer to the ECAP configuration structure
This function configures the ECAP module according to the provided configuration.
function DL_ECAP_HRCAP_enableHighResolution
__STATIC_INLINE void DL_ECAP_HRCAP_enableHighResolution(
ECAP_HRCAP_Regs * hrcap
)
Enables HRCAP high resolution module.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
function DL_ECAP_HRCAP_disableHighResolution
__STATIC_INLINE void DL_ECAP_HRCAP_disableHighResolution(
ECAP_HRCAP_Regs * hrcap
)
Disables HRCAP high resolution module.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
function DL_ECAP_HRCAP_enableHighResolutionClock
__STATIC_INLINE void DL_ECAP_HRCAP_enableHighResolutionClock(
ECAP_HRCAP_Regs * hrcap
)
Enables HRCAP high resolution clock.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
function DL_ECAP_HRCAP_disableHighResolutionClock
__STATIC_INLINE void DL_ECAP_HRCAP_disableHighResolutionClock(
ECAP_HRCAP_Regs * hrcap
)
Disables HRCAP high resolution clock.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
function DL_ECAP_HRCAP_startCalibration
__STATIC_INLINE void DL_ECAP_HRCAP_startCalibration(
ECAP_HRCAP_Regs * hrcap
)
Starts HRCAP calibration.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
function DL_ECAP_HRCAP_setCalibrationMode
__STATIC_INLINE void DL_ECAP_HRCAP_setCalibrationMode(
ECAP_HRCAP_Regs * hrcap
)
Sets continuous calibration mode.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
function DL_ECAP_HRCAP_isCalibrationBusy
__STATIC_INLINE bool DL_ECAP_HRCAP_isCalibrationBusy(
ECAP_HRCAP_Regs * hrcap
)
Returns calibration busy status.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
Return: true if calibration is in progress, false if calibration is complete
function DL_ECAP_HRCAP_enableCalibrationInterrupt
__STATIC_INLINE void DL_ECAP_HRCAP_enableCalibrationInterrupt(
ECAP_HRCAP_Regs * hrcap,
uint32_t intFlags
)
Enables HRCAP calibration interrupt sources.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
intFlags Bit mask of interrupt sources to enable [DL_ECAP_HRCAP_ISR_SOURCE]
function DL_ECAP_HRCAP_disableCalibrationInterrupt
__STATIC_INLINE void DL_ECAP_HRCAP_disableCalibrationInterrupt(
ECAP_HRCAP_Regs * hrcap,
uint32_t intFlags
)
Disables HRCAP calibration interrupt sources.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
intFlags Bit mask of interrupt sources to disable [DL_ECAP_HRCAP_ISR_SOURCE]
function DL_ECAP_HRCAP_getCalibrationFlags
__STATIC_INLINE uint32_t DL_ECAP_HRCAP_getCalibrationFlags(
ECAP_HRCAP_Regs * hrcap
)
Returns the HRCAP calibration interrupt flags.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
Return: Bit mask of active interrupt flags [DL_ECAP_HRCAP_ISR_SOURCE]
function DL_ECAP_HRCAP_clearCalibrationFlags
__STATIC_INLINE void DL_ECAP_HRCAP_clearCalibrationFlags(
ECAP_HRCAP_Regs * hrcap,
uint32_t flags
)
Clears HRCAP calibration interrupt flags.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
flags Bit mask of flags to clear [DL_ECAP_HRCAP_ISR_SOURCE]
function DL_ECAP_HRCAP_forceCalibrationFlags
__STATIC_INLINE void DL_ECAP_HRCAP_forceCalibrationFlags(
ECAP_HRCAP_Regs * hrcap,
uint32_t flags
)
Forces HRCAP calibration interrupt flags.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
flags Bit mask of flags to force [DL_ECAP_HRCAP_ISR_SOURCE]
function DL_ECAP_HRCAP_setCalibrationPeriod
__STATIC_INLINE void DL_ECAP_HRCAP_setCalibrationPeriod(
ECAP_HRCAP_Regs * hrcap,
uint32_t sysclkHz
)
Sets the calibration period count.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
sysclkHz SYSCLK frequency in Hz
Sets the calibration period to achieve 1.6 ms given the SYSCLK frequency.
function DL_ECAP_HRCAP_configCalibrationPeriod
__STATIC_INLINE void DL_ECAP_HRCAP_configCalibrationPeriod(
ECAP_HRCAP_Regs * hrcap,
uint32_t sysclkHz,
float periodInMs
)
Sets the calibration period count for a user-configurable period.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
sysclkHz SYSCLK frequency in Hz
periodInMs Calibration period, in milliseconds
Sets the calibration period count value to the provided period in milliseconds given the SYSCLK frequency.
function DL_ECAP_HRCAP_getCalibrationClockPeriod
__STATIC_INLINE uint32_t DL_ECAP_HRCAP_getCalibrationClockPeriod(
ECAP_HRCAP_Regs * hrcap,
DL_ECAP_HRCAP_CALIBRATION_CLOCK clockSource
)
Returns the calibration clock period capture value.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
clockSource Calibration clock source select
Return: Captured clock period count
function DL_ECAP_HRCAP_getScaleFactor
__STATIC_INLINE float DL_ECAP_HRCAP_getScaleFactor(
ECAP_HRCAP_Regs * hrcap
)
Calculates the HRCAP scale factor.
Parameters:
hrcap Pointer to the register overlay for the ECAP HRCAP peripheral
Return: Scale factor (SYSCLKCAP / HRCLKCAP)
Reads SYSCLK and HRCLK capture values and returns their ratio.
function DL_ECAP_HRCAP_convertEventTimeStampNanoseconds
__STATIC_INLINE float DL_ECAP_HRCAP_convertEventTimeStampNanoseconds(
uint32_t timeStamp,
float scaleFactor
)
Converts a raw ECAP timestamp to nanoseconds.
Parameters:
timeStamp Raw timestamp count from DL_ECAP_getEventTimeStamp()
scaleFactor Scale factor from DL_ECAP_HRCAP_getScaleFactor()
Return: Timestamp value in nanoseconds
Macros Documentation
define DL_ECAP_MAX_PRESCALER_VALUE
#define DL_ECAP_MAX_PRESCALER_VALUE 32U
eCAP minimum and maximum values
define DL_ECAP_ISR_SOURCE_CEVT1
#define DL_ECAP_ISR_SOURCE_CEVT1 0x2U
Capture Event 1 ISR source.
define DL_ECAP_ISR_SOURCE_CEVT2
#define DL_ECAP_ISR_SOURCE_CEVT2 0x4U
Capture Event 2 ISR source.
define DL_ECAP_ISR_SOURCE_CEVT3
#define DL_ECAP_ISR_SOURCE_CEVT3 0x8U
Capture Event 3 ISR source.
define DL_ECAP_ISR_SOURCE_CEVT4
#define DL_ECAP_ISR_SOURCE_CEVT4 0x10U
Capture Event 4 ISR source.
define DL_ECAP_ISR_SOURCE_CTROVF
#define DL_ECAP_ISR_SOURCE_CTROVF 0x20U
Counter Overflow ISR source.
define DL_ECAP_ISR_SOURCE_CTR_PRD
#define DL_ECAP_ISR_SOURCE_CTR_PRD 0x40U
Counter Equal Period ISR source.
define DL_ECAP_ISR_SOURCE_CTR_CMP
#define DL_ECAP_ISR_SOURCE_CTR_CMP 0x80U
Counter Equal Compare ISR source.
define DL_ECAP_HRCAP_ISR_SOURCE_GLOBAL_CALIBRATION
#define DL_ECAP_HRCAP_ISR_SOURCE_GLOBAL_CALIBRATION 0x1U
Global calibration interrupt flag.
define DL_ECAP_HRCAP_ISR_SOURCE_CALIBDONE
#define DL_ECAP_HRCAP_ISR_SOURCE_CALIBDONE 0x2U
Calibration done interrupt flag.
define DL_ECAP_HRCAP_ISR_SOURCE_CALPRDCHKSTS
#define DL_ECAP_HRCAP_ISR_SOURCE_CALPRDCHKSTS 0x4U
Calibration period overflow interrupt flag.
define DL_ECAP_HRCAP_CALIBRATION_PERIOD_US
#define DL_ECAP_HRCAP_CALIBRATION_PERIOD_US 1600U
HRCAP calibration period, in microseconds.
define DL_ECAP_US_PER_SEC
#define DL_ECAP_US_PER_SEC 1000000U
Number of microseconds per second.
define DL_ECAP_MS_PER_SEC
#define DL_ECAP_MS_PER_SEC 1000.0f
Number of milliseconds per second.
define DL_ECAP_HRCAP_SYSCLK_PERIOD_NS
#define DL_ECAP_HRCAP_SYSCLK_PERIOD_NS 4.0f
SYSCLK period, in nanoseconds, at the 250 MHz SYSCLK frequency.
define DL_ECAP_HRCAP_MEP_STEPS_PER_SYSCLK
#define DL_ECAP_HRCAP_MEP_STEPS_PER_SYSCLK 128.0f
Number of MEP (Micro Edge Positioner) steps per SYSCLK period.
define DL_ECAP_INPUT_COUNT
#define DL_ECAP_INPUT_COUNT (78U)
Number of valid DL_ECAP_INPUT enum values.