PAN1080 Peripheral API
|
Panchip series timer driver header file. More...
Go to the source code of this file.
Typedefs | |
typedef enum _TIMER_CntModeDef | TIMER_CntModeDef |
typedef enum _TIMER_CapModeDef | TIMER_CapModeDef |
typedef enum _TIMER_CapEdgeDef | TIMER_CapEdgeDef |
typedef enum _TIMER_EvtCntEdgeDef | TIMER_EvtCntEdgeDef |
typedef enum _TIMER_CapSrcDef | TIMER_CapSrcDef |
Enumerations | |
enum | _TIMER_CntModeDef { TIMER_ONESHOT_MODE = (0UL << TIMER_CTL_OPMODE_Pos) , TIMER_PERIODIC_MODE = (1UL << TIMER_CTL_OPMODE_Pos) , TIMER_TOGGLE_MODE = (2UL << TIMER_CTL_OPMODE_Pos) , TIMER_CONTINUOUS_MODE = (3UL << TIMER_CTL_OPMODE_Pos) } |
enum | _TIMER_CapModeDef { TIMER_CAPTURE_FREE_COUNTING_MODE = (0UL) , TIMER_CAPTURE_TRIGGER_COUNTING_MODE = (TIMER_EXTCTL_CAPSEL_Msk) , TIMER_CAPTURE_COUNTER_RESET_MODE = (TIMER_EXTCTL_CAPFUNCS_Msk) } |
enum | _TIMER_CapEdgeDef { TIMER_CAPTURE_FALLING_EDGE = (0UL << TIMER_EXTCTL_CAPEDGE_Pos) , TIMER_CAPTURE_RISING_EDGE = (1UL << TIMER_EXTCTL_CAPEDGE_Pos) , TIMER_CAPTURE_BOTH_EDGE = (2UL << TIMER_EXTCTL_CAPEDGE_Pos) , TIMER_CAPTURE_FALLING_THEN_RISING_EDGE = (2UL << TIMER_EXTCTL_CAPEDGE_Pos) , TIMER_CAPTURE_RISING_THEN_FALLING_EDGE = (3UL << TIMER_EXTCTL_CAPEDGE_Pos) } |
enum | _TIMER_EvtCntEdgeDef { TIMER_COUNTER_FALLING_EDGE = (0UL) , TIMER_COUNTER_RISING_EDGE = (TIMER_EXTCTL_CNTPHASE_Msk) } |
enum | _TIMER_CapSrcDef { TIMER_CAPTURE_SOURCE_EXT_PIN = (0UL) , TIMER_CAPTURE_SOURCE_32K_OUTPUT = (TIMER_CTL_CAPSRC_Msk) } |
Functions | |
__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. More... | |
__STATIC_INLINE void | TIMER_DisableCapture (TIMER_T *timer) |
This API is used to disable the Timer capture function. More... | |
__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. More... | |
__STATIC_INLINE void | TIMER_DisableEventCounter (TIMER_T *timer) |
This API is used to disable the Timer event counter function. More... | |
__STATIC_INLINE void | TIMER_SetCmpValue (TIMER_T *timer, uint32_t u32Value) |
This function is used to set new Timer compared value. More... | |
__STATIC_INLINE void | TIMER_SetPrescaleValue (TIMER_T *timer, uint32_t u32Value) |
This function is used to set new Timer prescale value. More... | |
__STATIC_INLINE void | TIMER_SetCountingMode (TIMER_T *timer, TIMER_CntModeDef cntMode) |
This function is used to Set Timer counting mode. More... | |
__STATIC_INLINE bool | TIMER_IsActive (TIMER_T *timer) |
This function is used to check if specify Timer is inactive or active. More... | |
__STATIC_INLINE void | TIMER_Start (TIMER_T *timer) |
This function is used to start Timer counting. More... | |
__STATIC_INLINE void | TIMER_Stop (TIMER_T *timer) |
This function is used to stop Timer counting. More... | |
__STATIC_INLINE void | TIMER_Reset (TIMER_T *timer) |
This function is used to reset Timer counting, prescale counter and CNTEN. More... | |
__STATIC_INLINE void | TIMER_EnableWakeup (TIMER_T *timer) |
This function is used to enable the Timer wake-up function. More... | |
__STATIC_INLINE void | TIMER_DisableWakeup (TIMER_T *timer) |
This function is used to disable the Timer wake-up function. More... | |
__STATIC_INLINE void | TIMER_EnableCaptureDebounce (TIMER_T *timer) |
This function is used to enable the capture pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_DisableCaptureDebounce (TIMER_T *timer) |
This function is used to disable the capture pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_EnableEventCounterDebounce (TIMER_T *timer) |
This function is used to enable the counter pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_DisableEventCounterDebounce (TIMER_T *timer) |
This function is used to disable the counter pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_EnableInt (TIMER_T *timer) |
This function is used to enable the Timer time-out interrupt function. More... | |
__STATIC_INLINE void | TIMER_DisableInt (TIMER_T *timer) |
This function is used to disable the Timer time-out interrupt function. More... | |
__STATIC_INLINE void | TIMER_EnableCaptureInt (TIMER_T *timer) |
This function is used to enable the Timer capture trigger interrupt function. More... | |
__STATIC_INLINE void | TIMER_DisableCaptureInt (TIMER_T *timer) |
This function is used to disable the Timer capture trigger interrupt function. More... | |
__STATIC_INLINE uint32_t | TIMER_GetIntFlag (TIMER_T *timer) |
This function indicates Timer time-out interrupt occurred or not. More... | |
__STATIC_INLINE void | TIMER_ClearIntFlag (TIMER_T *timer) |
This function clears the Timer time-out interrupt flag. More... | |
__STATIC_INLINE uint32_t | TIMER_GetTFFlag (TIMER_T *timer) |
This function indicates Timer time-out event occurred or not. More... | |
__STATIC_INLINE void | TIMER_ClearTFFlag (TIMER_T *timer) |
This function clears the Timer time-out evnet flag. More... | |
__STATIC_INLINE uint32_t | TIMER_GetCaptureIntFlag (TIMER_T *timer) |
This function indicates Timer capture interrupt occurred or not. More... | |
__STATIC_INLINE void | TIMER_ClearCaptureIntFlag (TIMER_T *timer) |
This function clears the Timer capture interrupt flag. More... | |
__STATIC_INLINE uint32_t | TIMER_GetCaptureFlag (TIMER_T *timer) |
This function indicates Timer capture event occurred or not. More... | |
__STATIC_INLINE void | TIMER_ClearCaptureFlag (TIMER_T *timer) |
This function clears the Timer capture event flag. More... | |
__STATIC_INLINE uint32_t | TIMER_GetWakeupFlag (TIMER_T *timer) |
This function indicates Timer has waked up system or not. More... | |
__STATIC_INLINE void | TIMER_ClearWakeupFlag (TIMER_T *timer) |
This function clears the Timer wakeup interrupt flag. More... | |
__STATIC_INLINE void | TIMER_SetCaptureSource (TIMER_T *timer, TIMER_CapSrcDef capSrc) |
This function set the Timer capture source. More... | |
__STATIC_INLINE uint32_t | TIMER_GetCaptureData (TIMER_T *timer) |
This function gets the Timer capture data. More... | |
__STATIC_INLINE uint32_t | TIMER_GetCounter (TIMER_T *timer) |
This function reports the current timer counter value. More... | |
__STATIC_INLINE void | TIMER_SetTmrCounterMode (TIMER_T *timer, uint32_t u32CntMode) |
This function set the timer counter mode. More... | |
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 in target frequency, a closest frequency will be chose and returned. More... | |
void | TIMER_Close (TIMER_T *timer) |
This API stops Timer counting and disable the Timer interrupt function. More... | |
void | TIMER_Delay (TIMER_T *timer, uint32_t u32Usec) |
This API is used to create a delay loop for u32usec micro seconds. More... | |
Panchip series timer driver header file.