15#ifndef __PAN_TIMER_H__ 
   16#define __PAN_TIMER_H__ 
  105    timer->EXTCTL = (timer->EXTCTL & ~(TIMER_EXTCTL_CAPSEL_Msk |
 
  106                                       TIMER_EXTCTL_CAPFUNCS_Msk |
 
  107                                       TIMER_EXTCTL_CAPEDGE_Msk)) |
 
  108                    capMode | capEdge | TIMER_EXTCTL_CAPEN_Msk;
 
  118    timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk;
 
  132    timer->EXTCTL = (timer->EXTCTL & ~TIMER_EXTCTL_CNTPHASE_Msk) | evtCntEdge;
 
  133    timer->CTL |= TIMER_CTL_EXTCNTEN_Msk;
 
  143    timer->CTL &= ~TIMER_CTL_EXTCNTEN_Msk;
 
  154    timer->CMP = u32Value;
 
  166    timer->CTL = (timer->CTL & ~TIMER_CTL_PSC_Msk) | u32Value;
 
  181    timer->CTL = (timer->CTL & ~TIMER_CTL_OPMODE_Msk) | cntMode;
 
  193    return timer->CTL & TIMER_CTL_ACTSTS_Msk ? true : 
false;
 
  213    timer->CTL |= TIMER_CTL_CNTEN_Msk;
 
  223    timer->CTL &= ~TIMER_CTL_CNTEN_Msk;
 
  233    timer->CTL |= TIMER_CTL_RSTCNT_Msk;
 
  244    timer->CTL |= TIMER_CTL_WKEN_Msk;
 
  254    timer->CTL &= ~TIMER_CTL_WKEN_Msk;
 
  265    timer->EXTCTL |= TIMER_EXTCTL_CAPDBEN_Msk;
 
  275    timer->EXTCTL &= ~TIMER_EXTCTL_CAPDBEN_Msk;
 
  286    timer->EXTCTL |= TIMER_EXTCTL_CNTDBEN_Msk;
 
  296    timer->EXTCTL &= ~TIMER_EXTCTL_CNTDBEN_Msk;
 
  306    timer->CTL |= TIMER_CTL_INTEN_Msk;
 
  316    timer->CTL &= ~TIMER_CTL_INTEN_Msk;
 
  326    timer->EXTCTL |= TIMER_EXTCTL_CAPIEN_Msk;
 
  336    timer->EXTCTL &= ~TIMER_EXTCTL_CAPIEN_Msk;
 
  348    return(timer->INTSTS & TIMER_INTSTS_TIF_Msk ? 1 : 0);
 
  358    timer->INTSTS = TIMER_INTSTS_TIF_Msk;
 
  370    return(timer->INTSTS & TIMER_INTSTS_TF_Msk ? 1 : 0);
 
  380    timer->INTSTS = TIMER_INTSTS_TF_Msk;
 
  392    return timer->EINTSTS & TIMER_EINTSTS_CAPIF_Msk;
 
  402    timer->EINTSTS = TIMER_EINTSTS_CAPIF_Msk;
 
  414    return ((timer->EINTSTS & TIMER_EINTSTS_CAPF_Msk)? 1:0);
 
  424    timer->EINTSTS = TIMER_EINTSTS_CAPF_Msk;
 
  436    return (timer->INTSTS & TIMER_INTSTS_TWKF_Msk ? 1 : 0);
 
  446    timer->INTSTS = TIMER_INTSTS_TWKF_Msk;
 
  459    timer->CTL = (timer->CTL & ~TIMER_CTL_CAPSRC_Msk) | capSrc;
 
  490    timer->CTL &= ~(TIMER_CTL_OPMODE_Msk);
 
  491    timer->CTL |= u32CntMode;
 
_TIMER_CapEdgeDef
Definition: pan_timer.h:57
 
enum _TIMER_CapEdgeDef TIMER_CapEdgeDef
 
@ TIMER_CAPTURE_BOTH_EDGE
Definition: pan_timer.h:60
 
@ TIMER_CAPTURE_RISING_THEN_FALLING_EDGE
Definition: pan_timer.h:62
 
@ TIMER_CAPTURE_FALLING_THEN_RISING_EDGE
Definition: pan_timer.h:61
 
@ TIMER_CAPTURE_FALLING_EDGE
Definition: pan_timer.h:58
 
@ TIMER_CAPTURE_RISING_EDGE
Definition: pan_timer.h:59
 
_TIMER_CapSrcDef
Definition: pan_timer.h:81
 
enum _TIMER_CapSrcDef TIMER_CapSrcDef
 
@ TIMER_CAPTURE_SOURCE_EXT_PIN
Definition: pan_timer.h:82
 
@ TIMER_CAPTURE_SOURCE_32K_OUTPUT
Definition: pan_timer.h:83
 
enum _TIMER_EvtCntEdgeDef TIMER_EvtCntEdgeDef
 
_TIMER_EvtCntEdgeDef
Definition: pan_timer.h:70
 
@ TIMER_COUNTER_RISING_EDGE
Definition: pan_timer.h:72
 
@ TIMER_COUNTER_FALLING_EDGE
Definition: pan_timer.h:71
 
enum _TIMER_CapModeDef TIMER_CapModeDef
 
_TIMER_CapModeDef
Definition: pan_timer.h:46
 
@ TIMER_CAPTURE_COUNTER_RESET_MODE
Definition: pan_timer.h:49
 
@ TIMER_CAPTURE_FREE_COUNTING_MODE
Definition: pan_timer.h:47
 
@ TIMER_CAPTURE_TRIGGER_COUNTING_MODE
Definition: pan_timer.h:48
 
enum _TIMER_CntModeDef TIMER_CntModeDef
 
_TIMER_CntModeDef
Definition: pan_timer.h:34
 
@ TIMER_TOGGLE_MODE
Definition: pan_timer.h:37
 
@ TIMER_CONTINUOUS_MODE
Definition: pan_timer.h:38
 
@ TIMER_ONESHOT_MODE
Definition: pan_timer.h:35
 
@ TIMER_PERIODIC_MODE
Definition: pan_timer.h:36
 
__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer)
This function gets the Timer capture data.
Definition: pan_timer.h:467
 
void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec)
This API is used to create a delay loop for u32usec micro seconds.
 
__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer)
This function reports the current timer counter value.
Definition: pan_timer.h:477
 
__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer)
This function clears the Timer time-out interrupt flag.
Definition: pan_timer.h:356
 
__STATIC_INLINE void TIMER_Start(TIMER_T *timer)
This function is used to start Timer counting.
Definition: pan_timer.h:211
 
__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer)
This function is used to disable the capture pin detection de-bounce function.
Definition: pan_timer.h:273
 
__STATIC_INLINE void TIMER_EnableCapture(TIMER_T *timer, TIMER_CapModeDef capMode, TIMER_CapEdgeDef capEdge)
This API is used to enable timer capture function with specified mode and capture edge.
Definition: pan_timer.h:102
 
__STATIC_INLINE void TIMER_DisableEventCounter(TIMER_T *timer)
This API is used to disable the Timer event counter function.
Definition: pan_timer.h:141
 
__STATIC_INLINE void TIMER_SetTmrCounterMode(TIMER_T *timer, uint32_t u32CntMode)
This function set the timer counter mode.
Definition: pan_timer.h:488
 
__STATIC_INLINE void TIMER_SetCountingMode(TIMER_T *timer, TIMER_CntModeDef cntMode)
This function is used to Set Timer counting mode.
Definition: pan_timer.h:179
 
__STATIC_INLINE void TIMER_Stop(TIMER_T *timer)
This function is used to stop Timer counting.
Definition: pan_timer.h:221
 
__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer)
This function is used to enable the counter pin detection de-bounce function.
Definition: pan_timer.h:284
 
__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer)
This function indicates Timer capture interrupt occurred or not.
Definition: pan_timer.h:390
 
__STATIC_INLINE void TIMER_SetCaptureSource(TIMER_T *timer, TIMER_CapSrcDef capSrc)
This function set the Timer capture source.
Definition: pan_timer.h:457
 
__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer)
This function clears the Timer capture interrupt flag.
Definition: pan_timer.h:400
 
__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer)
This function indicates Timer has waked up system or not.
Definition: pan_timer.h:434
 
__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer)
This function is used to disable the Timer time-out interrupt function.
Definition: pan_timer.h:314
 
__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer)
This function is used to enable the Timer time-out interrupt function.
Definition: pan_timer.h:304
 
__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer)
This function is used to disable the Timer wake-up function.
Definition: pan_timer.h:252
 
__STATIC_INLINE void TIMER_SetPrescaleValue(TIMER_T *timer, uint32_t u32Value)
This function is used to set new Timer prescale value.
Definition: pan_timer.h:164
 
void TIMER_Close(TIMER_T *timer)
This API stops Timer counting and disable the Timer interrupt function.
 
__STATIC_INLINE void TIMER_DisableCapture(TIMER_T *timer)
This API is used to disable the Timer capture function.
Definition: pan_timer.h:116
 
__STATIC_INLINE bool TIMER_IsActive(TIMER_T *timer)
This function is used to check if specify Timer is inactive or active.
Definition: pan_timer.h:191
 
__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer)
This function is used to disable the counter pin detection de-bounce function.
Definition: pan_timer.h:294
 
__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer)
This function is used to enable the capture pin detection de-bounce function.
Definition: pan_timer.h:263
 
__STATIC_INLINE uint32_t TIMER_GetTFFlag(TIMER_T *timer)
This function indicates Timer time-out event occurred or not.
Definition: pan_timer.h:368
 
__STATIC_INLINE void TIMER_SetCmpValue(TIMER_T *timer, uint32_t u32Value)
This function is used to set new Timer compared value.
Definition: pan_timer.h:152
 
__STATIC_INLINE void TIMER_ClearCaptureFlag(TIMER_T *timer)
This function clears the Timer capture event flag.
Definition: pan_timer.h:422
 
__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer)
This function is used to disable the Timer capture trigger interrupt function.
Definition: pan_timer.h:334
 
uint32_t TIMER_Open(TIMER_T *timer, TIMER_CntModeDef cntMode, 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_Reset(TIMER_T *timer)
This function is used to reset Timer counting, prescale counter and CNTEN.
Definition: pan_timer.h:231
 
__STATIC_INLINE uint32_t TIMER_GetCaptureFlag(TIMER_T *timer)
This function indicates Timer capture event occurred or not.
Definition: pan_timer.h:412
 
__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer)
This function is used to enable the Timer capture trigger interrupt function.
Definition: pan_timer.h:324
 
__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer)
This function is used to enable the Timer wake-up function.
Definition: pan_timer.h:242
 
__STATIC_INLINE void TIMER_ClearTFFlag(TIMER_T *timer)
This function clears the Timer time-out evnet flag.
Definition: pan_timer.h:378
 
__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer)
This function indicates Timer time-out interrupt occurred or not.
Definition: pan_timer.h:346
 
__STATIC_INLINE void TIMER_EnableEventCounter(TIMER_T *timer, TIMER_EvtCntEdgeDef evtCntEdge)
This function is used to enable the Timer event counter function with specify detection edge.
Definition: pan_timer.h:130
 
__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer)
This function clears the Timer wakeup interrupt flag.
Definition: pan_timer.h:444