2.89 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
| Name | Description |
|---|---|
| PWMx_Initialize | Initializes given instance of PWM peripheral. |
| PWMx_Initialize | Initializes given instance of PWM peripheral. |
| PWMx_OffCountGet | Returns the off-time period of the PWM signal |
| PWMx_OffCountSet | Sets the off-time period of the PWM signal |
| PWMx_OnCountSet | Sets the on-time period of the PWM signal |
| PWMx_OnCountGet | Returns the on-time period of the PWM signal |
| PWMx_OutputConfig | Selects the polarity of the PWM output ON state |
| PWMx_Start | Enables and starts PWM peripheral |
| PWMx_Stop | Disables PWM peripheral and stops PWM output |
| PWMx_ClkSelect | Selects the clock source for the PWM peripheral |
| PWMx_ClkDividerSet | Selects the divider value for the clock source for the PWM peripheral |
| PWMx_ChannelsStart | Starts the given PWM channels |
| PWMx_ChannelsStop | Stops the given PWM channels |
| PWMx_ChannelPeriodSet | Sets the period value of given PWM channel |
| PWMx_ChannelPeriodGet | Reads the period value of given PWM channel |
| PWMx_ChannelDutySet | Writes the duty cycle value of given PWM channel |
| PWMx_ChannelDeadTimeSet | Writes dead time values of given PWM channel |
| PWMx_ChannelCounterEventEnable | Enables counter event of given channels |
| PWMx_ChannelCounterEventDisable | Disables counter event of given channels |
| PWMx_ChannelCounterEventStatusGet | Disables counter event of given channels |
| PWMx_CompareValueSet | Writes the compare value for given PWM peripheral and given comparison unit |
| PWMx_SyncUpdateEnable | This sets the synchronous update unlock bit |
| PWMx_FaultStatusClear | This function clears the status of the given fault id |
| PWMx_ChannelOverrideEnable | This function overrides the PWM output |
| PWMx_ChannelOverrideDisable | This function select dead-time output as the PWM output |
| PWMx_CallbackRegister | Registers the function to be called from interrupt |
Data types and constants
| Name | Type | Description |
|---|---|---|
| PWM_OUTPUT_ON_STATE_ACTIVE | Macro | Defines the macros associated with PWM_OUTPUT_ON_STATE_ACTIVE |
| PWM_CLK_SEL | Macro | Defines the macros associated with PWM_CLK_SEL |
| PWM_CALLBACK | Typedef | Defines the data type and function signature for the PWM peripheral callback function |
| PWM_CHANNEL_NUM | Enum | Identifies PWM channel number in a PWM peripheral |
| PWM_CHANNEL_MASK | Enum | Identifies PWM channel mask |
| PWM_COMPARE | Enum | Identifies PWM compare unit |
| PWM_FAULT_ID | Enum | Identifies PWM fault input ids |
Note: Not all APIs maybe implemented. See the
specific device family section for available
APIs.
