M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
Macros | Functions
Collaboration diagram for PWM Exported Functions:

Macros

#define PWM_ENABLE_COMPLEMENTARY_MODE(pwm)
 This macro enable complementary mode. More...
 
#define PWM_DISABLE_COMPLEMENTARY_MODE(pwm)
 This macro disable complementary mode, and enable independent mode. More...
 
#define PWM_ENABLE_GROUP_MODE(pwm)
 This macro enable group mode. More...
 
#define PWM_DISABLE_GROUP_MODE(pwm)
 This macro disable group mode. More...
 
#define PWM_ENABLE_TIMER_SYNC(pwm, u32ChannelMask)
 Enable timer synchronous mode of specified channel(s) More...
 
#define PWM_DISABLE_TIMER_SYNC(pwm, u32ChannelMask)
 Disable timer synchronous mode of specified channel(s) More...
 
#define PWM_ENABLE_OUTPUT_INVERTER(pwm, u32ChannelMask)
 This macro enable output inverter of specified channel(s) More...
 
#define PWM_GET_CAPTURE_RISING_DATA(pwm, u32ChannelNum)
 This macro get captured rising data. More...
 
#define PWM_GET_CAPTURE_FALLING_DATA(pwm, u32ChannelNum)
 This macro get captured falling data. More...
 
#define PWM_MASK_OUTPUT(pwm, u32ChannelMask, u32LevelMask)
 This macro mask output logic to high or low. More...
 
#define PWM_SET_PRESCALER(pwm, u32ChannelNum, u32Prescaler)
 This macro set the prescaler of the selected channel. More...
 
#define PWM_SET_CMR(pwm, u32ChannelNum, u32CMR)
 This macro set the comparator of the selected channel. More...
 
#define PWM_SET_FTCMR(pwm, u32ChannelNum, u32FTCMR)
 This macro set the free trigger comparator of the selected channel. More...
 
#define PWM_SET_CNR(pwm, u32ChannelNum, u32CNR)
 This macro set the period of the selected channel. More...
 
#define PWM_SET_ALIGNED_TYPE(pwm, u32ChannelMask, u32AlignedType)
 This macro set the PWM aligned type. More...
 
#define PWM_SET_LOAD_WINDOW(pwm, u32ChannelMask)
 Set load window of window loading mode for specified channel(s) More...
 
#define PWM_TRIGGER_SYNC(pwm, u32ChannelNum)
 Trigger synchronous event from specified channel(s) More...
 
#define PWM_CLR_COUNTER(pwm, u32ChannelMask)
 Clear counter of specified channel(s) More...
 
#define PWM_SET_OUTPUT_LEVEL(pwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel)
 Set output level at zero, compare up, period(center) and compare down of specified channel(s) More...
 
#define PWM_TRIGGER_BRAKE(pwm, u32ChannelMask, u32BrakeType)
 Trigger brake event from specified channel(s) More...
 
#define PWM_SET_DEADZONE_CLK_SRC(pwm, u32ChannelNum, u32AfterPrescaler)
 Set Dead zone clock source. More...
 

Functions

uint32_t PWM_ConfigCaptureChannel (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge)
 Configure PWM capture and get the nearest unit time. More...
 
uint32_t PWM_ConfigOutputChannel (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle)
 This function Configure PWM generator and get the nearest frequency in edge aligned auto-reload mode. More...
 
void PWM_Start (PWM_T *pwm, uint32_t u32ChannelMask)
 Start PWM module. More...
 
void PWM_Stop (PWM_T *pwm, uint32_t u32ChannelMask)
 Stop PWM module. More...
 
void PWM_ForceStop (PWM_T *pwm, uint32_t u32ChannelMask)
 Stop PWM generation immediately by clear channel enable bit. More...
 
void PWM_EnableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition)
 Enable selected channel to trigger EADC. More...
 
void PWM_DisableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum)
 Disable selected channel to trigger EADC. More...
 
void PWM_ClearADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition)
 Clear selected channel trigger EADC flag. More...
 
uint32_t PWM_GetADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Get selected channel trigger EADC flag. More...
 
void PWM_EnableFaultBrake (PWM_T *pwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource)
 This function enable fault brake of selected channel(s) More...
 
void PWM_EnableCapture (PWM_T *pwm, uint32_t u32ChannelMask)
 Enable capture of selected channel(s) More...
 
void PWM_DisableCapture (PWM_T *pwm, uint32_t u32ChannelMask)
 Disable capture of selected channel(s) More...
 
void PWM_EnableOutput (PWM_T *pwm, uint32_t u32ChannelMask)
 Enables PWM output generation of selected channel(s) More...
 
void PWM_DisableOutput (PWM_T *pwm, uint32_t u32ChannelMask)
 Disables PWM output generation of selected channel(s) More...
 
void PWM_EnablePDMA (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode)
 Enables PDMA transfer of selected channel for PWM capture. More...
 
void PWM_DisablePDMA (PWM_T *pwm, uint32_t u32ChannelNum)
 Disables PDMA transfer of selected channel for PWM capture. More...
 
void PWM_EnableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Duration)
 Enable Dead zone of selected channel. More...
 
void PWM_DisableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum)
 Disable Dead zone of selected channel. More...
 
void PWM_EnableCaptureInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge)
 Enable capture interrupt of selected channel. More...
 
void PWM_DisableCaptureInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge)
 Disable capture interrupt of selected channel. More...
 
void PWM_ClearCaptureIntFlag (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge)
 Clear capture interrupt of selected channel. More...
 
uint32_t PWM_GetCaptureIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Get capture interrupt of selected channel. More...
 
void PWM_EnableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType)
 Enable duty interrupt of selected channel. More...
 
void PWM_DisableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Disable duty interrupt of selected channel. More...
 
void PWM_ClearDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Clear duty interrupt flag of selected channel. More...
 
uint32_t PWM_GetDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Get duty interrupt flag of selected channel. More...
 
void PWM_EnableFaultBrakeInt (PWM_T *pwm, uint32_t u32BrakeSource)
 This function enable fault brake interrupt. More...
 
void PWM_DisableFaultBrakeInt (PWM_T *pwm, uint32_t u32BrakeSource)
 This function disable fault brake interrupt. More...
 
void PWM_ClearFaultBrakeIntFlag (PWM_T *pwm, uint32_t u32BrakeSource)
 This function clear fault brake interrupt of selected source. More...
 
uint32_t PWM_GetFaultBrakeIntFlag (PWM_T *pwm, uint32_t u32BrakeSource)
 This function get fault brake interrupt flag of selected source. More...
 
void PWM_EnablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType)
 Enable period interrupt of selected channel. More...
 
void PWM_DisablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Disable period interrupt of selected channel. More...
 
void PWM_ClearPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Clear period interrupt of selected channel. More...
 
uint32_t PWM_GetPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Get period interrupt of selected channel. More...
 
void PWM_EnableZeroInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Enable zero interrupt of selected channel. More...
 
void PWM_DisableZeroInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Disable zero interrupt of selected channel. More...
 
void PWM_ClearZeroIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Clear zero interrupt of selected channel. More...
 
uint32_t PWM_GetZeroIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Get zero interrupt of selected channel. More...
 
void PWM_EnableAcc (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc)
 Enable interrupt flag accumulator of selected channel. More...
 
void PWM_DisableAcc (PWM_T *pwm, uint32_t u32ChannelNum)
 Disable interrupt flag accumulator of selected channel. More...
 
void PWM_EnableAccInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Enable interrupt flag accumulator interrupt of selected channel. More...
 
void PWM_DisableAccInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Disable interrupt flag accumulator interrupt of selected channel. More...
 
void PWM_ClearAccInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Clear interrupt flag accumulator interrupt of selected channel. More...
 
uint32_t PWM_GetAccInt (PWM_T *pwm, uint32_t u32ChannelNum)
 Get interrupt flag accumulator interrupt of selected channel. More...
 
void PWM_ClearFTDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Clear free trigger duty interrupt flag of selected channel. More...
 
uint32_t PWM_GetFTDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Get free trigger duty interrupt flag of selected channel. More...
 
void PWM_EnableLoadMode (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32LoadMode)
 Enable load mode of selected channel. More...
 
void PWM_DisableLoadMode (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32LoadMode)
 Disable load mode of selected channel. More...
 
void PWM_ConfigSyncPhase (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase)
 Configure synchronization phase of selected channel. More...
 
void PWM_EnableSyncPhase (PWM_T *pwm, uint32_t u32ChannelMask)
 Enable SYNC phase of selected channel(s) More...
 
void PWM_DisableSyncPhase (PWM_T *pwm, uint32_t u32ChannelMask)
 Disable SYNC phase of selected channel(s) More...
 
void PWM_EnableSyncNoiseFilter (PWM_T *pwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel)
 Enable PWM SYNC_IN noise filter function. More...
 
void PWM_DisableSyncNoiseFilter (PWM_T *pwm)
 Disable PWM SYNC_IN noise filter function. More...
 
void PWM_EnableSyncPinInverse (PWM_T *pwm)
 Enable PWM SYNC input pin inverse function. More...
 
void PWM_DisableSyncPinInverse (PWM_T *pwm)
 Disable PWM SYNC input pin inverse function. More...
 
void PWM_SetClockSource (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel)
 Set PWM clock source. More...
 
void PWM_EnableBrakeNoiseFilter (PWM_T *pwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel)
 Enable PWM brake noise filter function. More...
 
void PWM_DisableBrakeNoiseFilter (PWM_T *pwm, uint32_t u32BrakePinNum)
 Disable PWM brake noise filter function. More...
 
void PWM_EnableBrakePinInverse (PWM_T *pwm, uint32_t u32BrakePinNum)
 Enable PWM brake pin inverse function. More...
 
void PWM_DisableBrakePinInverse (PWM_T *pwm, uint32_t u32BrakePinNum)
 Disable PWM brake pin inverse function. More...
 
void PWM_SetBrakePinSource (PWM_T *pwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule)
 Set PWM brake pin source. More...
 
uint32_t PWM_GetWrapAroundFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Get the time-base counter reached its maximum value flag of selected channel. More...
 
void PWM_ClearWrapAroundFlag (PWM_T *pwm, uint32_t u32ChannelNum)
 Clear the time-base counter reached its maximum value flag of selected channel. More...
 

Detailed Description

Macro Definition Documentation

◆ PWM_CLR_COUNTER

#define PWM_CLR_COUNTER (   pwm,
  u32ChannelMask 
)

Clear counter of specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
Returns
None

This macro is used to clear counter of specified channel(s).

Definition at line 384 of file pwm.h.

◆ PWM_DISABLE_COMPLEMENTARY_MODE

#define PWM_DISABLE_COMPLEMENTARY_MODE (   pwm)

This macro disable complementary mode, and enable independent mode.

Parameters
[in]pwmThe pointer of the specified PWM module
Returns
None

This macro is used to disable complementary mode of PWM module.

Definition at line 185 of file pwm.h.

◆ PWM_DISABLE_GROUP_MODE

#define PWM_DISABLE_GROUP_MODE (   pwm)

This macro disable group mode.

Parameters
[in]pwmThe pointer of the specified PWM module
Returns
None

This macro is used to disable group mode of PWM module.

Definition at line 203 of file pwm.h.

◆ PWM_DISABLE_TIMER_SYNC

#define PWM_DISABLE_TIMER_SYNC (   pwm,
  u32ChannelMask 
)

Disable timer synchronous mode of specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
Returns
None

This macro is used to disable timer synchronous mode of specified channel(s).

Definition at line 225 of file pwm.h.

◆ PWM_ENABLE_COMPLEMENTARY_MODE

#define PWM_ENABLE_COMPLEMENTARY_MODE (   pwm)

This macro enable complementary mode.

Parameters
[in]pwmThe pointer of the specified PWM module
Returns
None

This macro is used to enable complementary mode of PWM module.

Definition at line 176 of file pwm.h.

◆ PWM_ENABLE_GROUP_MODE

#define PWM_ENABLE_GROUP_MODE (   pwm)

This macro enable group mode.

Parameters
[in]pwmThe pointer of the specified PWM module
Returns
None

This macro is used to enable group mode of PWM module.

Definition at line 194 of file pwm.h.

◆ PWM_ENABLE_OUTPUT_INVERTER

#define PWM_ENABLE_OUTPUT_INVERTER (   pwm,
  u32ChannelMask 
)

This macro enable output inverter of specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
Returns
None

This macro is used to enable output inverter of specified channel(s).

Definition at line 243 of file pwm.h.

◆ PWM_ENABLE_TIMER_SYNC

#define PWM_ENABLE_TIMER_SYNC (   pwm,
  u32ChannelMask 
)

Enable timer synchronous mode of specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
Returns
None

This macro is used to enable timer synchronous mode of specified channel(s).

Definition at line 214 of file pwm.h.

◆ PWM_GET_CAPTURE_FALLING_DATA

#define PWM_GET_CAPTURE_FALLING_DATA (   pwm,
  u32ChannelNum 
)

This macro get captured falling data.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This macro is used to get captured falling data of specified channel.

Definition at line 263 of file pwm.h.

◆ PWM_GET_CAPTURE_RISING_DATA

#define PWM_GET_CAPTURE_RISING_DATA (   pwm,
  u32ChannelNum 
)

This macro get captured rising data.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This macro is used to get captured rising data of specified channel.

Definition at line 253 of file pwm.h.

◆ PWM_MASK_OUTPUT

#define PWM_MASK_OUTPUT (   pwm,
  u32ChannelMask,
  u32LevelMask 
)

This macro mask output logic to high or low.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
[in]u32LevelMaskOutput logic to high or low
Returns
None

This macro is used to mask output logic to high or low of specified channel(s).

Note
If u32ChannelMask parameter is 0, then mask function will be disabled.

Definition at line 276 of file pwm.h.

◆ PWM_SET_ALIGNED_TYPE

#define PWM_SET_ALIGNED_TYPE (   pwm,
  u32ChannelMask,
  u32AlignedType 
)

This macro set the PWM aligned type.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
[in]u32AlignedTypePWM aligned type, valid values are:
Returns
None

This macro is used to set the PWM aligned type of specified channel(s).

Definition at line 344 of file pwm.h.

◆ PWM_SET_CMR

#define PWM_SET_CMR (   pwm,
  u32ChannelNum,
  u32CMR 
)

This macro set the comparator of the selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32CMRComparator of specified channel. Valid values are between 0~0xFFFF
Returns
None

This macro is used to set the comparator of specified channel.

Note
This new setting will take effect on next PWM period.

Definition at line 305 of file pwm.h.

◆ PWM_SET_CNR

#define PWM_SET_CNR (   pwm,
  u32ChannelNum,
  u32CNR 
)

This macro set the period of the selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32CNRPeriod of specified channel. Valid values are between 0~0xFFFF
Returns
None

This macro is used to set the period of specified channel.

Note
This new setting will take effect on next PWM period.
PWM counter will stop if period length set to 0.

Definition at line 330 of file pwm.h.

◆ PWM_SET_DEADZONE_CLK_SRC

#define PWM_SET_DEADZONE_CLK_SRC (   pwm,
  u32ChannelNum,
  u32AfterPrescaler 
)

Set Dead zone clock source.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32AfterPrescalerDead zone clock source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler).
Returns
None

This macro is used to set Dead zone clock source. Every two channels share the same setting.

Note
The write-protection function should be disabled before using this function.

Definition at line 452 of file pwm.h.

◆ PWM_SET_FTCMR

#define PWM_SET_FTCMR (   pwm,
  u32ChannelNum,
  u32FTCMR 
)

This macro set the free trigger comparator of the selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32FTCMRFree trigger comparator of specified channel. Valid values are between 0~0xFFFF
Returns
None

This macro is used to set the free trigger comparator of specified channel.

Note
This new setting will take effect on next PWM period.

Definition at line 317 of file pwm.h.

◆ PWM_SET_LOAD_WINDOW

#define PWM_SET_LOAD_WINDOW (   pwm,
  u32ChannelMask 
)

Set load window of window loading mode for specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
Returns
None

This macro is used to set load window of window loading mode for specified channel(s).

Definition at line 362 of file pwm.h.

◆ PWM_SET_OUTPUT_LEVEL

#define PWM_SET_OUTPUT_LEVEL (   pwm,
  u32ChannelMask,
  u32ZeroLevel,
  u32CmpUpLevel,
  u32PeriodLevel,
  u32CmpDownLevel 
)

Set output level at zero, compare up, period(center) and compare down of specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...
[in]u32ZeroLeveloutput level at zero point, valid values are:
[in]u32CmpUpLeveloutput level at compare up point, valid values are:
[in]u32PeriodLeveloutput level at period(center) point, valid values are:
[in]u32CmpDownLeveloutput level at compare down point, valid values are:
Returns
None

This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s).

Definition at line 415 of file pwm.h.

◆ PWM_SET_PRESCALER

#define PWM_SET_PRESCALER (   pwm,
  u32ChannelNum,
  u32Prescaler 
)

This macro set the prescaler of the selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32PrescalerClock prescaler of specified channel. Valid values are between 1 ~ 0xFFF
Returns
None

This macro is used to set the prescaler of specified channel.

Note
Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected.

Definition at line 293 of file pwm.h.

◆ PWM_TRIGGER_BRAKE

#define PWM_TRIGGER_BRAKE (   pwm,
  u32ChannelMask,
  u32BrakeType 
)

Trigger brake event from specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4
[in]u32BrakeTypeType of brake trigger.
Returns
None

This macro is used to trigger brake event from specified channel(s).

Definition at line 440 of file pwm.h.

◆ PWM_TRIGGER_SYNC

#define PWM_TRIGGER_SYNC (   pwm,
  u32ChannelNum 
)

Trigger synchronous event from specified channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32ChannelNumPWM channel number. Valid values are 0, 2, 4 Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4
Returns
None

This macro is used to trigger synchronous event from specified channel(s).

Definition at line 373 of file pwm.h.

Function Documentation

◆ PWM_ClearAccInt()

void PWM_ClearAccInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Clear interrupt flag accumulator interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to clear interrupt flag accumulator interrupt of selected channel.

Note
Every two channels share the same setting.

Definition at line 910 of file pwm.c.

◆ PWM_ClearADCTriggerFlag()

void PWM_ClearADCTriggerFlag ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32Condition 
)

Clear selected channel trigger EADC flag.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32ConditionThis parameter is not used
Returns
None

This function is used to clear selected channel trigger EADC flag.

Definition at line 287 of file pwm.c.

◆ PWM_ClearCaptureIntFlag()

void PWM_ClearCaptureIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32Edge 
)

Clear capture interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32EdgeRising or falling edge to latch counter.
Returns
None

This function is used to clear capture interrupt of selected channel.

Definition at line 566 of file pwm.c.

◆ PWM_ClearDutyIntFlag()

void PWM_ClearDutyIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Clear duty interrupt flag of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to clear duty interrupt flag of selected channel.

Definition at line 628 of file pwm.c.

◆ PWM_ClearFaultBrakeIntFlag()

void PWM_ClearFaultBrakeIntFlag ( PWM_T pwm,
uint32_t  u32BrakeSource 
)

This function clear fault brake interrupt of selected source.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32BrakeSourceFault brake source.
Returns
None

This function is used to clear fault brake interrupt of selected source. The write-protection function should be disabled before using this function.

Definition at line 691 of file pwm.c.

◆ PWM_ClearFTDutyIntFlag()

void PWM_ClearFTDutyIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Clear free trigger duty interrupt flag of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to clear free trigger duty interrupt flag of selected channel.

Definition at line 940 of file pwm.c.

◆ PWM_ClearPeriodIntFlag()

void PWM_ClearPeriodIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Clear period interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to clear period interrupt of selected channel.

Definition at line 750 of file pwm.c.

◆ PWM_ClearWrapAroundFlag()

void PWM_ClearWrapAroundFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Clear the time-base counter reached its maximum value flag of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to clear the time-base counter reached its maximum value flag of selected channel.

Definition at line 1265 of file pwm.c.

◆ PWM_ClearZeroIntFlag()

void PWM_ClearZeroIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Clear zero interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to clear zero interrupt of selected channel.

Definition at line 808 of file pwm.c.

◆ PWM_ConfigCaptureChannel()

uint32_t PWM_ConfigCaptureChannel ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32UnitTimeNsec,
uint32_t  u32CaptureEdge 
)

Configure PWM capture and get the nearest unit time.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32UnitTimeNsecThe unit time of counter
[in]u32CaptureEdgeThe condition to latch the counter. This parameter is not used
Returns
The nearest unit time in nano second.

This function is used to Configure PWM capture and get the nearest unit time.

Definition at line 34 of file pwm.c.

Here is the call graph for this function:

◆ PWM_ConfigOutputChannel()

uint32_t PWM_ConfigOutputChannel ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32Frequency,
uint32_t  u32DutyCycle 
)

This function Configure PWM generator and get the nearest frequency in edge aligned auto-reload mode.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32FrequencyTarget generator frequency
[in]u32DutyCycleTarget generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%...
Returns
Nearest frequency clock in nano second
Note
Since every two channels, (0 & 1), (2 & 3), shares a prescaler. Call this API to configure PWM frequency may affect existing frequency of other channel.

Definition at line 98 of file pwm.c.

Here is the call graph for this function:

◆ PWM_ConfigSyncPhase()

void PWM_ConfigSyncPhase ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32SyncSrc,
uint32_t  u32Direction,
uint32_t  u32StartPhase 
)

Configure synchronization phase of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32SyncSrcPWM synchronize source selection.
[in]u32DirectionPhase direction. Control PWM counter count decrement or increment after synchronizing.
[in]u32StartPhaseSynchronous start phase value. Valid values are between 0~65535.
Returns
None

This function is used to configure synchronization phase of selected channel.

Note
Every two channels share the same setting.

Definition at line 1016 of file pwm.c.

◆ PWM_DisableAcc()

void PWM_DisableAcc ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disable interrupt flag accumulator of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to Disable interrupt flag accumulator of selected channel.

Note
Every two channels share the same setting.

Definition at line 865 of file pwm.c.

◆ PWM_DisableAccInt()

void PWM_DisableAccInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disable interrupt flag accumulator interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to disable interrupt flag accumulator interrupt of selected channel.

Note
Every two channels share the same setting.

Definition at line 895 of file pwm.c.

◆ PWM_DisableADCTrigger()

void PWM_DisableADCTrigger ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disable selected channel to trigger EADC.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to disable selected channel to trigger EADC.

Definition at line 265 of file pwm.c.

◆ PWM_DisableBrakeNoiseFilter()

void PWM_DisableBrakeNoiseFilter ( PWM_T pwm,
uint32_t  u32BrakePinNum 
)

Disable PWM brake noise filter function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32BrakePinNumBrake pin selection. Valid values are 0 or 1.
Returns
None

This function is used to disable PWM brake noise filter function.

Definition at line 1192 of file pwm.c.

◆ PWM_DisableBrakePinInverse()

void PWM_DisableBrakePinInverse ( PWM_T pwm,
uint32_t  u32BrakePinNum 
)

Disable PWM brake pin inverse function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32BrakePinNumBrake pin selection. Valid values are 0 or 1.
Returns
None

This function is used to disable PWM brake pin inverse function.

Definition at line 1220 of file pwm.c.

◆ PWM_DisableCapture()

void PWM_DisableCapture ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Disable capture of selected channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1...
Returns
None

This function is used to disable capture of selected channel(s).

Definition at line 411 of file pwm.c.

◆ PWM_DisableCaptureInt()

void PWM_DisableCaptureInt ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32Edge 
)

Disable capture interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32EdgeRising or falling edge to latch counter.
Returns
None

This function is used to disable capture interrupt of selected channel.

Definition at line 549 of file pwm.c.

◆ PWM_DisableDeadZone()

void PWM_DisableDeadZone ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disable Dead zone of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to disable Dead zone of selected channel. The write-protection function should be disabled before using this function.

Definition at line 514 of file pwm.c.

◆ PWM_DisableDutyInt()

void PWM_DisableDutyInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disable duty interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to disable duty interrupt of selected channel.

Definition at line 614 of file pwm.c.

◆ PWM_DisableFaultBrakeInt()

void PWM_DisableFaultBrakeInt ( PWM_T pwm,
uint32_t  u32BrakeSource 
)

This function disable fault brake interrupt.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32BrakeSourceFault brake source.
Returns
None

This function is used to disable fault brake interrupt. The write-protection function should be disabled before using this function.

Note
Every two channels share the same setting.

Definition at line 676 of file pwm.c.

◆ PWM_DisableLoadMode()

void PWM_DisableLoadMode ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32LoadMode 
)

Disable load mode of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32LoadModePWM counter loading mode.
Returns
None

This function is used to disable load mode of selected channel.

Definition at line 992 of file pwm.c.

◆ PWM_DisableOutput()

void PWM_DisableOutput ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Disables PWM output generation of selected channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output...
Returns
None

This function is used to disable PWM output generation of selected channel(s).

Definition at line 442 of file pwm.c.

◆ PWM_DisablePDMA()

void PWM_DisablePDMA ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disables PDMA transfer of selected channel for PWM capture.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number.
Returns
None

This function is used to enable PDMA transfer of selected channel(s) for PWM capture.

Definition at line 480 of file pwm.c.

◆ PWM_DisablePeriodInt()

void PWM_DisablePeriodInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disable period interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to disable period interrupt of selected channel.

Definition at line 736 of file pwm.c.

◆ PWM_DisableSyncNoiseFilter()

void PWM_DisableSyncNoiseFilter ( PWM_T pwm)

Disable PWM SYNC_IN noise filter function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
Returns
None

This function is used to Disable PWM SYNC_IN noise filter function.

Definition at line 1105 of file pwm.c.

◆ PWM_DisableSyncPhase()

void PWM_DisableSyncPhase ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Disable SYNC phase of selected channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1...
Returns
None

This function is used to disable SYNC phase of selected channel(s).

Note
Every two channels share the same setting.

Definition at line 1060 of file pwm.c.

◆ PWM_DisableSyncPinInverse()

void PWM_DisableSyncPinInverse ( PWM_T pwm)

Disable PWM SYNC input pin inverse function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
Returns
None

This function is used to Disable PWM SYNC input pin inverse function.

Definition at line 1131 of file pwm.c.

◆ PWM_DisableZeroInt()

void PWM_DisableZeroInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Disable zero interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to disable zero interrupt of selected channel.

Definition at line 794 of file pwm.c.

◆ PWM_EnableAcc()

void PWM_EnableAcc ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32IntFlagCnt,
uint32_t  u32IntAccSrc 
)

Enable interrupt flag accumulator of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32IntFlagCntInterrupt flag counter. Valid values are between 0~15.
[in]u32IntAccSrcInterrupt flag accumulator source selection.
Returns
None

This function is used to enable interrupt flag accumulator of selected channel.

Note
Every two channels share the same setting.

Definition at line 849 of file pwm.c.

◆ PWM_EnableAccInt()

void PWM_EnableAccInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Enable interrupt flag accumulator interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to enable interrupt flag accumulator interrupt of selected channel.

Note
Every two channels share the same setting.

Definition at line 880 of file pwm.c.

◆ PWM_EnableADCTrigger()

void PWM_EnableADCTrigger ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32Condition 
)

◆ PWM_EnableBrakeNoiseFilter()

void PWM_EnableBrakeNoiseFilter ( PWM_T pwm,
uint32_t  u32BrakePinNum,
uint32_t  u32ClkCnt,
uint32_t  u32ClkDivSel 
)

Enable PWM brake noise filter function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32BrakePinNumBrake pin selection. Valid values are 0 or 1.
[in]u32ClkCntSYNC Edge Detector Filter Count. This controls the counter number of edge detector
[in]u32ClkDivSelSYNC Edge Detector Filter Clock Selection.
Returns
None

This function is used to enable PWM brake noise filter function.

Definition at line 1177 of file pwm.c.

◆ PWM_EnableBrakePinInverse()

void PWM_EnableBrakePinInverse ( PWM_T pwm,
uint32_t  u32BrakePinNum 
)

Enable PWM brake pin inverse function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32BrakePinNumBrake pin selection. Valid values are 0 or 1.
Returns
None

This function is used to enable PWM brake pin inverse function.

Definition at line 1206 of file pwm.c.

◆ PWM_EnableCapture()

void PWM_EnableCapture ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Enable capture of selected channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1...
Returns
None

This function is used to enable capture of selected channel(s).

Definition at line 395 of file pwm.c.

◆ PWM_EnableCaptureInt()

void PWM_EnableCaptureInt ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32Edge 
)

Enable capture interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32EdgeRising or falling edge to latch counter.
Returns
None

This function is used to enable capture interrupt of selected channel.

Definition at line 532 of file pwm.c.

◆ PWM_EnableDeadZone()

void PWM_EnableDeadZone ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32Duration 
)

Enable Dead zone of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32DurationDead zone length in PWM clock count, valid values are between 0~0xFFF, but 0 means there is no Dead zone.
Returns
None

This function is used to enable Dead zone of selected channel. The write-protection function should be disabled before using this function.

Note
Every two channels share the same setting.

Definition at line 497 of file pwm.c.

◆ PWM_EnableDutyInt()

void PWM_EnableDutyInt ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32IntDutyType 
)

Enable duty interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32IntDutyTypeDuty interrupt type, could be either
Returns
None

This function is used to enable duty interrupt of selected channel.

Definition at line 600 of file pwm.c.

◆ PWM_EnableFaultBrake()

void PWM_EnableFaultBrake ( PWM_T pwm,
uint32_t  u32ChannelMask,
uint32_t  u32LevelMask,
uint32_t  u32BrakeSource 
)

This function enable fault brake of selected channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel.
[in]u32LevelMaskOutput high or low while fault brake occurs, each bit represent the level of a channel while fault brake occurs. Bit 0 represents channel 0, bit 1 represents channel 1...
[in]u32BrakeSourceFault brake source, could be one of following source
Returns
None

This function is used to enable fault brake of selected channel(s). The write-protection function should be disabled before using this function.

Definition at line 331 of file pwm.c.

◆ PWM_EnableFaultBrakeInt()

void PWM_EnableFaultBrakeInt ( PWM_T pwm,
uint32_t  u32BrakeSource 
)

This function enable fault brake interrupt.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32BrakeSourceFault brake source.
Returns
None

This function is used to enable fault brake interrupt. The write-protection function should be disabled before using this function.

Note
Every two channels share the same setting.

Definition at line 660 of file pwm.c.

◆ PWM_EnableLoadMode()

void PWM_EnableLoadMode ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32LoadMode 
)

Enable load mode of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32LoadModePWM counter loading mode.
Returns
None

This function is used to enable load mode of selected channel.

Definition at line 974 of file pwm.c.

◆ PWM_EnableOutput()

void PWM_EnableOutput ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Enables PWM output generation of selected channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output...
Returns
None

This function is used to enable PWM output generation of selected channel(s).

Definition at line 427 of file pwm.c.

◆ PWM_EnablePDMA()

void PWM_EnablePDMA ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32RisingFirst,
uint32_t  u32Mode 
)

Enables PDMA transfer of selected channel for PWM capture.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number.
[in]u32RisingFirstThe capture order is rising, falling first. Every two channels share the same setting. Valid values are TRUE and FALSE.
[in]u32ModeCaptured data transferred by PDMA interrupt type. It could be either
Returns
None

This function is used to enable PDMA transfer of selected channel(s) for PWM capture.

Note
This function can only selects even or odd channel of pairs to do PDMA transfer.

Definition at line 462 of file pwm.c.

◆ PWM_EnablePeriodInt()

void PWM_EnablePeriodInt ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32IntPeriodType 
)

Enable period interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32IntPeriodTypePeriod interrupt type. This parameter is not used.
Returns
None

This function is used to enable period interrupt of selected channel.

Definition at line 722 of file pwm.c.

◆ PWM_EnableSyncNoiseFilter()

void PWM_EnableSyncNoiseFilter ( PWM_T pwm,
uint32_t  u32ClkCnt,
uint32_t  u32ClkDivSel 
)

Enable PWM SYNC_IN noise filter function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ClkCntSYNC Edge Detector Filter Count. This controls the counter number of edge detector. The valid value is 0~7.
[in]u32ClkDivSelSYNC Edge Detector Filter Clock Selection.
Returns
None

This function is used to enable PWM SYNC_IN noise filter function.

Definition at line 1091 of file pwm.c.

◆ PWM_EnableSyncPhase()

void PWM_EnableSyncPhase ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Enable SYNC phase of selected channel(s)

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1...
Returns
None

This function is used to enable SYNC phase of selected channel(s).

Note
Every two channels share the same setting.

Definition at line 1037 of file pwm.c.

◆ PWM_EnableSyncPinInverse()

void PWM_EnableSyncPinInverse ( PWM_T pwm)

Enable PWM SYNC input pin inverse function.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
Returns
None

This function is used to enable PWM SYNC input pin inverse function.

Definition at line 1118 of file pwm.c.

◆ PWM_EnableZeroInt()

void PWM_EnableZeroInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Enable zero interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
None

This function is used to enable zero interrupt of selected channel.

Definition at line 780 of file pwm.c.

◆ PWM_ForceStop()

void PWM_ForceStop ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Stop PWM generation immediately by clear channel enable bit.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1...
Returns
None

This function is used to stop PWM generation immediately by clear channel enable bit.

Definition at line 211 of file pwm.c.

◆ PWM_GetAccInt()

uint32_t PWM_GetAccInt ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get interrupt flag accumulator interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Return values
0Accumulator interrupt did not occur
1Accumulator interrupt occurred

This function is used to Get interrupt flag accumulator interrupt of selected channel.

Note
Every two channels share the same setting.

Definition at line 926 of file pwm.c.

◆ PWM_GetADCTriggerFlag()

uint32_t PWM_GetADCTriggerFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get selected channel trigger EADC flag.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Return values
0The specified channel trigger EADC to start of conversion flag is not set
1The specified channel trigger EADC to start of conversion flag is set

This function is used to get PWM trigger EADC to start of conversion flag for specified channel.

Definition at line 302 of file pwm.c.

◆ PWM_GetCaptureIntFlag()

uint32_t PWM_GetCaptureIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get capture interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Return values
0No capture interrupt
1Rising edge latch interrupt
2Falling edge latch interrupt
3Rising and falling latch interrupt

This function is used to get capture interrupt of selected channel.

Definition at line 583 of file pwm.c.

◆ PWM_GetDutyIntFlag()

uint32_t PWM_GetDutyIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get duty interrupt flag of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
Duty interrupt flag of specified channel
Return values
0Duty interrupt did not occur
1Duty interrupt occurred

This function is used to get duty interrupt flag of selected channel.

Definition at line 644 of file pwm.c.

◆ PWM_GetFaultBrakeIntFlag()

uint32_t PWM_GetFaultBrakeIntFlag ( PWM_T pwm,
uint32_t  u32BrakeSource 
)

This function get fault brake interrupt flag of selected source.

Parameters
[in]pwmThe pointer of the specified PWM module
[in]u32BrakeSourceFault brake source, could be either
Returns
Fault brake interrupt flag of specified source
Return values
0Fault brake interrupt did not occurred
1Fault brake interrupt occurred

This function is used to get fault brake interrupt flag of selected source.

Definition at line 707 of file pwm.c.

◆ PWM_GetFTDutyIntFlag()

uint32_t PWM_GetFTDutyIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get free trigger duty interrupt flag of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
Duty interrupt flag of specified channel
Return values
0Free trigger duty interrupt did not occur
1Free trigger duty interrupt occurred

This function is used to get free trigger duty interrupt flag of selected channel.

Definition at line 956 of file pwm.c.

◆ PWM_GetPeriodIntFlag()

uint32_t PWM_GetPeriodIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get period interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
Period interrupt flag of specified channel
Return values
0Period interrupt did not occur
1Period interrupt occurred

This function is used to get period interrupt of selected channel.

Definition at line 766 of file pwm.c.

◆ PWM_GetWrapAroundFlag()

uint32_t PWM_GetWrapAroundFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get the time-base counter reached its maximum value flag of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
Count to max interrupt flag of specified channel
Return values
0Count to max interrupt did not occur
1Count to max interrupt occurred

This function is used to get the time-base counter reached its maximum value flag of selected channel.

Definition at line 1251 of file pwm.c.

◆ PWM_GetZeroIntFlag()

uint32_t PWM_GetZeroIntFlag ( PWM_T pwm,
uint32_t  u32ChannelNum 
)

Get zero interrupt of selected channel.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
Returns
Zero interrupt flag of specified channel
Return values
0Zero interrupt did not occur
1Zero interrupt occurred

This function is used to get zero interrupt of selected channel.

Definition at line 824 of file pwm.c.

◆ PWM_SetBrakePinSource()

void PWM_SetBrakePinSource ( PWM_T pwm,
uint32_t  u32BrakePinNum,
uint32_t  u32SelAnotherModule 
)

Set PWM brake pin source.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32BrakePinNumBrake pin selection. Valid values are 0 or 1.
[in]u32SelAnotherModuleSelect to another module. Valid values are TRUE or FALSE.
Returns
None

This function is used to set PWM brake pin source.

Definition at line 1235 of file pwm.c.

◆ PWM_SetClockSource()

void PWM_SetClockSource ( PWM_T pwm,
uint32_t  u32ChannelNum,
uint32_t  u32ClkSrcSel 
)

Set PWM clock source.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelNumPWM channel number. Valid values are between 0~5
[in]u32ClkSrcSelPWM external clock source.
Returns
None

This function is used to set PWM clock source.

Note
Every two channels share the same setting.

Definition at line 1152 of file pwm.c.

◆ PWM_Start()

void PWM_Start ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Start PWM module.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1...
Returns
None

This function is used to start PWM module.

Definition at line 174 of file pwm.c.

◆ PWM_Stop()

void PWM_Stop ( PWM_T pwm,
uint32_t  u32ChannelMask 
)

Stop PWM module.

Parameters
[in]pwmThe pointer of the specified PWM module
  • PWM0 : PWM Group 0
  • PWM1 : PWM Group 1
[in]u32ChannelMaskCombination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1...
Returns
None

This function is used to stop PWM module.

Definition at line 189 of file pwm.c.