Lines Matching refs:bpwm
35 uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, … in BPWM_ConfigCaptureChannel() argument
45 if(bpwm == BPWM0) in BPWM_ConfigCaptureChannel()
63 if(bpwm == BPWM0) in BPWM_ConfigCaptureChannel()
110 BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); in BPWM_ConfigCaptureChannel()
113 (bpwm)->CTL1 = (1UL); in BPWM_ConfigCaptureChannel()
115 BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); in BPWM_ConfigCaptureChannel()
134 uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint… in BPWM_ConfigOutputChannel() argument
141 if(bpwm == BPWM0) in BPWM_ConfigOutputChannel()
159 if(bpwm == BPWM0) in BPWM_ConfigOutputChannel()
185 BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); in BPWM_ConfigOutputChannel()
187 (bpwm)->CTL1 = BPWM_UP_COUNTER; in BPWM_ConfigOutputChannel()
190 BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); in BPWM_ConfigOutputChannel()
191 BPWM_SET_CMR(bpwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1UL) / 100UL); in BPWM_ConfigOutputChannel()
194 …(bpwm)->WGCTL0 = ((bpwm)->WGCTL0 & ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32Ch… in BPWM_ConfigOutputChannel()
196 …(bpwm)->WGCTL1 = ((bpwm)->WGCTL1 & ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32… in BPWM_ConfigOutputChannel()
212 void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_Start() argument
215 (bpwm)->CNTEN = BPWM_CNTEN_CNTEN0_Msk; in BPWM_Start()
228 void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_Stop() argument
231 (bpwm)->PERIOD = 0UL; in BPWM_Stop()
244 void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_ForceStop() argument
247 (bpwm)->CNTEN &= ~BPWM_CNTEN_CNTEN0_Msk; in BPWM_ForceStop()
267 void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) in BPWM_EnableADCTrigger() argument
271 (bpwm)->EADCTS0 &= ~((BPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3)); in BPWM_EnableADCTrigger()
272 (bpwm)->EADCTS0 |= ((BPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3)); in BPWM_EnableADCTrigger()
276 (bpwm)->EADCTS1 &= ~((BPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4UL) << 3)); in BPWM_EnableADCTrigger()
277 … (bpwm)->EADCTS1 |= ((BPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4UL) << 3)); in BPWM_EnableADCTrigger()
290 void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisableADCTrigger() argument
294 (bpwm)->EADCTS0 &= ~(BPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3)); in BPWM_DisableADCTrigger()
298 (bpwm)->EADCTS1 &= ~(BPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4UL) << 3)); in BPWM_DisableADCTrigger()
312 void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) in BPWM_ClearADCTriggerFlag() argument
315 (bpwm)->STATUS = (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum); in BPWM_ClearADCTriggerFlag()
328 uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetADCTriggerFlag() argument
330 return (((bpwm)->STATUS & (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum)) ? 1UL : 0UL); in BPWM_GetADCTriggerFlag()
343 void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_EnableCapture() argument
345 (bpwm)->CAPINEN |= u32ChannelMask; in BPWM_EnableCapture()
346 (bpwm)->CAPCTL |= u32ChannelMask; in BPWM_EnableCapture()
359 void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_DisableCapture() argument
361 (bpwm)->CAPINEN &= ~u32ChannelMask; in BPWM_DisableCapture()
362 (bpwm)->CAPCTL &= ~u32ChannelMask; in BPWM_DisableCapture()
375 void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_EnableOutput() argument
377 (bpwm)->POEN |= u32ChannelMask; in BPWM_EnableOutput()
390 void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) in BPWM_DisableOutput() argument
392 (bpwm)->POEN &= ~u32ChannelMask; in BPWM_DisableOutput()
407 void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) in BPWM_EnableCaptureInt() argument
409 (bpwm)->CAPIEN |= (u32Edge << u32ChannelNum); in BPWM_EnableCaptureInt()
424 void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) in BPWM_DisableCaptureInt() argument
426 (bpwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); in BPWM_DisableCaptureInt()
441 void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) in BPWM_ClearCaptureIntFlag() argument
443 (bpwm)->CAPIF = (u32Edge << u32ChannelNum); in BPWM_ClearCaptureIntFlag()
458 uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetCaptureIntFlag() argument
462 u32CapIf = ((((bpwm)->CAPIF & (BPWM_CAPIF_CAPFIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1); in BPWM_GetCaptureIntFlag()
463 u32CapIf |= (((bpwm)->CAPIF & (BPWM_CAPIF_CAPRIF0_Msk << u32ChannelNum)) ? 1UL : 0UL); in BPWM_GetCaptureIntFlag()
479 void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) in BPWM_EnableDutyInt() argument
481 (bpwm)->INTEN |= (u32IntDutyType << u32ChannelNum); in BPWM_EnableDutyInt()
493 void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisableDutyInt() argument
495 …(bpwm)->INTEN &= (uint32_t)(~((BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | BPWM_DUTY_INT_UP_COUNT_MATCH_C… in BPWM_DisableDutyInt()
507 void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearDutyIntFlag() argument
509 (bpwm)->INTSTS = (BPWM_INTSTS_CMPUIF0_Msk | BPWM_INTSTS_CMPDIF0_Msk) << u32ChannelNum; in BPWM_ClearDutyIntFlag()
523 uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetDutyIntFlag() argument
525 …return ((((bpwm)->INTSTS & ((BPWM_INTSTS_CMPDIF0_Msk | BPWM_INTSTS_CMPUIF0_Msk) << u32ChannelNum))… in BPWM_GetDutyIntFlag()
539 void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) in BPWM_EnablePeriodInt() argument
543 (bpwm)->INTEN |= BPWM_INTEN_PIEN0_Msk; in BPWM_EnablePeriodInt()
556 void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisablePeriodInt() argument
559 (bpwm)->INTEN &= ~BPWM_INTEN_PIEN0_Msk; in BPWM_DisablePeriodInt()
572 void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearPeriodIntFlag() argument
575 (bpwm)->INTSTS = BPWM_INTSTS_PIF0_Msk; in BPWM_ClearPeriodIntFlag()
590 uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetPeriodIntFlag() argument
593 return (((bpwm)->INTSTS & BPWM_INTSTS_PIF0_Msk) ? 1UL : 0UL); in BPWM_GetPeriodIntFlag()
606 void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_EnableZeroInt() argument
609 (bpwm)->INTEN |= BPWM_INTEN_ZIEN0_Msk; in BPWM_EnableZeroInt()
622 void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_DisableZeroInt() argument
625 (bpwm)->INTEN &= ~BPWM_INTEN_ZIEN0_Msk; in BPWM_DisableZeroInt()
638 void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearZeroIntFlag() argument
641 (bpwm)->INTSTS = BPWM_INTSTS_ZIF0_Msk; in BPWM_ClearZeroIntFlag()
656 uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetZeroIntFlag() argument
659 return (((bpwm)->INTSTS & BPWM_INTSTS_ZIF0_Msk) ? 1UL : 0UL); in BPWM_GetZeroIntFlag()
674 void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) in BPWM_EnableLoadMode() argument
676 (bpwm)->CTL0 |= (u32LoadMode << u32ChannelNum); in BPWM_EnableLoadMode()
691 void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) in BPWM_DisableLoadMode() argument
693 (bpwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); in BPWM_DisableLoadMode()
712 void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) in BPWM_SetClockSource() argument
715 (bpwm)->CLKSRC = (u32ClkSrcSel); in BPWM_SetClockSource()
730 uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_GetWrapAroundFlag() argument
733 return (((bpwm)->STATUS & BPWM_STATUS_CNTMAX0_Msk) ? 1UL : 0UL); in BPWM_GetWrapAroundFlag()
746 void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) in BPWM_ClearWrapAroundFlag() argument
749 (bpwm)->STATUS = BPWM_STATUS_CNTMAX0_Msk; in BPWM_ClearWrapAroundFlag()