33 #define TIMER_ONESHOT_MODE (0UL) 34 #define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_MODE_SEL_Pos) 35 #define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_MODE_SEL_Pos) 36 #define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_MODE_SEL_Pos) 38 #define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL) 39 #define TIMER_CAPTURE_TRIGGER_COUNTING_MODE (TIMER_CTL_TCAP_CNT_MODE_Msk) 40 #define TIMER_CAPTURE_COUNTER_RESET_MODE (TIMER_CTL_TCAP_MODE_Msk) 42 #define TIMER_CAPTURE_FALLING_EDGE (0UL) 43 #define TIMER_CAPTURE_RISING_EDGE (1UL << TIMER_CTL_TCAP_EDGE_Pos) 44 #define TIMER_CAPTURE_FALLING_THEN_RISING_EDGE (2UL << TIMER_CTL_TCAP_EDGE_Pos) 45 #define TIMER_CAPTURE_RISING_THEN_FALLING_EDGE (3UL << TIMER_CTL_TCAP_EDGE_Pos) 47 #define TIMER_COUNTER_RISING_EDGE (TIMER_CTL_EVENT_EDGE_Msk) 48 #define TIMER_COUNTER_FALLING_EDGE (0UL) 50 #define TIMER_TIMEOUT_TRIGGER (0UL) 51 #define TIMER_CAPTURE_TRIGGER (TIMER_CTL_CAP_TRG_EN_Msk) 67 #define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMPR = (u32Value)) 77 #define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->PRECNT = (u32Value)) 86 #define TIMER_IS_ACTIVE(timer) ((timer)->CTL & TIMER_CTL_TMR_ACT_Msk ? 1 : 0) 295 return (timer->
DR & 0xFFFFFF);
308 uint32_t u32DropCount,
310 uint32_t u32EnableInt);
#define TIMER_ISR_TMR_IS_Msk
#define TIMER_CTL_TCAP_DEB_EN_Msk
__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer)
This function is used to disable the Timer time-out interrupt function.
__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer)
This function is used to disable the capture pin detection de-bounce function.
__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer)
This function clears the Timer time-out interrupt flag.
__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer)
This function is used to enable the Timer wake-up function.
#define TIMER_ISR_TCAP_IS_Msk
__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer)
This function is used to disable the counter pin detection de-bounce function.
__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer)
This function indicates Timer has waked up system or not.
__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer)
This function is used to disable the Timer wake-up function.
#define TIMER_ISR_TMR_WAKE_STS_Msk
__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer)
This function clears the Timer capture interrupt flag.
__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer)
This function indicates Timer capture interrupt occurred or not.
__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer)
This function is used to enable the capture pin detection de-bounce function.
uint32_t TIMER_GetModuleClock(TIMER_T *timer)
This API is used to get the clock frequency of Timer.
#define TIMER_CTL_EVNT_DEB_EN_Msk
__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer)
This function is used to enable the Timer time-out interrupt function.
__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer)
This function gets the Timer capture data.
void TIMER_DisableCapture(TIMER_T *timer)
This API is used to disable the Timer capture function.
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.
void TIMER_Close(TIMER_T *timer)
This API stops Timer counting and disable the Timer interrupt function.
__STATIC_INLINE void TIMER_Stop(TIMER_T *timer)
This function is used to stop Timer counting.
void TIMER_ResetCounter(TIMER_T *timer)
This function is used to reset the Timer counter value.
void TIMER_DisableEventCounter(TIMER_T *timer)
This API is used to disable the Timer event counter function.
#define TIMER_CTL_WAKE_EN_Msk
void TIMER_DisableFreqCounter(TIMER_T *timer)
This function is used to disable the Timer frequency counter function.
__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer)
This function reports the current timer counter value.
__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer)
This function clears the Timer wakeup interrupt flag.
void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec)
This API is used to create a delay loop for u32usec micro seconds.
void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src)
This function is used to select the interrupt source used to trigger other modules.
void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask)
This function is used to set modules trigger by timer interrupt.
#define TIMER_CTL_TMR_EN_Msk
__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer)
This function is used to enable the counter pin detection de-bounce function.
#define TIMER_IER_TMR_IE_Msk
__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer)
This function is used to enable the Timer capture trigger interrupt function.
void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge)
This API is used to enable timer capture function with specified mode and capture edge.
void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge)
This function is used to enable the Timer counter function with specify detection edge.
__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer)
This function is used to disable the Timer capture trigger interrupt function.
__STATIC_INLINE void TIMER_Start(TIMER_T *timer)
This function is used to start Timer counting.
#define TIMER_IER_TCAP_IE_Msk
uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq)
This API is used to configure timer to operate in specified mode and frequency. If timer cannot work ...
__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer)
This function indicates Timer time-out interrupt occurred or not.