| MINI55_BSP V3.03.000 The Board Support Package for Mini55 Series MCU

Macros | Functions
PWM Exported Functions
MINI55 Device Driver » PWM Driver » PWM Exported Constants
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_SYNC_MODE(pwm)
| This macro enable synchronous mode. More...
#define | PWM_DISABLE_SYNC_MODE(pwm)
| This macro disable synchronous mode, and enable independent mode. More...
#define | PWM_ENABLE_OUTPUT_INVERTER(pwm, u32ChannelMask)
| This macro enable output inverter of specified channel(s) More...
#define | PWM_SET_PRESCALER(pwm, u32ChannelNum, u32Prescaler)
| This macro set the prescaler of the selected channel. More...
#define | PWM_SET_DIVIDER(pwm, u32ChannelNum, u32Divider)
| This macro set the divider of the selected channel. More...
#define | PWM_SET_CMR(pwm, u32ChannelNum, u32CMR)
| This macro set the duty 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...

## Functions
uint32_t | PWM_ConfigOutputChannel (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle)
| This function config PWM generator and get the nearest frequency in edge aligned auto-reload mode. More...
void | PWM_Start (PWM_T *pwm, uint32_t u32ChannelMask)
| This function start PWM module. More...
void | PWM_Stop (PWM_T *pwm, uint32_t u32ChannelMask)
| This function stop PWM module. More...
void | PWM_ForceStop (PWM_T *pwm, uint32_t u32ChannelMask)
| This function stop PWM generation immediately by clear channel enable bit. More...
void | PWM_EnableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition)
| This function enable selected channel to trigger ADC. More...
void | PWM_DisableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum)
| This function disable selected channel to trigger ADC. More...
void | PWM_ClearADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition)
| This function clear selected channel trigger ADC flag. More...
uint32_t | PWM_GetADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition)
| This function get selected channel trigger ADC flag. More...
void | PWM_EnableFaultBrake (PWM_T *pwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource)
| This function enable fault brake of selected channels. More...
void | PWM_ClearFaultBrakeFlag (PWM_T *pwm, uint32_t u32BrakeSource)
| This function clear fault brake flag. More...
void | PWM_EnableOutput (PWM_T *pwm, uint32_t u32ChannelMask)
| This function enables PWM output generation of selected channels. More...
void | PWM_DisableOutput (PWM_T *pwm, uint32_t u32ChannelMask)
| This function disables PWM output generation of selected channels. More...
void | PWM_EnableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Duration)
| This function enable Dead zone of selected channel. More...
void | PWM_DisableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum)
| This function disable Dead zone of selected channel. More...
void | PWM_EnableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType)
| This function enable duty interrupt of selected channel. More...
void | PWM_DisableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum)
| This function disable duty interrupt of selected channel. More...
void | PWM_ClearDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function clears duty interrupt flag of selected channel. More...
uint32_t | PWM_GetDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function 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 of selected source. More...
void | PWM_EnablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum)
| This function enable Period interrupt of selected channel. More...
void | PWM_DisablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum)
| This function disable Period interrupt of selected channel. More...
void | PWM_ClearPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function clears Period interrupt flag of selected channel. More...
uint32_t | PWM_GetPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function get Period interrupt flag of selected channel. More...
void | PWM_EnableCenterInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType)
| This function enable Central interrupt of selected channel. More...
void | PWM_DisableCenterInt (PWM_T *pwm, uint32_t u32ChannelNum)
| This function disable Central interrupt of selected channel. More...
void | PWM_ClearCenterIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function clear Central interrupt of selected channel. More...
uint32_t | PWM_GetCenterIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function get Central interrupt of selected channel. More...
void | PWM_EnableRiseInt (PWM_T *pwm, uint32_t u32ChannelNum)
| This function enable Rise interrupt of selected channel. More...
void | PWM_DisableRiseInt (PWM_T *pwm, uint32_t u32ChannelNum)
| This function disable Rise interrupt of selected channel. More...
void | PWM_ClearRiseIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function clears Rise interrupt flag of selected channel. More...
uint32_t | PWM_GetRiseIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
| This function get Rise interrupt flag of selected channel. More...

## Detailed Description

## Macro Definition Documentation

## ◆ PWM_DISABLE_COMPLEMENTARY_MODE

#define PWM_DISABLE_COMPLEMENTARY_MODE | ( |  | pwm | ) |

This macro disable complementary mode, and enable independent mode.

Parameters

  [in] | pwm | The base address of PWM module

Returns
  None

Definition at line 80 of file pwm.h.

## ◆ PWM_DISABLE_GROUP_MODE

#define PWM_DISABLE_GROUP_MODE | ( |  | pwm | ) |

This macro disable group mode.

Parameters

  [in] | pwm | The base address of PWM module

Returns
  None

Definition at line 96 of file pwm.h.

## ◆ PWM_DISABLE_SYNC_MODE

#define PWM_DISABLE_SYNC_MODE | ( |  | pwm | ) |

This macro disable synchronous mode, and enable independent mode.

Parameters

  [in] | pwm | The base address of PWM module

Returns
  None

Definition at line 112 of file pwm.h.

## ◆ PWM_ENABLE_COMPLEMENTARY_MODE

#define PWM_ENABLE_COMPLEMENTARY_MODE | ( |  | pwm | ) |

This macro enable complementary mode.

Parameters

  [in] | pwm | The base address of PWM module

Returns
  None

Definition at line 72 of file pwm.h.

## ◆ PWM_ENABLE_GROUP_MODE

#define PWM_ENABLE_GROUP_MODE | ( |  | pwm | ) |

This macro enable group mode.

Parameters

  [in] | pwm | The base address of PWM module

Returns
  None

Definition at line 88 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] | pwm | The base address of PWM module
  [in] | u32ChannelMask | Combination of enabled channels. Each bit corresponds to a channel Bit 0 represents channel 0, bit 1 represents channel 1...

Returns
  None

Definition at line 122 of file pwm.h.

## ◆ PWM_ENABLE_SYNC_MODE

#define PWM_ENABLE_SYNC_MODE | ( |  | pwm | ) |

This macro enable synchronous mode.

Parameters

  [in] | pwm | The base address of PWM module

Returns
  None

Definition at line 104 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] | pwm | The base address of PWM module
  [in] | u32ChannelMask | This parameter is not used
  [in] | u32AlignedType | PWM aligned type, valid values are: PWM_EDGE_ALIGNED PWM_CENTER_ALIGNED

Returns
  None

Definition at line 194 of file pwm.h.

## ◆ PWM_SET_CMR

#define PWM_SET_CMR | ( |  | pwm,
|  |  | u32ChannelNum,
|  |  | u32CMR
| ) |  |

This macro set the duty of the selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32CMR | Duty of specified channel. Valid values are between 0~0xFFFF

Returns
  None

Note
  This new setting will take effect on next PWM period

Definition at line 170 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] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32CNR | Period of specified channel. Valid values are between 0~0xFFFF

Returns
  None

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

Definition at line 182 of file pwm.h.

## ◆ PWM_SET_DIVIDER

#define PWM_SET_DIVIDER | ( |  | pwm,
|  |  | u32ChannelNum,
|  |  | u32Divider
| ) |  |

This macro set the divider of the selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32Divider | Clock divider of specified channel. Valid values are PWM_CLK_DIV_1 PWM_CLK_DIV_2 PWM_CLK_DIV_4 PWM_CLK_DIV_8 PWM_CLK_DIV_16

Returns
  None

Definition at line 158 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] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32Prescaler | Clock prescaler of specified channel. Valid values are between 1 ~ 0xFF

Returns
  None

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 142 of file pwm.h.

## Function Documentation

## ◆ PWM_ClearADCTriggerFlag()

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

This function clear selected channel trigger ADC flag.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32Condition | PWM triggered ADC flag to be cleared. A combination of following flags: PWM_TRIGGER_ADC_CNTR_IS_0 PWM_TRIGGER_ADC_CNTR_IS_CMR_D PWM_TRIGGER_ADC_CNTR_IS_CNR PWM_TRIGGER_ADC_CNTR_IS_CMR_U

Returns
  None

Definition at line 230 of file pwm.c.

## ◆ PWM_ClearCenterIntFlag()

void PWM_ClearCenterIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function clear Central interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 572 of file pwm.c.

## ◆ PWM_ClearDutyIntFlag()

void PWM_ClearDutyIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function clears duty interrupt flag of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 380 of file pwm.c.

## ◆ PWM_ClearFaultBrakeFlag()

void PWM_ClearFaultBrakeFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32BrakeSource
| ) |  |

This function clear fault brake flag.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32BrakeSource | This parameter is not used

Returns
  None

Note
  After fault brake occurred, application must clear fault brake source before re-enable PWM output

Definition at line 290 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] | pwm | The base address of PWM module
  [in] | u32BrakeSource | Fault brake source, could be either PWM_INTSTS_BRKIF0_Msk, or PWM_INTSTS_BRKIF1_Msk

Returns
  None

Definition at line 520 of file pwm.c.

## ◆ PWM_ClearPeriodIntFlag()

void PWM_ClearPeriodIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function clears Period interrupt flag of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 426 of file pwm.c.

## ◆ PWM_ClearRiseIntFlag()

void PWM_ClearRiseIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function clears Rise interrupt flag of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 472 of file pwm.c.

## ◆ PWM_ConfigOutputChannel()

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

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

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32Frequency | Target generator frequency
  [in] | u32DutyCycle | Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%, and so on.

Returns
  Nearest frequency clock in nano second

Note
  Since every two channels, (0 & 1), (2 & 3), (4 & 5), shares a prescaler. Call this API to configure PWM frequency may affect existing frequency of other channel.

Definition at line 37 of file pwm.c.

## ◆ PWM_DisableADCTrigger()

void PWM_DisableADCTrigger | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function disable selected channel to trigger ADC.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 201 of file pwm.c.

## ◆ PWM_DisableCenterInt()

void PWM_DisableCenterInt | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function disable Central interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 561 of file pwm.c.

## ◆ PWM_DisableDeadZone()

void PWM_DisableDeadZone | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function disable Dead zone of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 343 of file pwm.c.

## ◆ PWM_DisableDutyInt()

void PWM_DisableDutyInt | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function disable duty interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 369 of file pwm.c.

## ◆ PWM_DisableFaultBrakeInt()

void PWM_DisableFaultBrakeInt | ( | PWM_T * | pwm,
|  | uint32_t | u32BrakeSource
| ) |  |

This function disable fault brake interrupt.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32BrakeSource | This parameter is not used

Returns
  None

Definition at line 507 of file pwm.c.

## ◆ PWM_DisableOutput()

void PWM_DisableOutput | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelMask
| ) |  |

This function disables PWM output generation of selected channels.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelMask | Combination 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, and so on.

Returns
  None

Definition at line 314 of file pwm.c.

## ◆ PWM_DisablePeriodInt()

void PWM_DisablePeriodInt | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function disable Period interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 415 of file pwm.c.

## ◆ PWM_DisableRiseInt()

void PWM_DisableRiseInt | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function disable Rise interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 461 of file pwm.c.

## ◆ PWM_EnableADCTrigger()

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

This function enable selected channel to trigger ADC.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32Condition | The condition to trigger ADC. Combination of following conditions: PWM_TRIGGER_ADC_CNTR_IS_0 PWM_TRIGGER_ADC_CNTR_IS_CMR_D PWM_TRIGGER_ADC_CNTR_IS_CNR PWM_TRIGGER_ADC_CNTR_IS_CMR_U

Returns
  None

Definition at line 176 of file pwm.c.

## ◆ PWM_EnableCenterInt()

void PWM_EnableCenterInt | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum,
|  | uint32_t | u32IntPeriodType
| ) |  |

This function enable Central interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32IntPeriodType | Period interrupt type, could be either PWM_PERIOD_INT_UNDERFLOW PWM_PERIOD_INT_MATCH_CNR

Returns
  None

Note
  All channels share the same Central interrupt type setting.

Definition at line 550 of file pwm.c.

## ◆ PWM_EnableDeadZone()

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

This function enable Dead zone of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32Duration | Dead Zone length in PWM clock count, valid values are between 0~0xFF, but 0 means there is no dead zone.

Returns
  None

Definition at line 327 of file pwm.c.

## ◆ PWM_EnableDutyInt()

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

This function enable duty interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32IntDutyType | This parameter is not used

Returns
  None

Definition at line 358 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 channels.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelMask | This parameter is not used
  [in] | u32LevelMask | Output high or low while fault brake occurs, each bit represent the level of a channel while fault brake occur. Bit 0 represents channel 0, bit 1 represents channel 1, and so on. , bit 6 represent D6, and bit 7 represents D7
  [in] | u32BrakeSource | Fault brake source, could be one of following source PWM_FB0_EINT0 PWM_FB0_ACMP1 PWM_FB1_EINT1 PWM_FB1_ACMP0

Returns
  None

Definition at line 275 of file pwm.c.

## ◆ PWM_EnableFaultBrakeInt()

void PWM_EnableFaultBrakeInt | ( | PWM_T * | pwm,
|  | uint32_t | u32BrakeSource
| ) |  |

This function enable fault brake interrupt.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32BrakeSource | This parameter is not used

Returns
  None

Definition at line 496 of file pwm.c.

## ◆ PWM_EnableOutput()

void PWM_EnableOutput | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelMask
| ) |  |

This function enables PWM output generation of selected channels.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelMask | Combination 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, and so on.

Returns
  None

Definition at line 302 of file pwm.c.

## ◆ PWM_EnablePeriodInt()

void PWM_EnablePeriodInt | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function enable Period interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 404 of file pwm.c.

## ◆ PWM_EnableRiseInt()

void PWM_EnableRiseInt | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function enable Rise interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  None

Definition at line 450 of file pwm.c.

## ◆ PWM_ForceStop()

void PWM_ForceStop | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelMask
| ) |  |

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

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelMask | Combination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1, and so on.

Returns
  None

Definition at line 151 of file pwm.c.

## ◆ PWM_GetADCTriggerFlag()

uint32_t PWM_GetADCTriggerFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum,
|  | uint32_t | u32Condition
| ) |  |

This function get selected channel trigger ADC flag.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5
  [in] | u32Condition | PWM triggered ADC flag to be selected.

Returns
  Get status of the selected channel trigger ADC

Definition at line 249 of file pwm.c.

## ◆ PWM_GetCenterIntFlag()

uint32_t PWM_GetCenterIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function get Central interrupt of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  Central interrupt flag of specified channel

Return values

  0 | Central interrupt did not occurred
  1 | Central interrupt occurred

Definition at line 585 of file pwm.c.

## ◆ PWM_GetDutyIntFlag()

uint32_t PWM_GetDutyIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function get duty interrupt flag of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  Duty interrupt flag of specified channel

Return values

  0 | Duty interrupt did not occurred
  1 | Duty interrupt occurred

Definition at line 393 of file pwm.c.

## ◆ PWM_GetFaultBrakeIntFlag()

uint32_t PWM_GetFaultBrakeIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32BrakeSource
| ) |  |

This function get fault brake interrupt of selected source.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32BrakeSource | Fault brake source, could be either PWM_INTSTS_BRKIF0_Msk, or PWM_INTSTS_BRKIF1_Msk

Returns
  Fault brake interrupt flag of specified source

Return values

  0 | Fault brake interrupt did not occurred
  1 | Fault brake interrupt occurred

Definition at line 535 of file pwm.c.

## ◆ PWM_GetPeriodIntFlag()

uint32_t PWM_GetPeriodIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function get Period interrupt flag of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  Period interrupt flag of specified channel

Return values

  0 | Period interrupt did not occurred
  1 | Period interrupt occurred

Definition at line 439 of file pwm.c.

## ◆ PWM_GetRiseIntFlag()

uint32_t PWM_GetRiseIntFlag | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelNum
| ) |  |

This function get Rise interrupt flag of selected channel.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelNum | PWM channel number. Valid values are between 0~5

Returns
  Rise interrupt flag of specified channel

Return values

  0 | Rise interrupt did not occurred
  1 | Rise interrupt occurred

Definition at line 485 of file pwm.c.

## ◆ PWM_Start()

void PWM_Start | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelMask
| ) |  |

This function start PWM module.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelMask | Combination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1, and so on.

Returns
  None

Definition at line 110 of file pwm.c.

## ◆ PWM_Stop()

void PWM_Stop | ( | PWM_T * | pwm,
|  | uint32_t | u32ChannelMask
| ) |  |

This function stop PWM module.

Parameters

  [in] | pwm | The base address of PWM module
  [in] | u32ChannelMask | Combination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1, and so on.

Returns
  None

Definition at line 131 of file pwm.c.