Lines Matching refs:timer
38 void TPWM_SetCounterClockSource(TIMER_T *timer, uint32_t u32CntClkSrc) in TPWM_SetCounterClockSource() argument
40 (timer)->PWMCLKSRC = ((timer)->PWMCLKSRC & ~TIMER_PWMCLKSRC_CLKSRC_Msk) | u32CntClkSrc; in TPWM_SetCounterClockSource()
55 uint32_t TPWM_ConfigOutputFreqAndDuty(TIMER_T *timer, uint32_t u32Frequency, uint32_t u32DutyCycle) in TPWM_ConfigOutputFreqAndDuty() argument
60 if((timer == TIMER0) || (timer == TIMER1)) in TPWM_ConfigOutputFreqAndDuty()
84 …timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (TPWM_UP_COUNT << TIMER_PWMCTL_CNTTY… in TPWM_ConfigOutputFreqAndDuty()
87 timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTMODE_Msk) | TPWM_AUTO_RELOAD_MODE; in TPWM_ConfigOutputFreqAndDuty()
90 TPWM_SET_PRESCALER(timer, (u32Prescaler - 1UL)); in TPWM_ConfigOutputFreqAndDuty()
92 TPWM_SET_PERIOD(timer, (u32Period - 1UL)); in TPWM_ConfigOutputFreqAndDuty()
102 TPWM_SET_CMPDAT(timer, u32CMP); in TPWM_ConfigOutputFreqAndDuty()
118 void TPWM_EnableDeadTime(TIMER_T *timer, uint32_t u32DTCount) in TPWM_EnableDeadTime() argument
120 timer->PWMDTCTL = TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; in TPWM_EnableDeadTime()
134 void TPWM_EnableDeadTimeWithPrescale(TIMER_T *timer, uint32_t u32DTCount) in TPWM_EnableDeadTimeWithPrescale() argument
136 timer->PWMDTCTL = TIMER_PWMDTCTL_DTCKSEL_Msk | TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; in TPWM_EnableDeadTimeWithPrescale()
149 void TPWM_DisableDeadTime(TIMER_T *timer) in TPWM_DisableDeadTime() argument
151 timer->PWMDTCTL = 0x0UL; in TPWM_DisableDeadTime()
163 void TPWM_EnableCounter(TIMER_T *timer) in TPWM_EnableCounter() argument
165 timer->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk; in TPWM_EnableCounter()
177 void TPWM_DisableCounter(TIMER_T *timer) in TPWM_DisableCounter() argument
179 timer->PWMCTL &= ~TIMER_PWMCTL_CNTEN_Msk; in TPWM_DisableCounter()
197 void TPWM_EnableTriggerADC(TIMER_T *timer, uint32_t u32Condition) in TPWM_EnableTriggerADC() argument
199 timer->PWMEADCTS = TIMER_PWMEADCTS_TRGEN_Msk | u32Condition; in TPWM_EnableTriggerADC()
211 void TPWM_DisableTriggerADC(TIMER_T *timer) in TPWM_DisableTriggerADC() argument
213 timer->PWMEADCTS = 0x0UL; in TPWM_DisableTriggerADC()
251 void TPWM_EnableFaultBrake(TIMER_T *timer, uint32_t u32CH0Level, uint32_t u32CH1Level, uint32_t u32… in TPWM_EnableFaultBrake() argument
253 timer->PWMFAILBRK |= ((u32BrakeSource >> 16) & 0xFUL); in TPWM_EnableFaultBrake()
254 …timer->PWMBRKCTL = (timer->PWMBRKCTL & ~(TIMER_PWMBRKCTL_BRKAEVEN_Msk | TIMER_PWMBRKCTL_BRKAODD_Ms… in TPWM_EnableFaultBrake()
271 void TPWM_EnableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) in TPWM_EnableFaultBrakeInt() argument
273 timer->PWMINTEN1 |= u32IntSource; in TPWM_EnableFaultBrakeInt()
289 void TPWM_DisableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) in TPWM_DisableFaultBrakeInt() argument
291 timer->PWMINTEN1 &= ~u32IntSource; in TPWM_DisableFaultBrakeInt()
308 uint32_t TPWM_GetFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) in TPWM_GetFaultBrakeIntFlag() argument
310 return ((timer->PWMINTSTS1 & (0x3UL << u32IntSource))? 1UL : 0UL); in TPWM_GetFaultBrakeIntFlag()
326 void TPWM_ClearFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) in TPWM_ClearFaultBrakeIntFlag() argument
328 timer->PWMINTSTS1 = (0x3UL << u32IntSource); in TPWM_ClearFaultBrakeIntFlag()
345 void TPWM_SetLoadMode(TIMER_T *timer, uint32_t u32LoadMode) in TPWM_SetLoadMode() argument
347 …timer->PWMCTL = (timer->PWMCTL & ~(TIMER_PWMCTL_IMMLDEN_Msk | TIMER_PWMCTL_CTRLD_Msk)) | u32LoadMo… in TPWM_SetLoadMode()
375 void TPWM_EnableBrakePinDebounce(TIMER_T *timer, uint32_t u32BrakePinSrc, uint32_t u32DebounceCnt, … in TPWM_EnableBrakePinDebounce() argument
377 …timer->PWMBNF = (timer->PWMBNF & ~(TIMER_PWMBNF_BKPINSRC_Msk | TIMER_PWMBNF_BRKFCNT_Msk | TIMER_PW… in TPWM_EnableBrakePinDebounce()
392 void TPWM_DisableBrakePinDebounce(TIMER_T *timer) in TPWM_DisableBrakePinDebounce() argument
394 timer->PWMBNF &= ~TIMER_PWMBNF_BRKNFEN_Msk; in TPWM_DisableBrakePinDebounce()
404 void TPWM_EnableBrakePinInverse(TIMER_T *timer) in TPWM_EnableBrakePinInverse() argument
406 timer->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk; in TPWM_EnableBrakePinInverse()
415 void TPWM_DisableBrakePinInverse(TIMER_T *timer) in TPWM_DisableBrakePinInverse() argument
417 timer->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk; in TPWM_DisableBrakePinInverse()
431 void TPWM_SetBrakePinSource(TIMER_T *timer, uint32_t u32BrakePinNum) in TPWM_SetBrakePinSource() argument
433 …timer->PWMBNF = (((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | (u32BrakePinNum << TIMER_PWMBNF_… in TPWM_SetBrakePinSource()