RTEMS 6.1-rc2
Loading...
Searching...
No Matches
Data Structures | Functions
Pwm_driver

Data Structures

struct  _pwm_signal_param
 Structure for the user to define the PWM signal characteristics. More...
 
struct  _pwm_config
 PWM config structure. More...
 
struct  _pwm_fault_input_filter_param
 Structure for the user to configure the fault input filter. More...
 
struct  _pwm_fault_param
 Structure is used to hold the parameters to configure a PWM fault. More...
 
struct  _pwm_input_capture_param
 Structure is used to hold parameters to configure the capture capability of a signal pin. More...
 

Functions

void PWM_SetupInputCapture (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, const pwm_input_capture_param_t *inputCaptureParams)
 Sets up the PWM input capture.
 
void PWM_SetupFaultInputFilter (PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams)
 Sets up the PWM fault input filter.
 
void PWM_SetupFaults (PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams)
 Sets up the PWM fault protection.
 
void PWM_FaultDefaultConfig (pwm_fault_param_t *config)
 Fill in the PWM fault config struct with the default settings.
 
void PWM_SetupForceSignal (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, pwm_force_signal_t mode)
 Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted.
 
uint8_t PWM_GetPwmChannelState (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel)
 Get the dutycycle value.
 
status_t PWM_SetOutputToIdle (PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus)
 Set PWM output in idle status (high or low).
 
void PWM_SetClockMode (PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler)
 Set the pwm submodule prescaler.
 
void PWM_SetPwmForceOutputToZero (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool forcetozero)
 This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0.
 
void PWM_SetChannelOutput (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, pwm_output_state_t outputstate)
 This function set the output state of the PWM pin as requested for the current cycle.
 

Driver version

enum  _pwm_submodule { kPWM_Module_0 = 0U , kPWM_Module_1 , kPWM_Module_2 , kPWM_Module_3 }
 List of PWM submodules. More...
 
enum  _pwm_channels { kPWM_PwmB = 0U , kPWM_PwmA , kPWM_PwmX }
 List of PWM channels in each module.
 
enum  _pwm_value_register {
  kPWM_ValueRegister_0 = 0U , kPWM_ValueRegister_1 , kPWM_ValueRegister_2 , kPWM_ValueRegister_3 ,
  kPWM_ValueRegister_4 , kPWM_ValueRegister_5
}
 List of PWM value registers. More...
 
enum  _pwm_value_register_mask {
  kPWM_ValueRegisterMask_0 = (1U << 0) , kPWM_ValueRegisterMask_1 = (1U << 1) , kPWM_ValueRegisterMask_2 = (1U << 2) , kPWM_ValueRegisterMask_3 = (1U << 3) ,
  kPWM_ValueRegisterMask_4 = (1U << 4) , kPWM_ValueRegisterMask_5 = (1U << 5)
}
 List of PWM value registers mask. More...
 
enum  _pwm_clock_source { kPWM_BusClock = 0U , kPWM_ExternalClock , kPWM_Submodule0Clock }
 PWM clock source selection. More...
 
enum  _pwm_clock_prescale {
  kPWM_Prescale_Divide_1 = 0U , kPWM_Prescale_Divide_2 , kPWM_Prescale_Divide_4 , kPWM_Prescale_Divide_8 ,
  kPWM_Prescale_Divide_16 , kPWM_Prescale_Divide_32 , kPWM_Prescale_Divide_64 , kPWM_Prescale_Divide_128
}
 PWM prescaler factor selection for clock source. More...
 
enum  _pwm_force_output_trigger {
  kPWM_Force_Local = 0U , kPWM_Force_Master , kPWM_Force_LocalReload , kPWM_Force_MasterReload ,
  kPWM_Force_LocalSync , kPWM_Force_MasterSync , kPWM_Force_External , kPWM_Force_ExternalSync
}
 Options that can trigger a PWM FORCE_OUT. More...
 
enum  _pwm_output_state {
  kPWM_HighState = 0 , kPWM_LowState , kPWM_NormalState , kPWM_InvertState ,
  kPWM_MaskState
}
 PWM channel output status. More...
 
enum  _pwm_init_source { kPWM_Initialize_LocalSync = 0U , kPWM_Initialize_MasterReload , kPWM_Initialize_MasterSync , kPWM_Initialize_ExtSync }
 PWM counter initialization options. More...
 
enum  _pwm_load_frequency {
  kPWM_LoadEveryOportunity = 0U , kPWM_LoadEvery2Oportunity , kPWM_LoadEvery3Oportunity , kPWM_LoadEvery4Oportunity ,
  kPWM_LoadEvery5Oportunity , kPWM_LoadEvery6Oportunity , kPWM_LoadEvery7Oportunity , kPWM_LoadEvery8Oportunity ,
  kPWM_LoadEvery9Oportunity , kPWM_LoadEvery10Oportunity , kPWM_LoadEvery11Oportunity , kPWM_LoadEvery12Oportunity ,
  kPWM_LoadEvery13Oportunity , kPWM_LoadEvery14Oportunity , kPWM_LoadEvery15Oportunity , kPWM_LoadEvery16Oportunity
}
 PWM load frequency selection. More...
 
enum  _pwm_fault_input { kPWM_Fault_0 = 0U , kPWM_Fault_1 , kPWM_Fault_2 , kPWM_Fault_3 }
 List of PWM fault selections. More...
 
enum  _pwm_fault_disable { kPWM_FaultDisable_0 = (1U << 0) , kPWM_FaultDisable_1 = (1U << 1) , kPWM_FaultDisable_2 = (1U << 2) , kPWM_FaultDisable_3 = (1U << 3) }
 List of PWM fault disable mapping selections. More...
 
enum  _pwm_fault_channels { kPWM_faultchannel_0 = 0U , kPWM_faultchannel_1 }
 List of PWM fault channels.
 
enum  _pwm_input_capture_edge { kPWM_Disable = 0U , kPWM_FallingEdge , kPWM_RisingEdge , kPWM_RiseAndFallEdge }
 PWM capture edge select. More...
 
enum  _pwm_force_signal { kPWM_UsePwm = 0U , kPWM_InvertedPwm , kPWM_SoftwareControl , kPWM_UseExternal }
 PWM output options when a FORCE_OUT signal is asserted. More...
 
enum  _pwm_chnl_pair_operation { kPWM_Independent = 0U , kPWM_ComplementaryPwmA , kPWM_ComplementaryPwmB }
 Options available for the PWM A & B pair operation. More...
 
enum  _pwm_register_reload { kPWM_ReloadImmediate = 0U , kPWM_ReloadPwmHalfCycle , kPWM_ReloadPwmFullCycle , kPWM_ReloadPwmHalfAndFullCycle }
 Options available on how to load the buffered-registers with new values. More...
 
enum  _pwm_fault_recovery_mode { kPWM_NoRecovery = 0U , kPWM_RecoverHalfCycle , kPWM_RecoverFullCycle , kPWM_RecoverHalfAndFullCycle }
 Options available on how to re-enable the PWM output when recovering from a fault. More...
 
enum  _pwm_interrupt_enable {
  kPWM_CompareVal0InterruptEnable = (1U << 0) , kPWM_CompareVal1InterruptEnable = (1U << 1) , kPWM_CompareVal2InterruptEnable = (1U << 2) , kPWM_CompareVal3InterruptEnable = (1U << 3) ,
  kPWM_CompareVal4InterruptEnable = (1U << 4) , kPWM_CompareVal5InterruptEnable = (1U << 5) , kPWM_CaptureX0InterruptEnable = (1U << 6) , kPWM_CaptureX1InterruptEnable = (1U << 7) ,
  kPWM_CaptureB0InterruptEnable = (1U << 8) , kPWM_CaptureB1InterruptEnable = (1U << 9) , kPWM_CaptureA0InterruptEnable = (1U << 10) , kPWM_CaptureA1InterruptEnable = (1U << 11) ,
  kPWM_ReloadInterruptEnable = (1U << 12) , kPWM_ReloadErrorInterruptEnable = (1U << 13) , kPWM_Fault0InterruptEnable = (1U << 16) , kPWM_Fault1InterruptEnable = (1U << 17) ,
  kPWM_Fault2InterruptEnable = (1U << 18) , kPWM_Fault3InterruptEnable = (1U << 19)
}
 List of PWM interrupt options. More...
 
enum  _pwm_status_flags {
  kPWM_CompareVal0Flag = (1U << 0) , kPWM_CompareVal1Flag = (1U << 1) , kPWM_CompareVal2Flag = (1U << 2) , kPWM_CompareVal3Flag = (1U << 3) ,
  kPWM_CompareVal4Flag = (1U << 4) , kPWM_CompareVal5Flag = (1U << 5) , kPWM_CaptureX0Flag = (1U << 6) , kPWM_CaptureX1Flag = (1U << 7) ,
  kPWM_CaptureB0Flag = (1U << 8) , kPWM_CaptureB1Flag = (1U << 9) , kPWM_CaptureA0Flag = (1U << 10) , kPWM_CaptureA1Flag = (1U << 11) ,
  kPWM_ReloadFlag = (1U << 12) , kPWM_ReloadErrorFlag = (1U << 13) , kPWM_RegUpdatedFlag = (1U << 14) , kPWM_Fault0Flag = (1U << 16) ,
  kPWM_Fault1Flag = (1U << 17) , kPWM_Fault2Flag = (1U << 18) , kPWM_Fault3Flag = (1U << 19)
}
 List of PWM status flags. More...
 
enum  _pwm_dma_enable {
  kPWM_CaptureX0DMAEnable = (1U << 0) , kPWM_CaptureX1DMAEnable = (1U << 1) , kPWM_CaptureB0DMAEnable = (1U << 2) , kPWM_CaptureB1DMAEnable = (1U << 3) ,
  kPWM_CaptureA0DMAEnable = (1U << 4) , kPWM_CaptureA1DMAEnable = (1U << 5)
}
 List of PWM DMA options. More...
 
enum  _pwm_dma_source_select { kPWM_DMARequestDisable = 0U , kPWM_DMAWatermarksEnable , kPWM_DMALocalSync , kPWM_DMALocalReload }
 List of PWM capture DMA enable source select. More...
 
enum  _pwm_watermark_control { kPWM_FIFOWatermarksOR = 0U , kPWM_FIFOWatermarksAND }
 PWM FIFO Watermark AND Control. More...
 
enum  _pwm_mode { kPWM_SignedCenterAligned = 0U , kPWM_CenterAligned , kPWM_SignedEdgeAligned , kPWM_EdgeAligned }
 PWM operation mode. More...
 
enum  _pwm_level_select { kPWM_HighTrue = 0U , kPWM_LowTrue }
 PWM output pulse mode, high-true or low-true. More...
 
enum  _pwm_fault_state { kPWM_PwmFaultState0 , kPWM_PwmFaultState1 , kPWM_PwmFaultState2 , kPWM_PwmFaultState3 }
 PWM output fault status. More...
 
enum  _pwm_reload_source_select { kPWM_LocalReload = 0U , kPWM_MasterReload }
 PWM reload source select. More...
 
enum  _pwm_fault_clear { kPWM_Automatic = 0U , kPWM_ManualNormal , kPWM_ManualSafety }
 PWM fault clearing options. More...
 
enum  _pwm_module_control { kPWM_Control_Module_0 = (1U << 0) , kPWM_Control_Module_1 = (1U << 1) , kPWM_Control_Module_2 = (1U << 2) , kPWM_Control_Module_3 = (1U << 3) }
 Options for submodule master control operation. More...
 
typedef enum _pwm_submodule pwm_submodule_t
 List of PWM submodules.
 
typedef enum _pwm_channels pwm_channels_t
 List of PWM channels in each module.
 
typedef enum _pwm_value_register pwm_value_register_t
 List of PWM value registers.
 
typedef enum _pwm_clock_source pwm_clock_source_t
 PWM clock source selection.
 
typedef enum _pwm_clock_prescale pwm_clock_prescale_t
 PWM prescaler factor selection for clock source.
 
typedef enum _pwm_force_output_trigger pwm_force_output_trigger_t
 Options that can trigger a PWM FORCE_OUT.
 
typedef enum _pwm_output_state pwm_output_state_t
 PWM channel output status.
 
typedef enum _pwm_init_source pwm_init_source_t
 PWM counter initialization options.
 
typedef enum _pwm_load_frequency pwm_load_frequency_t
 PWM load frequency selection.
 
typedef enum _pwm_fault_input pwm_fault_input_t
 List of PWM fault selections.
 
typedef enum _pwm_fault_disable pwm_fault_disable_t
 List of PWM fault disable mapping selections.
 
typedef enum _pwm_fault_channels pwm_fault_channels_t
 List of PWM fault channels.
 
typedef enum _pwm_input_capture_edge pwm_input_capture_edge_t
 PWM capture edge select.
 
typedef enum _pwm_force_signal pwm_force_signal_t
 PWM output options when a FORCE_OUT signal is asserted.
 
typedef enum _pwm_chnl_pair_operation pwm_chnl_pair_operation_t
 Options available for the PWM A & B pair operation.
 
typedef enum _pwm_register_reload pwm_register_reload_t
 Options available on how to load the buffered-registers with new values.
 
typedef enum _pwm_fault_recovery_mode pwm_fault_recovery_mode_t
 Options available on how to re-enable the PWM output when recovering from a fault.
 
typedef enum _pwm_interrupt_enable pwm_interrupt_enable_t
 List of PWM interrupt options.
 
typedef enum _pwm_status_flags pwm_status_flags_t
 List of PWM status flags.
 
typedef enum _pwm_dma_enable pwm_dma_enable_t
 List of PWM DMA options.
 
typedef enum _pwm_dma_source_select pwm_dma_source_select_t
 List of PWM capture DMA enable source select.
 
typedef enum _pwm_watermark_control pwm_watermark_control_t
 PWM FIFO Watermark AND Control.
 
typedef enum _pwm_mode pwm_mode_t
 PWM operation mode.
 
typedef enum _pwm_level_select pwm_level_select_t
 PWM output pulse mode, high-true or low-true.
 
typedef enum _pwm_fault_state pwm_fault_state_t
 PWM output fault status.
 
typedef enum _pwm_reload_source_select pwm_reload_source_select_t
 PWM reload source select.
 
typedef enum _pwm_fault_clear pwm_fault_clear_t
 PWM fault clearing options.
 
typedef enum _pwm_module_control pwm_module_control_t
 Options for submodule master control operation.
 
typedef struct _pwm_signal_param pwm_signal_param_t
 Structure for the user to define the PWM signal characteristics.
 
typedef struct _pwm_config pwm_config_t
 PWM config structure.
 
typedef struct _pwm_fault_input_filter_param pwm_fault_input_filter_param_t
 Structure for the user to configure the fault input filter.
 
typedef struct _pwm_fault_param pwm_fault_param_t
 Structure is used to hold the parameters to configure a PWM fault.
 
typedef struct _pwm_input_capture_param pwm_input_capture_param_t
 Structure is used to hold parameters to configure the capture capability of a signal pin.
 
#define FSL_PWM_DRIVER_VERSION   (MAKE_VERSION(2, 5, 1))
 
#define PWM_SUBMODULE_SWCONTROL_WIDTH   2
 
#define PWM_SUBMODULE_CHANNEL   2
 

Initialization and deinitialization

status_t PWM_Init (PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config)
 Ungates the PWM submodule clock and configures the peripheral for basic operation.
 
void PWM_Deinit (PWM_Type *base, pwm_submodule_t subModule)
 Gate the PWM submodule clock.
 
void PWM_GetDefaultConfig (pwm_config_t *config)
 Fill in the PWM config struct with the default settings.
 

Module PWM output

status_t PWM_SetupPwm (PWM_Type *base, pwm_submodule_t subModule, const pwm_signal_param_t *chnlParams, uint8_t numOfChnls, pwm_mode_t mode, uint32_t pwmFreq_Hz, uint32_t srcClock_Hz)
 Sets up the PWM signals for a PWM submodule.
 
status_t PWM_SetupPwmPhaseShift (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, uint32_t pwmFreq_Hz, uint32_t srcClock_Hz, uint8_t shiftvalue, bool doSync)
 Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle..
 
void PWM_UpdatePwmDutycycle (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint8_t dutyCyclePercent)
 Updates the PWM signal's dutycycle.
 
void PWM_UpdatePwmDutycycleHighAccuracy (PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle)
 Updates the PWM signal's dutycycle with 16-bit accuracy.
 

Interrupts Interface

void PWM_EnableInterrupts (PWM_Type *base, pwm_submodule_t subModule, uint32_t mask)
 Enables the selected PWM interrupts.
 
void PWM_DisableInterrupts (PWM_Type *base, pwm_submodule_t subModule, uint32_t mask)
 Disables the selected PWM interrupts.
 
uint32_t PWM_GetEnabledInterrupts (PWM_Type *base, pwm_submodule_t subModule)
 Gets the enabled PWM interrupts.
 

Status Interface

uint32_t PWM_GetStatusFlags (PWM_Type *base, pwm_submodule_t subModule)
 Gets the PWM status flags.
 
void PWM_ClearStatusFlags (PWM_Type *base, pwm_submodule_t subModule, uint32_t mask)
 Clears the PWM status flags.
 

Detailed Description

Macro Definition Documentation

◆ FSL_PWM_DRIVER_VERSION

#define FSL_PWM_DRIVER_VERSION   (MAKE_VERSION(2, 5, 1))

Version 2.5.1

◆ PWM_SUBMODULE_CHANNEL

#define PWM_SUBMODULE_CHANNEL   2

Because setting the pwm duty cycle doesn't support PWMX, getting the pwm duty cycle also doesn't support PWMX.

◆ PWM_SUBMODULE_SWCONTROL_WIDTH

#define PWM_SUBMODULE_SWCONTROL_WIDTH   2

Number of bits per submodule for software output control

Typedef Documentation

◆ pwm_config_t

typedef struct _pwm_config pwm_config_t

PWM config structure.

This structure holds the configuration settings for the PWM peripheral. To initialize this structure to reasonable defaults, call the PWM_GetDefaultConfig() function and pass a pointer to your config structure instance.

The config struct can be made const so it resides in flash

Enumeration Type Documentation

◆ _pwm_chnl_pair_operation

Options available for the PWM A & B pair operation.

Enumerator
kPWM_Independent 

PWM A & PWM B operate as 2 independent channels

kPWM_ComplementaryPwmA 

PWM A & PWM B are complementary channels, PWM A generates the signal

kPWM_ComplementaryPwmB 

PWM A & PWM B are complementary channels, PWM B generates the signal

◆ _pwm_clock_prescale

PWM prescaler factor selection for clock source.

Enumerator
kPWM_Prescale_Divide_1 

PWM clock frequency = fclk/1

kPWM_Prescale_Divide_2 

PWM clock frequency = fclk/2

kPWM_Prescale_Divide_4 

PWM clock frequency = fclk/4

kPWM_Prescale_Divide_8 

PWM clock frequency = fclk/8

kPWM_Prescale_Divide_16 

PWM clock frequency = fclk/16

kPWM_Prescale_Divide_32 

PWM clock frequency = fclk/32

kPWM_Prescale_Divide_64 

PWM clock frequency = fclk/64

kPWM_Prescale_Divide_128 

PWM clock frequency = fclk/128

◆ _pwm_clock_source

PWM clock source selection.

Enumerator
kPWM_BusClock 

The IPBus clock is used as the clock

kPWM_ExternalClock 

EXT_CLK is used as the clock

kPWM_Submodule0Clock 

Clock of the submodule 0 (AUX_CLK) is used as the source clock

◆ _pwm_dma_enable

List of PWM DMA options.

Enumerator
kPWM_CaptureX0DMAEnable 

PWM capture X0 DMA

kPWM_CaptureX1DMAEnable 

PWM capture X1 DMA

kPWM_CaptureB0DMAEnable 

PWM capture B0 DMA

kPWM_CaptureB1DMAEnable 

PWM capture B1 DMA

kPWM_CaptureA0DMAEnable 

PWM capture A0 DMA

kPWM_CaptureA1DMAEnable 

PWM capture A1 DMA

◆ _pwm_dma_source_select

List of PWM capture DMA enable source select.

Enumerator
kPWM_DMARequestDisable 

Read DMA requests disabled

kPWM_DMAWatermarksEnable 

Exceeding a FIFO watermark sets the DMA read request

kPWM_DMALocalSync 

A local sync (VAL1 matches counter) sets the read DMA request

kPWM_DMALocalReload 

A local reload (STS[RF] being set) sets the read DMA request

◆ _pwm_fault_clear

PWM fault clearing options.

Enumerator
kPWM_Automatic 

Automatic fault clearing

kPWM_ManualNormal 

Manual fault clearing with no fault safety mode

kPWM_ManualSafety 

Manual fault clearing with fault safety mode

◆ _pwm_fault_disable

List of PWM fault disable mapping selections.

Enumerator
kPWM_FaultDisable_0 

Fault 0 disable mapping

kPWM_FaultDisable_1 

Fault 1 disable mapping

kPWM_FaultDisable_2 

Fault 2 disable mapping

kPWM_FaultDisable_3 

Fault 3 disable mapping

◆ _pwm_fault_input

List of PWM fault selections.

Enumerator
kPWM_Fault_0 

Fault 0 input pin

kPWM_Fault_1 

Fault 1 input pin

kPWM_Fault_2 

Fault 2 input pin

kPWM_Fault_3 

Fault 3 input pin

◆ _pwm_fault_recovery_mode

Options available on how to re-enable the PWM output when recovering from a fault.

Enumerator
kPWM_NoRecovery 

PWM output will stay inactive

kPWM_RecoverHalfCycle 

PWM output re-enabled at the first half cycle

kPWM_RecoverFullCycle 

PWM output re-enabled at the first full cycle

kPWM_RecoverHalfAndFullCycle 

PWM output re-enabled at the first half or full cycle

◆ _pwm_fault_state

PWM output fault status.

Enumerator
kPWM_PwmFaultState0 

Output is forced to logic 0 state prior to consideration of output polarity control.

kPWM_PwmFaultState1 

Output is forced to logic 1 state prior to consideration of output polarity control.

kPWM_PwmFaultState2 

Output is tristated.

kPWM_PwmFaultState3 

Output is tristated.

◆ _pwm_force_output_trigger

Options that can trigger a PWM FORCE_OUT.

Enumerator
kPWM_Force_Local 

The local force signal, CTRL2[FORCE], from the submodule is used to force updates

kPWM_Force_Master 

The master force signal from submodule 0 is used to force updates

kPWM_Force_LocalReload 

The local reload signal from this submodule is used to force updates without regard to the state of LDOK

kPWM_Force_MasterReload 

The master reload signal from submodule 0 is used to force updates if LDOK is set

kPWM_Force_LocalSync 

The local sync signal from this submodule is used to force updates

kPWM_Force_MasterSync 

The master sync signal from submodule0 is used to force updates

kPWM_Force_External 

The external force signal, EXT_FORCE, from outside the PWM module causes updates

kPWM_Force_ExternalSync 

The external sync signal, EXT_SYNC, from outside the PWM module causes updates

◆ _pwm_force_signal

PWM output options when a FORCE_OUT signal is asserted.

Enumerator
kPWM_UsePwm 

Generated PWM signal is used by the deadtime logic.

kPWM_InvertedPwm 

Inverted PWM signal is used by the deadtime logic.

kPWM_SoftwareControl 

Software controlled value is used by the deadtime logic.

kPWM_UseExternal 

PWM_EXTA signal is used by the deadtime logic.

◆ _pwm_init_source

PWM counter initialization options.

Enumerator
kPWM_Initialize_LocalSync 

Local sync causes initialization

kPWM_Initialize_MasterReload 

Master reload from submodule 0 causes initialization

kPWM_Initialize_MasterSync 

Master sync from submodule 0 causes initialization

kPWM_Initialize_ExtSync 

EXT_SYNC causes initialization

◆ _pwm_input_capture_edge

PWM capture edge select.

Enumerator
kPWM_Disable 

Disabled

kPWM_FallingEdge 

Capture on falling edge only

kPWM_RisingEdge 

Capture on rising edge only

kPWM_RiseAndFallEdge 

Capture on rising or falling edge

◆ _pwm_interrupt_enable

List of PWM interrupt options.

Enumerator
kPWM_CompareVal0InterruptEnable 

PWM VAL0 compare interrupt

kPWM_CompareVal1InterruptEnable 

PWM VAL1 compare interrupt

kPWM_CompareVal2InterruptEnable 

PWM VAL2 compare interrupt

kPWM_CompareVal3InterruptEnable 

PWM VAL3 compare interrupt

kPWM_CompareVal4InterruptEnable 

PWM VAL4 compare interrupt

kPWM_CompareVal5InterruptEnable 

PWM VAL5 compare interrupt

kPWM_CaptureX0InterruptEnable 

PWM capture X0 interrupt

kPWM_CaptureX1InterruptEnable 

PWM capture X1 interrupt

kPWM_CaptureB0InterruptEnable 

PWM capture B0 interrupt

kPWM_CaptureB1InterruptEnable 

PWM capture B1 interrupt

kPWM_CaptureA0InterruptEnable 

PWM capture A0 interrupt

kPWM_CaptureA1InterruptEnable 

PWM capture A1 interrupt

kPWM_ReloadInterruptEnable 

PWM reload interrupt

kPWM_ReloadErrorInterruptEnable 

PWM reload error interrupt

kPWM_Fault0InterruptEnable 

PWM fault 0 interrupt

kPWM_Fault1InterruptEnable 

PWM fault 1 interrupt

kPWM_Fault2InterruptEnable 

PWM fault 2 interrupt

kPWM_Fault3InterruptEnable 

PWM fault 3 interrupt

◆ _pwm_level_select

PWM output pulse mode, high-true or low-true.

Enumerator
kPWM_HighTrue 

High level represents "on" or "active" state

kPWM_LowTrue 

Low level represents "on" or "active" state

◆ _pwm_load_frequency

PWM load frequency selection.

Enumerator
kPWM_LoadEveryOportunity 

Every PWM opportunity

kPWM_LoadEvery2Oportunity 

Every 2 PWM opportunities

kPWM_LoadEvery3Oportunity 

Every 3 PWM opportunities

kPWM_LoadEvery4Oportunity 

Every 4 PWM opportunities

kPWM_LoadEvery5Oportunity 

Every 5 PWM opportunities

kPWM_LoadEvery6Oportunity 

Every 6 PWM opportunities

kPWM_LoadEvery7Oportunity 

Every 7 PWM opportunities

kPWM_LoadEvery8Oportunity 

Every 8 PWM opportunities

kPWM_LoadEvery9Oportunity 

Every 9 PWM opportunities

kPWM_LoadEvery10Oportunity 

Every 10 PWM opportunities

kPWM_LoadEvery11Oportunity 

Every 11 PWM opportunities

kPWM_LoadEvery12Oportunity 

Every 12 PWM opportunities

kPWM_LoadEvery13Oportunity 

Every 13 PWM opportunities

kPWM_LoadEvery14Oportunity 

Every 14 PWM opportunities

kPWM_LoadEvery15Oportunity 

Every 15 PWM opportunities

kPWM_LoadEvery16Oportunity 

Every 16 PWM opportunities

◆ _pwm_mode

enum _pwm_mode

PWM operation mode.

Enumerator
kPWM_SignedCenterAligned 

Signed center-aligned

kPWM_CenterAligned 

Unsigned cente-aligned

kPWM_SignedEdgeAligned 

Signed edge-aligned

kPWM_EdgeAligned 

Unsigned edge-aligned

◆ _pwm_module_control

Options for submodule master control operation.

Enumerator
kPWM_Control_Module_0 

Control submodule 0's start/stop,buffer reload operation

kPWM_Control_Module_1 

Control submodule 1's start/stop,buffer reload operation

kPWM_Control_Module_2 

Control submodule 2's start/stop,buffer reload operation

kPWM_Control_Module_3 

Control submodule 3's start/stop,buffer reload operation

◆ _pwm_output_state

PWM channel output status.

Enumerator
kPWM_HighState 

The output state of PWM channel is high

kPWM_LowState 

The output state of PWM channel is low

kPWM_NormalState 

The output state of PWM channel is normal

kPWM_InvertState 

The output state of PWM channel is invert

kPWM_MaskState 

The output state of PWM channel is mask

◆ _pwm_register_reload

Options available on how to load the buffered-registers with new values.

Enumerator
kPWM_ReloadImmediate 

Buffered-registers get loaded with new values as soon as LDOK bit is set

kPWM_ReloadPwmHalfCycle 

Registers loaded on a PWM half cycle

kPWM_ReloadPwmFullCycle 

Registers loaded on a PWM full cycle

kPWM_ReloadPwmHalfAndFullCycle 

Registers loaded on a PWM half & full cycle

◆ _pwm_reload_source_select

PWM reload source select.

Enumerator
kPWM_LocalReload 

The local reload signal is used to reload registers

kPWM_MasterReload 

The master reload signal (from submodule 0) is used to reload

◆ _pwm_status_flags

List of PWM status flags.

Enumerator
kPWM_CompareVal0Flag 

PWM VAL0 compare flag

kPWM_CompareVal1Flag 

PWM VAL1 compare flag

kPWM_CompareVal2Flag 

PWM VAL2 compare flag

kPWM_CompareVal3Flag 

PWM VAL3 compare flag

kPWM_CompareVal4Flag 

PWM VAL4 compare flag

kPWM_CompareVal5Flag 

PWM VAL5 compare flag

kPWM_CaptureX0Flag 

PWM capture X0 flag

kPWM_CaptureX1Flag 

PWM capture X1 flag

kPWM_CaptureB0Flag 

PWM capture B0 flag

kPWM_CaptureB1Flag 

PWM capture B1 flag

kPWM_CaptureA0Flag 

PWM capture A0 flag

kPWM_CaptureA1Flag 

PWM capture A1 flag

kPWM_ReloadFlag 

PWM reload flag

kPWM_ReloadErrorFlag 

PWM reload error flag

kPWM_RegUpdatedFlag 

PWM registers updated flag

kPWM_Fault0Flag 

PWM fault 0 flag

kPWM_Fault1Flag 

PWM fault 1 flag

kPWM_Fault2Flag 

PWM fault 2 flag

kPWM_Fault3Flag 

PWM fault 3 flag

◆ _pwm_submodule

List of PWM submodules.

Enumerator
kPWM_Module_0 

Submodule 0

kPWM_Module_1 

Submodule 1

kPWM_Module_2 

Submodule 2

kPWM_Module_3 

Submodule 3

◆ _pwm_value_register

List of PWM value registers.

Enumerator
kPWM_ValueRegister_0 

PWM Value0 register

kPWM_ValueRegister_1 

PWM Value1 register

kPWM_ValueRegister_2 

PWM Value2 register

kPWM_ValueRegister_3 

PWM Value3 register

kPWM_ValueRegister_4 

PWM Value4 register

kPWM_ValueRegister_5 

PWM Value5 register

◆ _pwm_value_register_mask

List of PWM value registers mask.

Enumerator
kPWM_ValueRegisterMask_0 

PWM Value0 register mask

kPWM_ValueRegisterMask_1 

PWM Value1 register mask

kPWM_ValueRegisterMask_2 

PWM Value2 register mask

kPWM_ValueRegisterMask_3 

PWM Value3 register mask

kPWM_ValueRegisterMask_4 

PWM Value4 register mask

kPWM_ValueRegisterMask_5 

PWM Value5 register mask

◆ _pwm_watermark_control

PWM FIFO Watermark AND Control.

Enumerator
kPWM_FIFOWatermarksOR 

Selected FIFO watermarks are OR'ed together

kPWM_FIFOWatermarksAND 

Selected FIFO watermarks are AND'ed together

Function Documentation

◆ PWM_ClearStatusFlags()

void PWM_ClearStatusFlags ( PWM_Type base,
pwm_submodule_t  subModule,
uint32_t  mask 
)

Clears the PWM status flags.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
maskThe status flags to clear. This is a logical OR of members of the enumeration pwm_status_flags_t

brief Clears the PWM status flags

param base PWM peripheral base address param subModule PWM submodule to configure param mask The status flags to clear. This is a logical OR of members of the enumeration pwm_status_flags_t

◆ PWM_Deinit()

void PWM_Deinit ( PWM_Type base,
pwm_submodule_t  subModule 
)

Gate the PWM submodule clock.

Parameters
basePWM peripheral base address
subModulePWM submodule to deinitialize

brief Gate the PWM submodule clock

param base PWM peripheral base address param subModule PWM submodule to deinitialize

◆ PWM_DisableInterrupts()

void PWM_DisableInterrupts ( PWM_Type base,
pwm_submodule_t  subModule,
uint32_t  mask 
)

Disables the selected PWM interrupts.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
maskThe interrupts to enable. This is a logical OR of members of the enumeration pwm_interrupt_enable_t

brief Disables the selected PWM interrupts

param base PWM peripheral base address param subModule PWM submodule to configure param mask The interrupts to enable. This is a logical OR of members of the enumeration pwm_interrupt_enable_t

◆ PWM_EnableInterrupts()

void PWM_EnableInterrupts ( PWM_Type base,
pwm_submodule_t  subModule,
uint32_t  mask 
)

Enables the selected PWM interrupts.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
maskThe interrupts to enable. This is a logical OR of members of the enumeration pwm_interrupt_enable_t

brief Enables the selected PWM interrupts

param base PWM peripheral base address param subModule PWM submodule to configure param mask The interrupts to enable. This is a logical OR of members of the enumeration pwm_interrupt_enable_t

◆ PWM_FaultDefaultConfig()

void PWM_FaultDefaultConfig ( pwm_fault_param_t config)

Fill in the PWM fault config struct with the default settings.

The default values are:

config->faultClearingMode = kPWM_Automatic;
config->faultLevel = false;
config->enableCombinationalPath = true;
config->recoverMode = kPWM_NoRecovery;
@ kPWM_NoRecovery
Definition: fsl_pwm.h:208
@ kPWM_Automatic
Definition: fsl_pwm.h:324
Definition: deflate.c:114
Parameters
configPointer to user's PWM fault config structure.

brief Fill in the PWM fault config struct with the default settings

The default values are: code config->faultClearingMode = kPWM_Automatic; config->faultLevel = false; config->enableCombinationalPath = true; config->recoverMode = kPWM_NoRecovery; endcode param config Pointer to user's PWM fault config structure.

◆ PWM_GetDefaultConfig()

void PWM_GetDefaultConfig ( pwm_config_t config)

Fill in the PWM config struct with the default settings.

The default values are:

config->enableDebugMode = false;
config->enableWait = false;
config->reloadSelect = kPWM_LocalReload;
config->clockSource = kPWM_BusClock;
config->initializationControl = kPWM_Initialize_LocalSync;
config->forceTrigger = kPWM_Force_Local;
config->reloadFrequency = kPWM_LoadEveryOportunity;
config->pairOperation = kPWM_Independent;
@ kPWM_LoadEveryOportunity
Definition: fsl_pwm.h:127
@ kPWM_Independent
Definition: fsl_pwm.h:191
@ kPWM_Force_Local
Definition: fsl_pwm.h:94
@ kPWM_Initialize_LocalSync
Definition: fsl_pwm.h:118
@ kPWM_ReloadImmediate
Definition: fsl_pwm.h:199
@ kPWM_Prescale_Divide_1
Definition: fsl_pwm.h:81
@ kPWM_BusClock
Definition: fsl_pwm.h:73
@ kPWM_LocalReload
Definition: fsl_pwm.h:317
Parameters
configPointer to user's PWM config structure.

brief Fill in the PWM config struct with the default settings

The default values are: code config->enableDebugMode = false; config->enableWait = false; config->reloadSelect = kPWM_LocalReload; config->clockSource = kPWM_BusClock; config->prescale = kPWM_Prescale_Divide_1; config->initializationControl = kPWM_Initialize_LocalSync; config->forceTrigger = kPWM_Force_Local; config->reloadFrequency = kPWM_LoadEveryOportunity; config->reloadLogic = kPWM_ReloadImmediate; config->pairOperation = kPWM_Independent; endcode param config Pointer to user's PWM config structure.

◆ PWM_GetEnabledInterrupts()

uint32_t PWM_GetEnabledInterrupts ( PWM_Type base,
pwm_submodule_t  subModule 
)

Gets the enabled PWM interrupts.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
Returns
The enabled interrupts. This is the logical OR of members of the enumeration pwm_interrupt_enable_t

brief Gets the enabled PWM interrupts

param base PWM peripheral base address param subModule PWM submodule to configure

return The enabled interrupts. This is the logical OR of members of the enumeration pwm_interrupt_enable_t

◆ PWM_GetPwmChannelState()

uint8_t PWM_GetPwmChannelState ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmChannel 
)

Get the dutycycle value.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
pwmChannelPWM channel to configure
Returns
Current channel dutycycle value.

brief Get the dutycycle value.

param base PWM peripheral base address param subModule PWM submodule to configure param pwmChannel PWM channel to configure

return Current channel dutycycle value.

◆ PWM_GetStatusFlags()

uint32_t PWM_GetStatusFlags ( PWM_Type base,
pwm_submodule_t  subModule 
)

Gets the PWM status flags.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
Returns
The status flags. This is the logical OR of members of the enumeration pwm_status_flags_t

brief Gets the PWM status flags

param base PWM peripheral base address param subModule PWM submodule to configure

return The status flags. This is the logical OR of members of the enumeration pwm_status_flags_t

◆ PWM_Init()

status_t PWM_Init ( PWM_Type base,
pwm_submodule_t  subModule,
const pwm_config_t config 
)

Ungates the PWM submodule clock and configures the peripheral for basic operation.

Note
This API should be called at the beginning of the application using the PWM driver.
Parameters
basePWM peripheral base address
subModulePWM submodule to configure
configPointer to user's PWM config structure.
Returns
kStatus_Success means success; else failed.

brief Ungates the PWM submodule clock and configures the peripheral for basic operation.

note This API should be called at the beginning of the application using the PWM driver.

param base PWM peripheral base address param subModule PWM submodule to configure param config Pointer to user's PWM config structure.

return kStatus_Success means success; else failed.

◆ PWM_SetChannelOutput()

void PWM_SetChannelOutput ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmChannel,
pwm_output_state_t  outputstate 
)

This function set the output state of the PWM pin as requested for the current cycle.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
pwmChannelPWM channel to configure
outputstateSet pwm output state, see pwm_output_state_t.

brief This function set the output state of the PWM pin as requested for the current cycle.

param base PWM peripheral base address param subModule PWM submodule to configure param pwmChannel PWM channel to configure param outputstate Set pwm output state, see pwm_output_state_t.

◆ PWM_SetClockMode()

void PWM_SetClockMode ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_clock_prescale_t  prescaler 
)

Set the pwm submodule prescaler.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
prescalerSet prescaler value

brief Set the pwm submodule prescaler.

param base PWM peripheral base address param subModule PWM submodule to configure param prescaler Set prescaler value

◆ PWM_SetOutputToIdle()

status_t PWM_SetOutputToIdle ( PWM_Type base,
pwm_channels_t  pwmChannel,
pwm_submodule_t  subModule,
bool  idleStatus 
)

Set PWM output in idle status (high or low).

Note
This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported.
Parameters
basePWM peripheral base address
pwmChannelPWM channel to configure
subModulePWM submodule to configure
idleStatusTrue: PWM output is high in idle status; false: PWM output is low in idle status.
Returns
kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success

brief Set PWM output in idle status (high or low).

note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported.

param base PWM peripheral base address param pwmChannel PWM channel to configure param subModule PWM submodule to configure param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status.

return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success

◆ PWM_SetPwmForceOutputToZero()

void PWM_SetPwmForceOutputToZero ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmChannel,
bool  forcetozero 
)

This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0.

Parameters
basePWM peripheral base address
pwmChannelPWM channel to configure
subModulePWM submodule to configure
forcetozeroTrue: Enable the pwm force output to zero; False: Disable the pwm output resumes normal function.

brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0.

param base PWM peripheral base address param pwmChannel PWM channel to configure param subModule PWM submodule to configure param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal function.

◆ PWM_SetupFaultInputFilter()

void PWM_SetupFaultInputFilter ( PWM_Type base,
const pwm_fault_input_filter_param_t faultInputFilterParams 
)

Sets up the PWM fault input filter.

Parameters
basePWM peripheral base address
faultInputFilterParamsParameters passed in to set up the fault input filter.
Parameters
basePWM peripheral base address
faultInputFilterParamsParameters passed in to set up the fault input filter.

◆ PWM_SetupFaults()

void PWM_SetupFaults ( PWM_Type base,
pwm_fault_input_t  faultNum,
const pwm_fault_param_t faultParams 
)

Sets up the PWM fault protection.

PWM has 4 fault inputs.

Parameters
basePWM peripheral base address
faultNumPWM fault to configure.
faultParamsPointer to the PWM fault config structure

brief Sets up the PWM fault protection.

PWM has 4 fault inputs.

param base PWM peripheral base address param faultNum PWM fault to configure. param faultParams Pointer to the PWM fault config structure

◆ PWM_SetupForceSignal()

void PWM_SetupForceSignal ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmChannel,
pwm_force_signal_t  mode 
)

Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted.

The user specifies which channel to configure by supplying the submodule number and whether to modify PWM A or PWM B within that submodule.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
pwmChannelChannel to configure
modeSignal to output when a FORCE_OUT is triggered

brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted.

The user specifies which channel to configure by supplying the submodule number and whether to modify PWM A or PWM B within that submodule.

param base PWM peripheral base address param subModule PWM submodule to configure param pwmChannel Channel to configure param mode Signal to output when a FORCE_OUT is triggered

◆ PWM_SetupInputCapture()

void PWM_SetupInputCapture ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmChannel,
const pwm_input_capture_param_t inputCaptureParams 
)

Sets up the PWM input capture.

Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function sets up the capture parameters for each pin and enables the pin for input capture operation.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
pwmChannelChannel in the submodule to setup
inputCaptureParamsParameters passed in to set up the input pin

brief Sets up the PWM input capture

Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function sets up the capture parameters for each pin and enables the pin for input capture operation.

param base PWM peripheral base address param subModule PWM submodule to configure param pwmChannel Channel in the submodule to setup param inputCaptureParams Parameters passed in to set up the input pin

◆ PWM_SetupPwm()

status_t PWM_SetupPwm ( PWM_Type base,
pwm_submodule_t  subModule,
const pwm_signal_param_t chnlParams,
uint8_t  numOfChnls,
pwm_mode_t  mode,
uint32_t  pwmFreq_Hz,
uint32_t  srcClock_Hz 
)

Sets up the PWM signals for a PWM submodule.

The function initializes the submodule according to the parameters passed in by the user. The function also sets up the value compare registers to match the PWM signal requirements. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time period specified by the user.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
chnlParamsArray of PWM channel parameters to configure the channel(s), PWMX submodule is not supported.
numOfChnlsNumber of channels to configure, this should be the size of the array passed in. Array size should not be more than 2 as each submodule has 2 pins to output PWM
modePWM operation mode, options available in enumeration pwm_mode_t
pwmFreq_HzPWM signal frequency in Hz
srcClock_HzPWM main counter clock in Hz.
Returns
Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise

brief Sets up the PWM signals for a PWM submodule.

The function initializes the submodule according to the parameters passed in by the user. The function also sets up the value compare registers to match the PWM signal requirements. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time period specified by the user.

param base PWM peripheral base address param subModule PWM submodule to configure param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. param numOfChnls Number of channels to configure, this should be the size of the array passed in. Array size should not be more than 2 as each submodule has 2 pins to output PWM param mode PWM operation mode, options available in enumeration pwm_mode_t param pwmFreq_Hz PWM signal frequency in Hz param srcClock_Hz PWM main counter clock in Hz.

return Returns kStatusFail if there was error setting up the signal; kStatusSuccess otherwise

◆ PWM_SetupPwmPhaseShift()

status_t PWM_SetupPwmPhaseShift ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmChannel,
uint32_t  pwmFreq_Hz,
uint32_t  srcClock_Hz,
uint8_t  shiftvalue,
bool  doSync 
)

Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle..

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
pwmChannelPWM channel to configure
pwmFreq_HzPWM signal frequency in Hz
srcClock_HzPWM main counter clock in Hz.
shiftvaluePhase shift value
doSynctrue: Set LDOK bit for the submodule list; false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update.
Returns
Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise

brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle.

param base PWM peripheral base address param subModule PWM submodule to configure param pwmChannel PWM channel to configure param pwmFreq_Hz PWM signal frequency in Hz param srcClock_Hz PWM main counter clock in Hz. param shiftvalue Phase shift value, range in 0 ~ 50 param doSync true: Set LDOK bit for the submodule list; false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update.

return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise

◆ PWM_UpdatePwmDutycycle()

void PWM_UpdatePwmDutycycle ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmSignal,
pwm_mode_t  currPwmMode,
uint8_t  dutyCyclePercent 
)

Updates the PWM signal's dutycycle.

The function updates the PWM dutycyle to the new value that is passed in. If the dead time insertion logic is enabled then the pulse period is reduced by the dead time period specified by the user.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
pwmSignalSignal (PWM A or PWM B) to update
currPwmModeThe current PWM mode set during PWM setup
dutyCyclePercentNew PWM pulse width, value should be between 0 to 100 0=inactive signal(0% duty cycle)... 100=active signal (100% duty cycle)

brief Updates the PWM signal's dutycycle.

The function updates the PWM dutycyle to the new value that is passed in. If the dead time insertion logic is enabled then the pulse period is reduced by the dead time period specified by the user.

param base PWM peripheral base address param subModule PWM submodule to configure param pwmSignal Signal (PWM A or PWM B) to update param currPwmMode The current PWM mode set during PWM setup param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 0=inactive signal(0% duty cycle)... 100=active signal (100% duty cycle)

◆ PWM_UpdatePwmDutycycleHighAccuracy()

void PWM_UpdatePwmDutycycleHighAccuracy ( PWM_Type base,
pwm_submodule_t  subModule,
pwm_channels_t  pwmSignal,
pwm_mode_t  currPwmMode,
uint16_t  dutyCycle 
)

Updates the PWM signal's dutycycle with 16-bit accuracy.

The function updates the PWM dutycyle to the new value that is passed in. If the dead time insertion logic is enabled then the pulse period is reduced by the dead time period specified by the user.

Parameters
basePWM peripheral base address
subModulePWM submodule to configure
pwmSignalSignal (PWM A or PWM B) to update
currPwmModeThe current PWM mode set during PWM setup
dutyCycleNew PWM pulse width, value should be between 0 to 65535 0=inactive signal(0% duty cycle)... 65535=active signal (100% duty cycle)

brief Updates the PWM signal's dutycycle with 16-bit accuracy.

The function updates the PWM dutycyle to the new value that is passed in. If the dead time insertion logic is enabled then the pulse period is reduced by the dead time period specified by the user.

param base PWM peripheral base address param subModule PWM submodule to configure param pwmSignal Signal (PWM A or PWM B) to update param currPwmMode The current PWM mode set during PWM setup param dutyCycle New PWM pulse width, value should be between 0 to 65535 0=inactive signal(0% duty cycle)... 65535=active signal (100% duty cycle)