Lines Matching refs:bpwm

35 uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, …  in BPWM_ConfigCaptureChannel()  argument
42 if(bpwm == BPWM0) in BPWM_ConfigCaptureChannel()
60 if(bpwm == BPWM0) in BPWM_ConfigCaptureChannel()
108 BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u16Prescale); in BPWM_ConfigCaptureChannel()
111 (bpwm)->CTL1 = (1UL); in BPWM_ConfigCaptureChannel()
113 BPWM_SET_CNR(bpwm, u32ChannelNum, u16CNR); in BPWM_ConfigCaptureChannel()
130 uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint… in BPWM_ConfigOutputChannel() argument
137 if(bpwm == BPWM0) in BPWM_ConfigOutputChannel()
155 if(bpwm == BPWM0) in BPWM_ConfigOutputChannel()
181 BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); in BPWM_ConfigOutputChannel()
183 (bpwm)->CTL1 = (1UL); in BPWM_ConfigOutputChannel()
186 BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); in BPWM_ConfigOutputChannel()
189 BPWM_SET_CMR(bpwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1UL) / 100UL - 1UL); in BPWM_ConfigOutputChannel()
190 … (bpwm)->WGCTL0 &= ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum * 2U)); in BPWM_ConfigOutputChannel()
191 …(bpwm)->WGCTL0 |= (BPWM_OUTPUT_LOW << ((u32ChannelNum * (2U)) + (uint32_t)BPWM_WGCTL0_PRDPCTL0_Pos… in BPWM_ConfigOutputChannel()
192 …(bpwm)->WGCTL1 &= ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum * 2U)); in BPWM_ConfigOutputChannel()
193 …(bpwm)->WGCTL1 |= (BPWM_OUTPUT_HIGH << (u32ChannelNum * (2U) + (uint32_t)BPWM_WGCTL1_CMPDCTL0_Pos)… in BPWM_ConfigOutputChannel()
197 BPWM_SET_CMR(bpwm, u32ChannelNum, 0U); in BPWM_ConfigOutputChannel()
198 … (bpwm)->WGCTL0 &= ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum * 2U)); in BPWM_ConfigOutputChannel()
199 … (bpwm)->WGCTL0 |= (BPWM_OUTPUT_LOW << (u32ChannelNum * 2U + (uint32_t)BPWM_WGCTL0_ZPCTL0_Pos)); in BPWM_ConfigOutputChannel()
200 …(bpwm)->WGCTL1 &= ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum * 2U)); in BPWM_ConfigOutputChannel()
201 … (bpwm)->WGCTL1 |= (BPWM_OUTPUT_HIGH << (u32ChannelNum * 2U + (uint32_t)BPWM_WGCTL1_CMPDCTL0_Pos)); in BPWM_ConfigOutputChannel()
217 void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_Start() argument
219 (bpwm)->CNTEN = BPWM_CNTEN_CNTEN0_Msk; in BPWM_Start()
232 void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_Stop() argument
234 (bpwm)->PERIOD = 0U; in BPWM_Stop()
247 void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_ForceStop() argument
249 (bpwm)->CNTEN &= ~BPWM_CNTEN_CNTEN0_Msk; in BPWM_ForceStop()
269 void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) in BPWM_EnableADCTrigger() argument
273 (bpwm)->EADCTS0 &= ~((BPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum * 8U)); in BPWM_EnableADCTrigger()
274 (bpwm)->EADCTS0 |= ((BPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum * 8U)); in BPWM_EnableADCTrigger()
278 (bpwm)->EADCTS1 &= ~((BPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4U) * 8U)); in BPWM_EnableADCTrigger()
279 … (bpwm)->EADCTS1 |= ((BPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4U) * 8U)); in BPWM_EnableADCTrigger()
292 void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisableADCTrigger() argument
296 (bpwm)->EADCTS0 &= ~(BPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum * 8U)); in BPWM_DisableADCTrigger()
300 (bpwm)->EADCTS1 &= ~(BPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4U) * 8U)); in BPWM_DisableADCTrigger()
314 void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) in BPWM_ClearADCTriggerFlag() argument
316 (bpwm)->STATUS = (BPWM_STATUS_EADCTRGn_Msk << u32ChannelNum); in BPWM_ClearADCTriggerFlag()
329 uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetADCTriggerFlag() argument
331 return (((bpwm)->STATUS & (BPWM_STATUS_EADCTRGn_Msk << u32ChannelNum)) ? 1UL : 0UL); in BPWM_GetADCTriggerFlag()
344 void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_EnableCapture() argument
346 (bpwm)->CAPINEN |= u32ChannelMask; in BPWM_EnableCapture()
347 (bpwm)->CAPCTL |= u32ChannelMask; in BPWM_EnableCapture()
360 void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_DisableCapture() argument
362 (bpwm)->CAPINEN &= ~u32ChannelMask; in BPWM_DisableCapture()
363 (bpwm)->CAPCTL &= ~u32ChannelMask; in BPWM_DisableCapture()
376 void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_EnableOutput() argument
378 (bpwm)->POEN |= u32ChannelMask; in BPWM_EnableOutput()
391 void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_DisableOutput() argument
393 (bpwm)->POEN &= ~u32ChannelMask; in BPWM_DisableOutput()
408 void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) in BPWM_EnableCaptureInt() argument
410 (bpwm)->CAPIEN |= (u32Edge << u32ChannelNum); in BPWM_EnableCaptureInt()
425 void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) in BPWM_DisableCaptureInt() argument
427 (bpwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); in BPWM_DisableCaptureInt()
442 void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) in BPWM_ClearCaptureIntFlag() argument
444 (bpwm)->CAPIF = (u32Edge << u32ChannelNum); in BPWM_ClearCaptureIntFlag()
459 uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetCaptureIntFlag() argument
461 return (((((bpwm)->CAPIF & (BPWM_CAPIF_CAPFIFn_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1) | \ in BPWM_GetCaptureIntFlag()
462 (((bpwm)->CAPIF & (BPWM_CAPIF_CAPRIFn_Msk << u32ChannelNum)) ? 1UL : 0UL)); in BPWM_GetCaptureIntFlag()
476 void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) in BPWM_EnableDutyInt() argument
478 (bpwm)->INTEN |= (u32IntDutyType << u32ChannelNum); in BPWM_EnableDutyInt()
490 void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisableDutyInt() argument
493 …(bpwm)->INTEN &= ~((uint32_t)(BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | BPWM_DUTY_INT_UP_COUNT_MATCH_CM… in BPWM_DisableDutyInt()
505 void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearDutyIntFlag() argument
507 (bpwm)->INTSTS = (BPWM_INTSTS_CMPUIFn_Msk | BPWM_INTSTS_CMPDIFn_Msk) << u32ChannelNum; in BPWM_ClearDutyIntFlag()
521 uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetDutyIntFlag() argument
523 …return ((((bpwm)->INTSTS & ((BPWM_INTSTS_CMPDIFn_Msk | BPWM_INTSTS_CMPUIFn_Msk) << u32ChannelNum))… in BPWM_GetDutyIntFlag()
537 void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) in BPWM_EnablePeriodInt() argument
539 (bpwm)->INTEN |= BPWM_INTEN_PIEN0_Msk; in BPWM_EnablePeriodInt()
552 void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisablePeriodInt() argument
554 (bpwm)->INTEN &= ~BPWM_INTEN_PIEN0_Msk; in BPWM_DisablePeriodInt()
567 void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearPeriodIntFlag() argument
569 (bpwm)->INTSTS = BPWM_INTSTS_PIF0_Msk; in BPWM_ClearPeriodIntFlag()
584 uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetPeriodIntFlag() argument
586 return (((bpwm)->INTSTS & BPWM_INTSTS_PIF0_Msk) ? 1UL : 0UL); in BPWM_GetPeriodIntFlag()
599 void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_EnableZeroInt() argument
601 (bpwm)->INTEN |= BPWM_INTEN_ZIEN0_Msk; in BPWM_EnableZeroInt()
614 void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisableZeroInt() argument
616 (bpwm)->INTEN &= ~BPWM_INTEN_ZIEN0_Msk; in BPWM_DisableZeroInt()
629 void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearZeroIntFlag() argument
631 (bpwm)->INTSTS = BPWM_INTSTS_ZIF0_Msk; in BPWM_ClearZeroIntFlag()
646 uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetZeroIntFlag() argument
648 return (((bpwm)->INTSTS & BPWM_INTSTS_ZIF0_Msk) ? 1UL : 0UL); in BPWM_GetZeroIntFlag()
663 void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) in BPWM_EnableLoadMode() argument
665 (bpwm)->CTL0 |= (u32LoadMode << u32ChannelNum); in BPWM_EnableLoadMode()
680 void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) in BPWM_DisableLoadMode() argument
682 (bpwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); in BPWM_DisableLoadMode()
701 void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) in BPWM_SetClockSource() argument
703 (bpwm)->CLKSRC = (u32ClkSrcSel); in BPWM_SetClockSource()
718 uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetWrapAroundFlag() argument
720 return (((bpwm)->STATUS & BPWM_STATUS_CNTMAX0_Msk) ? 1UL : 0UL); in BPWM_GetWrapAroundFlag()
733 void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearWrapAroundFlag() argument
735 (bpwm)->STATUS = BPWM_STATUS_CNTMAX0_Msk; in BPWM_ClearWrapAroundFlag()