This file contains the function prototypes for the device abstraction layer for ECAP. It also contains some related macro definitions and some files to be included.
Go to the source code of this file.
Macros | |
ECAP Operating Mode | |
#define | ECAP_CAPTURE_MODE (0U) |
Capture Mode. More... | |
#define | ECAP_APWM_MODE (1U) |
Auxiliary PWM Mode. More... | |
ECAP time stamp capture on event | |
#define | ECAP_CAPTURE_EVENT_1 ((uint32_t)0x08U) |
Time stamp capture on event 1. More... | |
#define | ECAP_CAPTURE_EVENT_2 ((uint32_t)0x0cU) |
Time stamp capture on event 2. More... | |
#define | ECAP_CAPTURE_EVENT_3 ((uint32_t)0x10U) |
Time stamp capture on event 3. More... | |
#define | ECAP_CAPTURE_EVENT_4 ((uint32_t)0x14U) |
Time stamp capture on event 4. More... | |
ECAP stop capture on event | |
#define | ECAP_CAPTURE_EVENT1_STOP ((uint32_t)0x00U) |
Stop capture after event 1. More... | |
#define | ECAP_CAPTURE_EVENT2_STOP ((uint32_t)0x01U) |
Stop capture after event 2. More... | |
#define | ECAP_CAPTURE_EVENT3_STOP ((uint32_t)0x02U) |
Stop capture after event 3. More... | |
#define | ECAP_CAPTURE_EVENT4_STOP ((uint32_t)0x03U) |
Stop capture after event 4. More... | |
ECAP APWM Output Polarity | |
#define | ECAP_APWM_ACTIVE_HIGH (0U) |
Output Polarity HIGH. More... | |
#define | ECAP_APWM_ACTIVE_LOW (1U) |
Output Polarity LOW. More... | |
ECAP Counter Mode | |
#define | ECAP_COUNTER_STOP (0U) |
Counter Mode Stop. More... | |
#define | ECAP_COUNTER_FREE_RUNNING (1U) |
Counter Mode Free Running. More... | |
ECAP Counter SyncIn Mode | |
#define | ECAP_SYNC_IN_DISABLE ((uint32_t)0U) |
Disable SyncIn option. More... | |
#define | ECAP_ENABLE_COUNTER ((uint32_t)1U) |
Enable Counter to be loaded from the ECAP_CNTPHS register upon SYNCI signal. More... | |
ECAP Counter SyncOut Mode | |
#define | ECAP_SYNC_IN ((uint32_t)0x0U) |
Select SyncIn event to be the SyncOut signal. More... | |
#define | ECAP_PRD_EQ ((uint32_t)0x1U) |
Select PRD event to be the SyncOut signal. More... | |
#define | ECAP_SYNC_OUT_DISABLE ((uint32_t)0x2U) |
Disable SyncOut Signal. More... | |
ECAP Interrupt Sources | |
#define | ECAP_CEVT1_INT (ECAP_ECEINT_CEVT1) |
Capture Event 1 Interrupt Enable. More... | |
#define | ECAP_CEVT2_INT (ECAP_ECEINT_CEVT2) |
Capture Event 2 Interrupt Enable. More... | |
#define | ECAP_CEVT3_INT (ECAP_ECEINT_CEVT3) |
Capture Event 3 Interrupt Enable. More... | |
#define | ECAP_CEVT4_INT (ECAP_ECEINT_CEVT4) |
Capture Event 4 Interrupt Enable. More... | |
#define | ECAP_CNTOVF_INT (ECAP_ECEINT_CTROVF) |
Counter Overflow Interrupt Enable. More... | |
#define | ECAP_PRDEQ_INT (ECAP_ECEINT_CTR_PRD) |
Period Equal Interrupt Enable. More... | |
#define | ECAP_CMPEQ_INT (ECAP_ECEINT_CTR_CMP) |
Compare Equal Interrupt Enable. More... | |
ECAP Global Interrupt Source | |
#define | ECAP_GLOBAL_INT (ECAP_ECFLG_INT) |
Global Interrupt Source Clear Flag. More... | |
ECAP Capture Event Polarity | |
#define | ECAP_CAPTURE_EVENT_RISING (0U) |
Capture Event Rising Edge. More... | |
#define | ECAP_CAPTURE_EVENT_FALLING (1U) |
Capture Event Falling Edge. More... | |
ECAP Counter Reset On Capture Event | |
#define | ECAP_CAPTURE_EVENT_RESET_COUNTER_NO_RESET (0U) |
No counter reset upon Capture Event. More... | |
#define | ECAP_CAPTURE_EVENT_RESET_COUNTER_RESET (1U) |
Counter reset upon Capture Event. More... | |
Functions | |
void | ECAP_captureLoadingEnable (uint32_t baseAddr) |
This function enables capture loading. More... | |
void | ECAP_captureLoadingDisable (uint32_t baseAddr) |
This function disables capture loading. More... | |
void | ECAP_prescaleConfig (uint32_t baseAddr, uint32_t prescale) |
This function configures prescale value. More... | |
void | ECAP_operatingModeSelect (uint32_t baseAddr, uint32_t modeSelect) |
This function configures ecapture module to operate in capture mode or in APWM mode. More... | |
uint32_t | ECAP_timeStampRead (uint32_t baseAddr, uint32_t capEvtFlag) |
This function returns time-stamp for a given capture event. More... | |
void | ECAP_counterConfig (uint32_t baseAddr, uint32_t countVal) |
This function configures the counter register which is used as Capture Time base. More... | |
void | ECAP_captureEvtPolarityConfig (uint32_t baseAddr, uint32_t capEvt1pol, uint32_t capEvt2pol, uint32_t capEvt3pol, uint32_t capEvt4pol) |
This function configures Capture Event polarity. More... | |
void | ECAP_captureEvtCntrRstConfig (uint32_t baseAddr, uint32_t counterRst1, uint32_t counterRst2, uint32_t counterRst3, uint32_t counterRst4) |
This function enables reset of the counters upon Capture Events. More... | |
void | ECAP_continuousModeConfig (uint32_t baseAddr) |
This function configures ECAP to Continuous mode. More... | |
void | ECAP_oneShotModeConfig (uint32_t baseAddr, uint32_t stopVal) |
This function configures ECAP to One-shot mode and also stop value for this mode. More... | |
void | ECAP_oneShotReArm (uint32_t baseAddr) |
This function configures ECAP to One-Short Re-arming. More... | |
void | ECAP_APWM_polarityConfig (uint32_t baseAddr, uint32_t flag) |
This function configures output polarity for APWM output. More... | |
void | ECAP_counterControl (uint32_t baseAddr, uint32_t flag) |
This function configures counter to stop or free running based on its input argument flag. More... | |
void | ECAP_syncInOutSelect (uint32_t baseAddr, uint32_t syncIn, uint32_t syncOut) |
This function configures Sync-In and Sync-Out. More... | |
void | ECAP_APWM_captureConfig (uint32_t baseAddr, uint32_t compareVal, uint32_t periodVal) |
When ECAP module is configured in APWM mode capture 1 and capture 2 registers are used as period and compare register.This function configures compare and period values to this register. More... | |
void | ECAP_APWM_shadowCaptureConfig (uint32_t baseAddr, uint32_t compareVal, uint32_t periodVal) |
This function configures the Shadow register. More... | |
void | ECAP_counterPhaseValConfig (uint32_t baseAddr, uint32_t cntPhaseVal) |
This function configures the counter phase value. More... | |
void | ECAP_globalIntrClear (uint32_t baseAddr) |
This function clears global interrupt and enables the generation of interrupts if any of the event interrupt are enabled and corresponding event interrupt flag is set. More... | |
void | ECAP_intrEnable (uint32_t baseAddr, uint32_t flag) |
This function enables the specified interrupts. More... | |
void | ECAP_intrDisable (uint32_t baseAddr, uint32_t flag) |
This function disables the specified interrupts. More... | |
uint32_t | ECAP_getIntrStatus (uint32_t baseAddr, uint32_t flag) |
This function returns the status specified interrupts. More... | |
void | ECAP_intrStatusClear (uint32_t baseAddr, uint32_t flag) |
This function clears of the status specified interrupts. More... | |
uint32_t | ECAP_peripheralIdGet (uint32_t baseAddr) |
This function returns the peripheral ID. More... | |