2.84 Pulse Width Modulation Controller (PWM)

This Plib implements software abstraction for PWM Peripheral.

Library Interface

Pulse Width Modulation Controller peripheral library provides the following interfaces:

Functions

NameDescription
PWMx_InitializeInitializes given instance of PWM peripheral.
PWMx_InitializeInitializes given instance of PWM peripheral.
PWMx_OffCountGetReturns the off-time period of the PWM signal
PWMx_OffCountSetSets the off-time period of the PWM signal
PWMx_OnCountSetSets the on-time period of the PWM signal
PWMx_OnCountGetReturns the on-time period of the PWM signal
PWMx_OutputConfigSelects the polarity of the PWM output ON state
PWMx_StartEnables and starts PWM peripheral
PWMx_StopDisables PWM peripheral and stops PWM output
PWMx_ClkSelectSelects the clock source for the PWM peripheral
PWMx_ClkDividerSetSelects the divider value for the clock source for the PWM peripheral
PWMx_ChannelsStartStarts the given PWM channels
PWMx_ChannelsStopStops the given PWM channels
PWMx_ChannelPeriodSetSets the period value of given PWM channel
PWMx_ChannelPeriodGetReads the period value of given PWM channel
PWMx_ChannelDutySetWrites the duty cycle value of given PWM channel
PWMx_ChannelDeadTimeSetWrites dead time values of given PWM channel
PWMx_ChannelCounterEventEnableEnables counter event of given channels
PWMx_ChannelCounterEventDisableDisables counter event of given channels
PWMx_ChannelCounterEventStatusGetDisables counter event of given channels
PWMx_CompareValueSetWrites the compare value for given PWM peripheral and given comparison unit
PWMx_SyncUpdateEnableThis sets the synchronous update unlock bit
PWMx_FaultStatusClearThis function clears the status of the given fault id
PWMx_ChannelOverrideEnableThis function overrides the PWM output
PWMx_ChannelOverrideDisableThis function select dead-time output as the PWM output
PWMx_CallbackRegisterRegisters the function to be called from interrupt

Data types and constants

NameTypeDescription
PWM_OUTPUT_ON_STATE_ACTIVE MacroDefines the macros associated with PWM_OUTPUT_ON_STATE_ACTIVE
PWM_CLK_SELMacroDefines the macros associated with PWM_CLK_SEL
PWM_CALLBACKTypedefDefines the data type and function signature for the PWM peripheral callback function
PWM_CHANNEL_NUMEnumIdentifies PWM channel number in a PWM peripheral
PWM_CHANNEL_MASKEnumIdentifies PWM channel mask
PWM_COMPAREEnumIdentifies PWM compare unit
PWM_FAULT_IDEnumIdentifies PWM fault input ids
Note: Not all APIs maybe implemented. See the specific device family section for available APIs.