32 #define TIMER_ONESHOT_MODE (0UL << TIMER_CTL_OPMODE_Pos) 33 #define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_OPMODE_Pos) 34 #define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_OPMODE_Pos) 35 #define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_OPMODE_Pos) 36 #define TIMER_TOUT_PIN_FROM_TMX (0UL << TIMER_CTL_TGLPINSEL_Pos) 37 #define TIMER_TOUT_PIN_FROM_TMX_EXT (1UL << TIMER_CTL_TGLPINSEL_Pos) 39 #define TIMER_COUNTER_EVENT_FALLING (0UL << TIMER_EXTCTL_CNTPHASE_Pos) 40 #define TIMER_COUNTER_EVENT_RISING (1UL << TIMER_EXTCTL_CNTPHASE_Pos) 41 #define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL << TIMER_EXTCTL_CAPFUNCS_Pos) 42 #define TIMER_CAPTURE_COUNTER_RESET_MODE (1UL << TIMER_EXTCTL_CAPFUNCS_Pos) 44 #define TIMER_CAPTURE_EVENT_FALLING (0UL << TIMER_EXTCTL_CAPEDGE_Pos) 45 #define TIMER_CAPTURE_EVENT_RISING (1UL << TIMER_EXTCTL_CAPEDGE_Pos) 46 #define TIMER_CAPTURE_EVENT_FALLING_RISING (2UL << TIMER_EXTCTL_CAPEDGE_Pos) 47 #define TIMER_CAPTURE_EVENT_RISING_FALLING (3UL << TIMER_EXTCTL_CAPEDGE_Pos) 48 #define TIMER_CAPTURE_EVENT_GET_LOW_PERIOD (6UL << TIMER_EXTCTL_CAPEDGE_Pos) 49 #define TIMER_CAPTURE_EVENT_GET_HIGH_PERIOD (7UL << TIMER_EXTCTL_CAPEDGE_Pos) 51 #define TIMER_TRGSRC_TIMEOUT_EVENT (0UL << TIMER_TRGCTL_TRGSSEL_Pos) 52 #define TIMER_TRGSRC_CAPTURE_EVENT (1UL << TIMER_TRGCTL_TRGSSEL_Pos) 53 #define TIMER_TRG_TO_EPWM (TIMER_TRGCTL_TRGEPWM_Msk) 54 #define TIMER_TRG_TO_EADC (TIMER_TRGCTL_TRGEADC_Msk) 55 #define TIMER_TRG_TO_DAC (TIMER_TRGCTL_TRGDAC_Msk) 56 #define TIMER_TRG_TO_PDMA (TIMER_TRGCTL_TRGPDMA_Msk) 79 #define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMP = (u32Value)) 93 #define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_PSC_Msk) | (u32Value)) 106 #define TIMER_IS_ACTIVE(timer) (((timer)->CTL & TIMER_CTL_ACTSTS_Msk)? 1 : 0) 121 #define TIMER_SELECT_TOUT_PIN(timer, u32ToutSel) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_TGLPINSEL_Msk) | (u32ToutSel)) 136 #define TIMER_SET_OPMODE(timer, u32OpMode) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_OPMODE_Msk) | (u32OpMode)) 504 uint32_t u32DropCount,
506 uint32_t u32EnableInt);
__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer)
Disable Capture Pin De-bounce.
#define TIMER_EXTCTL_CAPIEN_Msk
__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer)
Start Timer Capture Function.
void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge)
Enable Timer Counter Function.
void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src)
This function is used to select the interrupt source used to trigger other modules.
__STATIC_INLINE void TIMER_Start(TIMER_T *timer)
Start Timer Counting.
void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask)
This function is used to set modules trigger by timer interrupt.
__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer)
Clear Timer Time-out Interrupt Flag.
__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer)
Get Timer Capture Interrupt Flag.
uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq)
Open Timer with Operate Mode and Frequency.
__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer)
Clear Timer Capture Interrupt Flag.
uint32_t TIMER_GetModuleClock(TIMER_T *timer)
Get Timer Clock Frequency.
void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec)
Create a specify Delay Time.
__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer)
Enable Timer Interrupt Wake-up Function.
__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer)
Stop Timer Capture Function.
__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer)
Disable Counter Pin De-bounce.
#define TIMER_CTL_WKEN_Msk
#define TIMER_EXTCTL_CNTDBEN_Msk
void TIMER_EnableFreqCounter(TIMER_T *timer, uint32_t u32DropCount, uint32_t u32Timeout, uint32_t u32EnableInt)
This function is used to enable the Timer frequency counter function.
__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer)
Enable Capture Pin De-bounce.
void TIMER_DisableFreqCounter(TIMER_T *timer)
This function is used to disable the Timer frequency counter function.
void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge)
Enable Timer Capture Function.
__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer)
Disable Capture Trigger Interrupt.
__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer)
Get Counter value.
#define TIMER_INTSTS_TIF_Msk
#define TIMER_EXTCTL_CAPDBEN_Msk
#define TIMER_CNT_RSTACT_Msk
__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer)
Disable Timer Time-out Interrupt.
__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer)
Get Capture value.
__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer)
Enable Counter Pin De-bounce.
void TIMER_DisableEventCounter(TIMER_T *timer)
Disable Timer Counter Function.
__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer)
Reset Counter.
__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer)
Enable Timer Time-out Interrupt.
#define TIMER_INTSTS_TWKF_Msk
#define TIMER_EINTSTS_CAPIF_Msk
#define TIMER_EXTCTL_CAPEN_Msk
void TIMER_DisableCapture(TIMER_T *timer)
Disable Timer Capture Function.
__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer)
Get Timer Wake-up Flag.
__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer)
Disable Timer Wake-up Function.
void TIMER_Close(TIMER_T *timer)
Stop Timer Counting.
__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer)
Get Timer Time-out Interrupt Flag.
#define TIMER_CTL_INTEN_Msk
__STATIC_INLINE void TIMER_Stop(TIMER_T *timer)
Stop Timer Counting.
#define TIMER_CTL_CNTEN_Msk
__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer)
Enable Capture Trigger Interrupt.
__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer)
Clear Timer Wake-up Flag.