Lines Matching refs:timer

39 void TPWM_SetCounterClockSource(TIMER_T *timer, uint32_t u32CntClkSrc)  in TPWM_SetCounterClockSource()  argument
41 (timer)->PWMCLKSRC = ((timer)->PWMCLKSRC & ~TIMER_PWMCLKSRC_CLKSRC_Msk) | u32CntClkSrc; in TPWM_SetCounterClockSource()
56 uint32_t TPWM_ConfigOutputFreqAndDuty(TIMER_T *timer, uint32_t u32Frequency, uint32_t u32DutyCycle) in TPWM_ConfigOutputFreqAndDuty() argument
61 if((timer == TIMER0) || (timer == TIMER1)) in TPWM_ConfigOutputFreqAndDuty()
85timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (TPWM_UP_COUNT << TIMER_PWMCTL_CNTTY… in TPWM_ConfigOutputFreqAndDuty()
88 timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTMODE_Msk) | TPWM_AUTO_RELOAD_MODE; in TPWM_ConfigOutputFreqAndDuty()
91 TPWM_SET_PRESCALER(timer, (u32Prescaler - 1UL)); in TPWM_ConfigOutputFreqAndDuty()
93 TPWM_SET_PERIOD(timer, (u32Period - 1UL)); in TPWM_ConfigOutputFreqAndDuty()
103 TPWM_SET_CMPDAT(timer, u32CMP); in TPWM_ConfigOutputFreqAndDuty()
119 void TPWM_EnableDeadTime(TIMER_T *timer, uint32_t u32DTCount) in TPWM_EnableDeadTime() argument
121 timer->PWMDTCTL = TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; in TPWM_EnableDeadTime()
135 void TPWM_EnableDeadTimeWithPrescale(TIMER_T *timer, uint32_t u32DTCount) in TPWM_EnableDeadTimeWithPrescale() argument
137 timer->PWMDTCTL = TIMER_PWMDTCTL_DTCKSEL_Msk | TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; in TPWM_EnableDeadTimeWithPrescale()
150 void TPWM_DisableDeadTime(TIMER_T *timer) in TPWM_DisableDeadTime() argument
152 timer->PWMDTCTL = 0x0UL; in TPWM_DisableDeadTime()
164 void TPWM_EnableCounter(TIMER_T *timer) in TPWM_EnableCounter() argument
166 timer->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk; in TPWM_EnableCounter()
178 void TPWM_DisableCounter(TIMER_T *timer) in TPWM_DisableCounter() argument
180 timer->PWMCTL &= ~TIMER_PWMCTL_CNTEN_Msk; in TPWM_DisableCounter()
198 void TPWM_EnableTriggerADC(TIMER_T *timer, uint32_t u32Condition) in TPWM_EnableTriggerADC() argument
200 timer->PWMTRGCTL = TIMER_PWMTRGCTL_TRGEADC_Msk | u32Condition; in TPWM_EnableTriggerADC()
212 void TPWM_DisableTriggerADC(TIMER_T *timer) in TPWM_DisableTriggerADC() argument
214 timer->PWMTRGCTL = 0x0UL; in TPWM_DisableTriggerADC()
252 void TPWM_EnableFaultBrake(TIMER_T *timer, uint32_t u32CH0Level, uint32_t u32CH1Level, uint32_t u32… in TPWM_EnableFaultBrake() argument
254 timer->PWMFAILBRK |= ((u32BrakeSource >> 16) & 0xFUL); in TPWM_EnableFaultBrake()
255timer->PWMBRKCTL = (timer->PWMBRKCTL & ~(TIMER_PWMBRKCTL_BRKAEVEN_Msk | TIMER_PWMBRKCTL_BRKAODD_Ms… in TPWM_EnableFaultBrake()
272 void TPWM_EnableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) in TPWM_EnableFaultBrakeInt() argument
274 timer->PWMINTEN1 |= u32IntSource; in TPWM_EnableFaultBrakeInt()
290 void TPWM_DisableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) in TPWM_DisableFaultBrakeInt() argument
292 timer->PWMINTEN1 &= ~u32IntSource; in TPWM_DisableFaultBrakeInt()
309 uint32_t TPWM_GetFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) in TPWM_GetFaultBrakeIntFlag() argument
311 return ((timer->PWMINTSTS1 & (0x3UL << u32IntSource))? 1UL : 0UL); in TPWM_GetFaultBrakeIntFlag()
327 void TPWM_ClearFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) in TPWM_ClearFaultBrakeIntFlag() argument
329 timer->PWMINTSTS1 = (0x3UL << u32IntSource); in TPWM_ClearFaultBrakeIntFlag()
346 void TPWM_SetLoadMode(TIMER_T *timer, uint32_t u32LoadMode) in TPWM_SetLoadMode() argument
348timer->PWMCTL = (timer->PWMCTL & ~(TIMER_PWMCTL_IMMLDEN_Msk | TIMER_PWMCTL_CTRLD_Msk)) | u32LoadMo… in TPWM_SetLoadMode()
376 void TPWM_EnableBrakePinDebounce(TIMER_T *timer, uint32_t u32BrakePinSrc, uint32_t u32DebounceCnt, … in TPWM_EnableBrakePinDebounce() argument
378timer->PWMBNF = (timer->PWMBNF & ~(TIMER_PWMBNF_BKPINSRC_Msk | TIMER_PWMBNF_BRKFCNT_Msk | TIMER_PW… in TPWM_EnableBrakePinDebounce()
393 void TPWM_DisableBrakePinDebounce(TIMER_T *timer) in TPWM_DisableBrakePinDebounce() argument
395 timer->PWMBNF &= ~TIMER_PWMBNF_BRKNFEN_Msk; in TPWM_DisableBrakePinDebounce()
405 void TPWM_EnableBrakePinInverse(TIMER_T *timer) in TPWM_EnableBrakePinInverse() argument
407 timer->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk; in TPWM_EnableBrakePinInverse()
416 void TPWM_DisableBrakePinInverse(TIMER_T *timer) in TPWM_DisableBrakePinInverse() argument
418 timer->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk; in TPWM_DisableBrakePinInverse()
432 void TPWM_SetBrakePinSource(TIMER_T *timer, uint32_t u32BrakePinNum) in TPWM_SetBrakePinSource() argument
434timer->PWMBNF = (((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | (u32BrakePinNum << TIMER_PWMBNF_… in TPWM_SetBrakePinSource()
449 void TPWM_EnableAcc(TIMER_T *timer, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc) in TPWM_EnableAcc() argument
451timer->PWMIFA = (((timer)->PWMIFA & ~(TIMER_PWMIFA_IFACNT_Msk | TIMER_PWMIFA_IFASEL_Msk | TIMER_PW… in TPWM_EnableAcc()
461 void TPWM_DisableAcc(TIMER_T *timer) in TPWM_DisableAcc() argument
463 timer->PWMIFA &= ~TIMER_PWMIFA_IFAEN_Msk; in TPWM_DisableAcc()
472 void TPWM_EnableAccInt(TIMER_T *timer) in TPWM_EnableAccInt() argument
474 timer->PWMAINTEN |= TIMER_PWMAINTEN_IFAIEN_Msk; in TPWM_EnableAccInt()
483 void TPWM_DisableAccInt(TIMER_T *timer) in TPWM_DisableAccInt() argument
485 timer->PWMAINTEN &= ~TIMER_PWMAINTEN_IFAIEN_Msk; in TPWM_DisableAccInt()
494 void TPWM_ClearAccInt(TIMER_T *timer) in TPWM_ClearAccInt() argument
496 timer->PWMAINTSTS = TIMER_PWMAINTSTS_IFAIF_Msk; in TPWM_ClearAccInt()
506 uint32_t TPWM_GetAccInt(TIMER_T *timer) in TPWM_GetAccInt() argument
508 return (((timer)->PWMAINTSTS & TIMER_PWMAINTSTS_IFAIF_Msk)? 1UL : 0UL); in TPWM_GetAccInt()
517 void TPWM_EnableAccPDMA(TIMER_T *timer) in TPWM_EnableAccPDMA() argument
519 timer->PWMAPDMACTL |= TIMER_PWMAPDMACTL_APDMAEN_Msk; in TPWM_EnableAccPDMA()
528 void TPWM_DisableAccPDMA(TIMER_T *timer) in TPWM_DisableAccPDMA() argument
530 timer->PWMAPDMACTL &= ~TIMER_PWMAPDMACTL_APDMAEN_Msk; in TPWM_DisableAccPDMA()
539 void TPWM_EnableAccStopMode(TIMER_T *timer) in TPWM_EnableAccStopMode() argument
541 timer->PWMIFA |= TIMER_PWMIFA_STPMOD_Msk; in TPWM_EnableAccStopMode()
550 void TPWM_DisableAccStopMode(TIMER_T *timer) in TPWM_DisableAccStopMode() argument
552 timer->PWMIFA &= ~TIMER_PWMIFA_STPMOD_Msk; in TPWM_DisableAccStopMode()
574 void TPWM_EnableExtEventTrigger(TIMER_T *timer, uint32_t u32ExtEventSrc, uint32_t u32CounterAction) in TPWM_EnableExtEventTrigger() argument
576timer->PWMEXTETCTL = (((timer)->PWMEXTETCTL & ~(TIMER_PWMEXTETCTL_EXTTRGS_Msk | TIMER_PWMEXTETCTL_… in TPWM_EnableExtEventTrigger()
586 void TPWM_DisableExtEventTrigger(TIMER_T *timer) in TPWM_DisableExtEventTrigger() argument
588 timer->PWMEXTETCTL &= ~TIMER_PWMEXTETCTL_EXTETEN_Msk; in TPWM_DisableExtEventTrigger()