2.90 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 |
---|---|
PWM_Initialize | Initializes PWM Peripheral with the given configuration |
PWM_Deinitialize | Deinitializes the PWM to its Power-On Reset (POR) state |
PWM_GeneratorEnable | Enables the specific PWM generator |
PWM_GeneratorDisable | Disables the specific PWM generator |
PWM_ModeSet | Sets the operating mode for a specific PWM generator |
PWM_OutputModeSet | Configures the output mode of a specific PWM generator |
PWM_Enable | Enables all PWM generators |
PWM_Disable | Disables all PWM generators |
PWM_MasterPeriodSet | Sets the period value for the Master Time Base generator |
PWM_MasterDutyCycleSet | Sets the PWM master duty cycle register |
PWM_MasterPhaseSet | Sets the phase value for the Master Time Base generator |
PWM_PeriodSet | Sets the period for a specific PWM generator's Time Base |
PWM_DutyCycleSet | Sets the duty cycle for a specific PWM generator |
PWM_PhaseSelect | Selects the PWM generator source for Phase |
PWM_PhaseSet | Sets the phase value in count for the PWM generator specific Time Base |
PWM_OverrideDataSet | Updates PWM override data bits with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_OverrideDataHighSet | Updates PWM override high data bit with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_OverrideDataLowSet | Updates PWM override low data bit with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_OverrideDataGet | Gets PWM override value for the PWM Generator selected by the argument PWM_GENERATOR |
PWM_OverrideHighEnable | Enables PWM override on PWMH output for specific PWM generator selected by the argument PWM_GENERATOR. |
PWM_OverrideLowEnable | Enables PWM override on PWML output for specific PWM generator selected by the argument PWM_GENERATOR |
PWM_OverrideHighDisable | Disables PWM override on PWMH output for specific PWM generator selected by the argument PWM_GENERATOR |
PWM_OverrideLowDisable | Disables PWM override on PWML output for specific PWM generator selected by the argument PWM_GENERATOR |
PWM_DeadTimeLowSet | Updates PWM Deadtime low register with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_DeadTimeHighSet | Updates PWM Deadtime high register with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_DeadTimeSet | Updates PWM Deadtime low and high register with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_TriggerCompareValueSet | Sets the PWM trigger compare value in count for the PWM Generator selected by the argument PWM_GENERATOR |
PWM_GeneratorInterruptEnable | Enables interrupt requests for the PWM Generator selected by the argument PWM_GENERATOR |
PWM_GeneratorInterruptDisable | Disables interrupt requests for the PWM Generator selected by the argument PWM_GENERATOR |
PWM_GeneratorEventStatusGet | Gets the PWM interrupt status for the PWM Generator selected by the argument PWM_GENERATOR |
PWM_GeneratorEventStatusClear | Clears the PWM interrupt status for the PWM Generator selected by the argument PWM_GENERATOR |
PWM_SoftwareUpdateRequest | Requests to update the data registers for specific PWM generator selected by the argument PWM_GENERATOR |
PWM_SoftwareUpdatePending | Gets the status of the update request for specific PWM generator selected by the argument PWM_GENERATOR |
PWM_TriggerACompareValueSet | Sets the Trigger A compare value in count for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_TriggerBCompareValueSet | Sets the Trigger B compare value in count for a specific PWM generator selected by the argument PWM_GENERATOR |
PWM_TriggerCCompareValueSet | Sets the Trigger C compare value in count for a specific PWM generator selected by the argument PWM_GENERATOR |
Data types and constants
Name | Type | Description |
---|---|---|
PWM_GENERATOR | Enum | Defines the PWM generators that are selected from the MCC Harmony User Interface for the PWM output controls |
PWM_GENERATOR_INTERRUPT | Enum | Defines the PWM generator interrupts that are available for the module to use |
PWM_TRIGGER_COMPARE | Enum |
Defines the PWM generator Trigger Compare registers that are available for the module to use |
PWM_MODES | Enum | Defines the PWM generator operating modes that are available |
PWM_OUTPUT_MODES | Enum | Defines the PWM generator output modes that are available |
PWM_SOURCE_SELECT | Enum | Defines the PWM generator Master or Independent source selection |
PWM_GENERATOR_EOC_EVENT_CALLBACK | Typedef | Callback function type for PWM generator End of Conversion (EOC) event |
PWM_GENERATOR_EOC_EVENT_CALLBACK_OBJ | Struct | Holds the callback and context information for handling events on a specified PWM Generator |
Note: Not all APIs maybe implemented. See the specific device
family section for available APIs.