Lines Matching refs:timer

41 uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq)  in TIMER_Open()  argument
43 uint32_t u32Clk = TIMER_GetModuleClock(timer); in TIMER_Open()
59 timer->CTL = u32Mode | u32Prescale; in TIMER_Open()
60 timer->CMP = u32Cmpr; in TIMER_Open()
74 void TIMER_Close(TIMER_T *timer) in TIMER_Close() argument
76 timer->CTL = 0UL; in TIMER_Close()
77 timer->EXTCTL = 0UL; in TIMER_Close()
92 void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec) in TIMER_Delay() argument
94 uint32_t u32Clk = TIMER_GetModuleClock(timer); in TIMER_Delay()
99 timer->CTL = 0UL; in TIMER_Delay()
100 timer->EXTCTL = 0UL; in TIMER_Delay()
139 timer->CMP = u32Cmpr; in TIMER_Delay()
140 timer->CTL = TIMER_CTL_CNTEN_Msk | TIMER_ONESHOT_MODE | u32Prescale; in TIMER_Delay()
149 while(timer->CTL & TIMER_CTL_ACTSTS_Msk) in TIMER_Delay()
174 void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge) in TIMER_EnableCapture() argument
176 timer->EXTCTL = (timer->EXTCTL & ~(TIMER_EXTCTL_CAPFUNCS_Msk | TIMER_EXTCTL_CAPEDGE_Msk)) | in TIMER_EnableCapture()
189 void TIMER_DisableCapture(TIMER_T *timer) in TIMER_DisableCapture() argument
191 timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; in TIMER_DisableCapture()
208 void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge) in TIMER_EnableEventCounter() argument
210 timer->EXTCTL = (timer->EXTCTL & ~TIMER_EXTCTL_CNTPHASE_Msk) | u32Edge; in TIMER_EnableEventCounter()
211 timer->CTL |= TIMER_CTL_EXTCNTEN_Msk; in TIMER_EnableEventCounter()
223 void TIMER_DisableEventCounter(TIMER_T *timer) in TIMER_DisableEventCounter() argument
225 timer->CTL &= ~TIMER_CTL_EXTCNTEN_Msk; in TIMER_DisableEventCounter()
238 uint32_t TIMER_GetModuleClock(TIMER_T *timer) in TIMER_GetModuleClock() argument
243 if(timer == TIMER0) in TIMER_GetModuleClock()
247 else if(timer == TIMER1) in TIMER_GetModuleClock()
251 else if(timer == TIMER2) in TIMER_GetModuleClock()
262 if((timer == TIMER0) || (timer == TIMER1)) in TIMER_GetModuleClock()
294 void TIMER_EnableFreqCounter(TIMER_T *timer, in TIMER_EnableFreqCounter() argument
301 t = (timer == TIMER0) ? TIMER1 : TIMER3; in TIMER_EnableFreqCounter()
305 timer->CTL = TIMER_CTL_INTRGEN_Msk | TIMER_CTL_CNTEN_Msk; in TIMER_EnableFreqCounter()
314 void TIMER_DisableFreqCounter(TIMER_T *timer) in TIMER_DisableFreqCounter() argument
316 timer->CTL &= ~TIMER_CTL_INTRGEN_Msk; in TIMER_DisableFreqCounter()
328 void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src) in TIMER_SetTriggerSource() argument
330 timer->TRGCTL = (timer->TRGCTL & ~TIMER_TRGCTL_TRGSSEL_Msk) | u32Src; in TIMER_SetTriggerSource()
343 void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask) in TIMER_SetTriggerTarget() argument
345timer->TRGCTL = (timer->TRGCTL & ~(TIMER_TRGCTL_TRGEPWM_Msk | TIMER_TRGCTL_TRGDAC_Msk | TIMER_TRGC… in TIMER_SetTriggerTarget()