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

NameDescription
PWM_InitializeInitializes PWM Peripheral with the given configuration
PWM_DeinitializeDeinitializes the PWM to its Power-On Reset (POR) state
PWM_GeneratorEnableEnables the specific PWM generator
PWM_GeneratorDisableDisables the specific PWM generator
PWM_ModeSetSets the operating mode for a specific PWM generator
PWM_OutputModeSetConfigures the output mode of a specific PWM generator
PWM_EnableEnables all PWM generators
PWM_DisableDisables all PWM generators
PWM_MasterPeriodSetSets the period value for the Master Time Base generator
PWM_MasterDutyCycleSetSets the PWM master duty cycle register
PWM_MasterPhaseSet Sets the phase value for the Master Time Base generator
PWM_PeriodSetSets the period for a specific PWM generator's Time Base
PWM_DutyCycleSetSets the duty cycle for a specific PWM generator
PWM_PhaseSelectSelects the PWM generator source for Phase
PWM_PhaseSetSets the phase value in count for the PWM generator specific Time Base
PWM_OverrideDataSetUpdates PWM override data bits with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_OverrideDataHighSetUpdates PWM override high data bit with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_OverrideDataLowSetUpdates PWM override low data bit with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_OverrideDataGetGets PWM override value for the PWM Generator selected by the argument PWM_GENERATOR
PWM_OverrideHighEnableEnables PWM override on PWMH output for specific PWM generator selected by the argument PWM_GENERATOR.
PWM_OverrideLowEnableEnables PWM override on PWML output for specific PWM generator selected by the argument PWM_GENERATOR
PWM_OverrideHighDisableDisables PWM override on PWMH output for specific PWM generator selected by the argument PWM_GENERATOR
PWM_OverrideLowDisableDisables PWM override on PWML output for specific PWM generator selected by the argument PWM_GENERATOR
PWM_DeadTimeLowSetUpdates PWM Deadtime low register with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_DeadTimeHighSetUpdates PWM Deadtime high register with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_DeadTimeSetUpdates PWM Deadtime low and high register with the requested value for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_TriggerCompareValueSetSets the PWM trigger compare value in count for the PWM Generator selected by the argument PWM_GENERATOR
PWM_GeneratorInterruptEnableEnables interrupt requests for the PWM Generator selected by the argument PWM_GENERATOR
PWM_GeneratorInterruptDisableDisables interrupt requests for the PWM Generator selected by the argument PWM_GENERATOR
PWM_GeneratorEventStatusGetGets the PWM interrupt status for the PWM Generator selected by the argument PWM_GENERATOR
PWM_GeneratorEventStatusClearClears the PWM interrupt status for the PWM Generator selected by the argument PWM_GENERATOR
PWM_SoftwareUpdateRequestRequests to update the data registers for specific PWM generator selected by the argument PWM_GENERATOR
PWM_SoftwareUpdatePendingGets the status of the update request for specific PWM generator selected by the argument PWM_GENERATOR
PWM_TriggerACompareValueSetSets the Trigger A compare value in count for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_TriggerBCompareValueSetSets the Trigger B compare value in count for a specific PWM generator selected by the argument PWM_GENERATOR
PWM_TriggerCCompareValueSetSets the Trigger C compare value in count for a specific PWM generator selected by the argument PWM_GENERATOR

Data types and constants

NameTypeDescription
PWM_GENERATOREnumDefines the PWM generators that are selected from the MCC Harmony User Interface for the PWM output controls
PWM_GENERATOR_INTERRUPTEnumDefines the PWM generator interrupts that are available for the module to use
PWM_TRIGGER_COMPAREEnum

Defines the PWM generator Trigger Compare registers that are available for the module to use

PWM_MODESEnumDefines the PWM generator operating modes that are available
PWM_OUTPUT_MODESEnumDefines the PWM generator output modes that are available
PWM_SOURCE_SELECTEnumDefines the PWM generator Master or Independent source selection
PWM_GENERATOR_EOC_EVENT_CALLBACKTypedefCallback function type for PWM generator End of Conversion (EOC) event
PWM_GENERATOR_EOC_EVENT_CALLBACK_OBJStructHolds 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.