33#define TIMER_ONESHOT_MODE (0UL)
34#define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_OPMODE_Pos)
35#define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_OPMODE_Pos)
36#define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_OPMODE_Pos)
37#define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL)
38#define TIMER_CAPTURE_COUNTER_RESET_MODE (TIMER_EXTCTL_CAPFUNCS_Msk)
39#define TIMER_CAPTURE_FALLING_EDGE (0UL)
40#define TIMER_CAPTURE_RISING_EDGE (1UL << TIMER_EXTCTL_CAPEDGE_Pos)
41#define TIMER_CAPTURE_FALLING_AND_RISING_EDGE (2UL << TIMER_EXTCTL_CAPEDGE_Pos)
42#define TIMER_COUNTER_RISING_EDGE (TIMER_EXTCTL_CNTPHASE_Msk)
43#define TIMER_COUNTER_FALLING_EDGE (0UL)
44#define TIMER_TOGGLE_OUT1 (TIMER_CTL_TOGDIS2_Msk)
45#define TIMER_TOGGLE_OUT2 (TIMER_CTL_TOGDIS1_Msk)
47#define TIMER_TIMEOUT_ERR (-1L)
63#define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMP = (u32Value))
73#define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_PSC_Msk) | (u32Value))
82#define TIMER_IS_ACTIVE(timer) ((timer)->CTL & TIMER_CTL_ACTSTS_Msk ? 1 : 0)
93#define TIMER_SELECT_TOUT_PIN(timer, u32ToutSel) ((timer)->CTL = ((timer)->CTL & ~(TIMER_CTL_TOGDIS2_Msk | TIMER_CTL_TOGDIS1_Msk)) | (u32ToutSel))
113 timer->
CTL &= ~TIMER_CTL_CNTEN_Msk;
134 timer->
CTL &= ~TIMER_CTL_WKEN_Msk;
155 timer->
EXTCTL &= ~TIMER_EXTCTL_CAPDBEN_Msk;
176 timer->
EXTCTL &= ~TIMER_EXTCTL_ECNTDBEN_Msk;
196 timer->
CTL &= ~TIMER_CTL_INTEN_Msk;
216 timer->
EXTCTL &= ~TIMER_EXTCTL_CAPIEN_Msk;
#define TIMER_INTSTS_TWKF_Msk
#define TIMER_CTL_WKEN_Msk
#define TIMER_EXTCTL_CAPIEN_Msk
#define TIMER_CTL_INTEN_Msk
#define TIMER_EINTSTS_CAPIF_Msk
#define TIMER_INTSTS_TIF_Msk
#define TIMER_CTL_CNTEN_Msk
#define TIMER_EXTCTL_ECNTDBEN_Msk
#define TIMER_EXTCTL_CAPDBEN_Msk
__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer)
This function gets the Timer capture data.
__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer)
This function reports the current timer counter value.
__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer)
This function clears the Timer time-out interrupt flag.
__STATIC_INLINE void TIMER_Start(TIMER_T *timer)
This function is used to start Timer counting.
__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer)
This function is used to disable the capture pin detection de-bounce function.
void TIMER_DisableCapture(TIMER_T *timer)
This API is used to disable the Timer capture function.
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 void TIMER_Stop(TIMER_T *timer)
This function is used to stop Timer counting.
__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer)
This function is used to enable the counter pin detection de-bounce function.
__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer)
This function indicates Timer capture interrupt occurred or not.
__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer)
This function clears the Timer capture interrupt flag.
__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer)
This function indicates Timer has waked up system or not.
void TIMER_DisableEventCounter(TIMER_T *timer)
This API is used to disable the Timer event counter function.
__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer)
This function is used to disable the Timer time-out interrupt function.
__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer)
This function is used to enable the Timer time-out interrupt function.
uint32_t TIMER_GetModuleClock(TIMER_T *timer)
This API is used to get the clock frequency of Timer.
__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer)
This function is used to disable the Timer wake-up function.
void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge)
This function is used to enable the Timer counter function with specify detection edge.
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_Close(TIMER_T *timer)
This API stops Timer counting and disable the Timer interrupt function.
__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer)
This function is used to disable the counter pin detection de-bounce function.
__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer)
This function is used to enable the capture pin detection de-bounce function.
int32_t TIMER_Delay(TIMER_T *timer, uint32_t u32Usec)
This API is used to create a delay loop for u32usec micro seconds.
__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer)
This function is used to disable the Timer capture trigger interrupt function.
__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer)
This function is used to enable the Timer capture trigger interrupt function.
__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer)
This function is used to enable the Timer wake-up function.
__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer)
This function indicates Timer time-out interrupt occurred or not.
__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer)
This function clears the Timer wakeup interrupt flag.