MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.
Driver Overview | |
The Driver Change Log | |
The current PWM driver version is 2.0.0. | |
eFlexPWM Peripheral and Driver Overview | |
Content including 1) peripheral features, work logic and work method; 2) driver design logic and use method; 3) typical use case. | |
Data Structures | |
struct | pwm_sm_counter_config_t |
The structure for configuring PWM submodule counter logic. More... | |
struct | pwm_sm_reload_logic_config_t |
The structure for configuring PWM submodule reload logic. More... | |
struct | pwm_sm_value_register_config_t |
The structure for configuring PWM submodule value registers. More... | |
struct | pwm_sm_force_logic_config_t |
The structure for configuring PWM submodule force logic. More... | |
struct | pwm_sm_deadtime_value_t |
The structure of the inserted dead time value, applies only to KPWM_Complementaryxxx mode. More... | |
struct | pwm_sm_deadtime_logic_config_t |
The structure for configuring PWM submodule force out logic, works on the deadtime logic output. More... | |
struct | pwm_sm_fractional_delay_logic_config_t |
The structure for configuring PWM submodule fractional delay logic, works on the deadtime logic output. More... | |
struct | pwm_sm_output_logic_config_t |
The structure for configuring PWM submodule output logic. More... | |
struct | pwm_sm_input_capture_config_t |
The structure for configuring PWM submodule input capture logic. More... | |
struct | pwm_sm_capture_dma_config_t |
The structure for configuring PWM submodule read capture DMA. More... | |
struct | pwm_sm_dma_config_t |
The structure for configuring PWM submodule DMA. More... | |
struct | pwm_sm_fault_input_mapping_t |
The enumeration for PWM submodule output fault enable mask for one fault protection channel. More... | |
struct | pwm_sm_config_t |
PWM submodule config structure. More... | |
struct | pwm_fault_protection_config_t |
The structure for configuring PWM fault protection channel, a PWM module can have multiple fault protection channels, PWM sub-module can choose to mapping any one or more fault input from fault protection channels. More... | |
struct | pwm_config_t |
PWM module config structure which contain submodule config structure pointers and fault protection filter config structure pointers. More... | |
Driver version | |
#define | FSL_PWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
Version 2.0.0. | |
Initialization And De-initialization Interfaces | |
void | PWM_Init (PWM_Type *base, const pwm_config_t *psConfig) |
Initialization PWM module with provided structure pwm_config_t. More... | |
void | PWM_Deinit (PWM_Type *base) |
De-initialization a PWM module. More... | |
void | PWM_GetSMDefaultConfig (pwm_sm_config_t *psConfig) |
Gets an default PWM submodule's configuration. More... | |
void | PWM_GetFaultProtectionDefaultConfig (pwm_fault_protection_config_t *psConfig) |
Gets an default fault protection channel's configuration. More... | |
Submodule PWM Generation Related Interfaces | |
void | PWM_SetupSMConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_config_t *psConfig) |
Sets up the PWM submodule configure. More... | |
static void | PWM_SetupCounterConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_counter_config_t *psConfig) |
Sets up the PWM submodule counter configure. More... | |
static void | PWM_SetCounterInitialValue (PWM_Type *base, pwm_sm_number_t eSubModule, uint16_t u16InitialValue) |
Sets the PWM submodule counter initial register value. More... | |
static void | PWM_SetupReloadLogicConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_reload_logic_config_t *psConfig) |
Sets up the PWM submodule reload logic configure. More... | |
void | PWM_GetValueConfig (pwm_sm_value_register_config_t *psConfig, pwm_sm_typical_output_mode_t eTypicalOutputMode, uint16_t u16PwmPeriod, uint16_t u16PwmAPulseWidth, uint16_t u16PwmBPulseWidth) |
Update PWM submodule compare value configuration according to the typical output mode. More... | |
static void | PWM_SetupValRegisterConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_value_register_config_t *psConfig) |
Sets up the PWM submodule VALn registers logic configure. More... | |
static void | PWM_SetValueRegister (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_val_register_t eRegister, uint16_t u16Value) |
Sets the PWM submodule VALn register value. More... | |
static uint16_t | PWM_GetValueRegister (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_val_register_t eRegister) |
Gets the PWM submodule VALn register value. More... | |
static void | PWM_SetFracvalRegister (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_fracval_register_t eRegister, uint16_t u16Value) |
Sets the PWM submodule fractional value register value. More... | |
static uint16_t | PWM_GetFracvalRegister (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_fracval_register_t eRegister) |
Sets the PWM submodule fractional value register value. More... | |
static void | PWM_SetValueAndFracRegister (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_fracval_register_t eRegister, uint32_t u32Value) |
Set submodule register VALx and its FRAC value with 32bit access. More... | |
static uint32_t | PWM_GetValueAndFracRegister (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_fracval_register_t eRegister) |
Get submodule register VALx and its FRAC value with 32bit access. More... | |
static void | PWM_SetPwmLdok (PWM_Type *base, uint16_t u16Mask) |
Set the PWM LDOK bit on a single or multiple submodules. More... | |
static void | PWM_ClearPwmLdok (PWM_Type *base, uint16_t u16Mask) |
Clear the PWM LDOK bit on a single or multiple submodules. More... | |
static void | PWM_SetupForceLogicConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_force_logic_config_t *psConfig) |
brief Sets up the PWM submodule force logic configure. More... | |
static void | PWM_SetSoftwareForce (PWM_Type *base, pwm_sm_number_t eSubModule) |
Sets up the PWM Sub-Module to trigger a software FORCE_OUT event. More... | |
void | PWM_SetupDeadtimeConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_deadtime_logic_config_t *psConfig) |
Sets up the PWM submodule deadtime logic configure. More... | |
static uint16_t | PWM_GetDeadtimeSampleValue (PWM_Type *base, pwm_sm_number_t eSubModule) |
Get the sampled values of the PWM_X input at the end of each deadtime. More... | |
void | PWM_SetupFractionalDelayConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_fractional_delay_logic_config_t *psConfig) |
Sets up the PWM submodule fractional delay logic configure. More... | |
void | PWM_SetupOutputConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_output_logic_config_t *psConfig) |
Sets up the PWM submodule output logic configure. More... | |
static void | PWM_EnableOutput (PWM_Type *base, uint16_t u16SubModules, pwm_sm_pwm_out_t eOutput) |
Enables the PWM submodule pin output. More... | |
static void | PWM_DisableOutput (PWM_Type *base, uint16_t u16SubModules, pwm_sm_pwm_out_t eOutput) |
Disables the PWM submodule pin output. More... | |
static void | PWM_EnableCombinedOutput (PWM_Type *base, uint16_t u16XSubModules, uint16_t u16ASubModules, uint16_t u16BSubModules) |
Enables the PWM pin combination output. More... | |
static void | PWM_DisableCombinedOutput (PWM_Type *base, uint16_t u16XSubModules, uint16_t u16ASubModules, uint16_t u16BSubModules) |
Disables the PWM pin combination output. More... | |
static void | PWM_MaskOutput (PWM_Type *base, uint16_t u16SubModules, pwm_sm_pwm_out_t eOutput) |
Mask the PWM pin output. More... | |
static void | PWM_UnmaskOutput (PWM_Type *base, uint16_t u16SubModules, pwm_sm_pwm_out_t eOutput) |
Unmask the PWM pin output. More... | |
static void | PWM_MaskCombinedOutput (PWM_Type *base, uint16_t u16XSubModules, uint16_t u16ASubModules, uint16_t u16BSubModules) |
Mask the PWM pin combination output. More... | |
static void | PWM_UnmaskCombinedOutput (PWM_Type *base, uint16_t u16XSubModules, uint16_t u16ASubModules, uint16_t u16BSubModules) |
Unmask the PWM pin combination output. More... | |
static void | PWM_UpdateMask (PWM_Type *base, pwm_sm_number_t eSubModule) |
Update PWM output mask bits immediately with a software command. More... | |
static void | PWM_EnablePwmRunInDebug (PWM_Type *base, pwm_sm_number_t eSubModule, bool bEnable) |
Enables/Disables the PWM submodule continue to run while the chip is in DEBUG mode. More... | |
static void | PWM_EnablePwmRunInWait (PWM_Type *base, pwm_sm_number_t eSubModule, bool bEnable) |
Enables/Disables the PWM submodule continue to run while the chip is in WAIT mode. More... | |
static void | PWM_EnableCounters (PWM_Type *base, uint16_t u16Mask) |
Starts the PWM submodule counter for a single or multiple submodules. More... | |
static void | PWM_DisableCounters (PWM_Type *base, uint16_t u16Mask) |
Stops the PWM counter for a single or multiple submodules. More... | |
Submodule Input Capture Related Interfaces | |
static uint16_t | PWM_GetCaptureValue (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_input_capture_register_t eRegister) |
Reads PWM submodule input capture value register. More... | |
static uint16_t | PWM_GetCaptureValueCycle (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_input_capture_register_t eRegister) |
Reads PWM submodule input capture value cycle register. More... | |
static uint16_t | PWM_GetCaptureEdgeCounterVaule (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_input_capture_pin_t eInputPin) |
Reads the PWM submodule input capture logic edge counter value. More... | |
void | PWM_SetupInputCaptureConfig (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_input_capture_pin_t eInputPin, const pwm_sm_input_capture_config_t *psConfig) |
Sets up the PWM submodule input capture configure. More... | |
static void | PWM_EnableInputCapture (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_input_capture_pin_t eInputPin) |
Enables the PWM submodule input capture operation. More... | |
static void | PWM_DisableInputCapture (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_input_capture_pin_t eInputPin) |
Disables the PWM submodule input capture operation. More... | |
static uint16_t | PWM_GetInputValue (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_input_capture_pin_t eInputPin) |
Get the logic value currently being driven into the PWM inputs. More... | |
Fault Protection Channel Related Interfaces | |
void | PWM_SetupFaultProtectionConfig (PWM_Type *base, pwm_fault_protection_channel_t eFaultProtection, const pwm_fault_protection_config_t *psConfig) |
Sets up the PWM fault protection channel configure. More... | |
static void | PWM_SetupSMFaultInputMapping (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_pwm_out_t ePwmOutput, const pwm_sm_fault_input_mapping_t *psMapping) |
Mapping fault protection channel fault input status to PWM submodule output,. More... | |
DMA Control Interfaces | |
void | PWM_SetupDmaConfig (PWM_Type *base, pwm_sm_number_t eSubModule, const pwm_sm_dma_config_t *psConfig) |
Sets up the PWM submodule DMA configure. More... | |
static void | PWM_SetEnabledCaptureDmaSource (PWM_Type *base, pwm_sm_number_t eSubModule, pwm_sm_capture_dma_source_t eCaptureDmaSource) |
Select the trigger source for enabled capture FIFOs DMA read request. More... | |
Interrupts Interface | |
static void | PWM_EnableSMInterrupts (PWM_Type *base, pwm_sm_number_t eSubModule, uint16_t u16Mask) |
Enables the PWM submodule interrupts according to a provided mask. More... | |
static void | PWM_DisbaleSMInterrupts (PWM_Type *base, pwm_sm_number_t eSubModule, uint16_t u16Mask) |
Disables the PWM submodule interrupts according to a provided mask. More... | |
static void | PWM_EnableFaultInterrupts (PWM_Type *base, pwm_fault_protection_channel_t eFaultProtection, uint16_t u16Mask) |
Enables the PWM fault protection channel interrupt according to a provided mask. More... | |
static void | PWM_DisableFaultInterrupts (PWM_Type *base, pwm_fault_protection_channel_t eFaultProtection, uint16_t u16Mask) |
Disables the PWM fault protection channel interrupt according to a provided mask. More... | |
Status Flag Interfaces | |
static uint16_t | PWM_GetSMStatusFlags (PWM_Type *base, pwm_sm_number_t eSubModule) |
Gets the PWM submodule status flags. More... | |
static void | PWM_ClearSMStatusFlags (PWM_Type *base, pwm_sm_number_t eSubModule, uint16_t u16Mask) |
Clears the PWM submodule status flags. More... | |
static uint16_t | PWM_GetFaultStatusFlags (PWM_Type *base, pwm_fault_protection_channel_t eFaultProtection) |
Enables the PWM fault protection channel interrupt according to a provided mask. More... | |
static void | PWM_ClearFaultStatusFlags (PWM_Type *base, pwm_fault_protection_channel_t eFaultProtection, uint16_t u16Mask) |
Disables the PWM fault protection channel interrupt according to a provided mask. More... | |
struct pwm_sm_counter_config_t |
Data Fields | |
pwm_sm_count_clock_source_t | eCountClockSource: 2U |
Configures PWM submodule counter clock source. More... | |
pwm_sm_count_clock_prescaler_t | eCountClockPrescaler: 3U |
Configures PWM submodule counter clock source prescaler. More... | |
pwm_sm_count_init_source_t | eCountInitSource: 2U |
Configures PWM submodule counter initial source. More... | |
bool | bEnableForceInitial: 1U |
Enable force-controlled initialization. More... | |
uint16_t | u16PhaseDelayValue |
Defines the delay from the master sync signal of submodule 0 to this submodule counter (the unit of delay is the PWM clock cycle), only works when chose kPWM_InitOnMasterSync as initial source. More... | |
pwm_sm_count_clock_source_t pwm_sm_counter_config_t::eCountClockSource |
pwm_sm_count_clock_prescaler_t pwm_sm_counter_config_t::eCountClockPrescaler |
pwm_sm_count_init_source_t pwm_sm_counter_config_t::eCountInitSource |
bool pwm_sm_counter_config_t::bEnableForceInitial |
The assert FORCE_OUT signal can to initialize the counter without regard to the selected initial source.
uint16_t pwm_sm_counter_config_t::u16PhaseDelayValue |
struct pwm_sm_reload_logic_config_t |
Data Fields | |
pwm_sm_reload_signal_select_t | eReloadSignalSelect: 1U |
Configures PWM submodule RELOAD signal source to be local reload signal or master reload signal. More... | |
pwm_sm_local_reload_effect_timing_t | eLoclReloadEffectTime: 1U |
Configures PWM submodule local reload signal effective timing when choose it as RELOAD signal source. More... | |
bool | bEnableFullCycleReloadOportunity: 1U |
Enable generate a reload opportunity on PWM half cycle (count from INIT value to VAL0). More... | |
bool | bEnableHalfCycleReloadOportunity: 1U |
Enable generate a reload opportunity on PWM full cycle (count from INIT value to VAL1). More... | |
pwm_sm_local_reload_oportunity_t | eLocalReloadOportunity: 4U |
Configures PWM submodule reload frequency when using local reload opportunities mode . More... | |
pwm_sm_reload_signal_select_t pwm_sm_reload_logic_config_t::eReloadSignalSelect |
pwm_sm_local_reload_effect_timing_t pwm_sm_reload_logic_config_t::eLoclReloadEffectTime |
bool pwm_sm_reload_logic_config_t::bEnableFullCycleReloadOportunity |
bool pwm_sm_reload_logic_config_t::bEnableHalfCycleReloadOportunity |
pwm_sm_local_reload_oportunity_t pwm_sm_reload_logic_config_t::eLocalReloadOportunity |
struct pwm_sm_value_register_config_t |
Data Fields | |
uint16_t | u16CounterInitialValue |
Configures PWM submodule counter initial value. More... | |
uint16_t | u16ValRegister0 |
Configures PWM submodule value register 0 (VAL0) value. More... | |
uint16_t | u16ValRegister1 |
Configures PWM submodule value register 1 (VAL1) value. More... | |
uint16_t | u16ValRegister2 |
Configures PWM submodule value register 2 (VAL2) value. More... | |
uint16_t | u16ValRegister3 |
Configures PWM submodule value register 3 (VAL3) value. More... | |
uint16_t | u16ValRegister4 |
Configures PWM submodule value register 4 (VAL4) value. More... | |
uint16_t | u16ValRegister5 |
Configures PWM submodule value register 5 (VAL5) value. More... | |
uint16_t pwm_sm_value_register_config_t::u16CounterInitialValue |
uint16_t pwm_sm_value_register_config_t::u16ValRegister0 |
uint16_t pwm_sm_value_register_config_t::u16ValRegister1 |
uint16_t pwm_sm_value_register_config_t::u16ValRegister2 |
uint16_t pwm_sm_value_register_config_t::u16ValRegister3 |
uint16_t pwm_sm_value_register_config_t::u16ValRegister4 |
uint16_t pwm_sm_value_register_config_t::u16ValRegister5 |
struct pwm_sm_force_logic_config_t |
Data Fields | |
uint8_t | bitPWM23OutputInitialVaule: 1U |
Configures PWM submodule compare output x (PwmX) initial value. More... | |
uint8_t | bitPWM45OutputInitialVaule: 1U |
Configures PWM submodule compare output A (PwmA) initial value. More... | |
uint8_t | bitPWMXOutputInitialVaule: 1U |
Configures PWM submodule compare output B (PwmB) initial value. More... | |
pwm_sm_force_signal_select_t | eForceSignalSelect: 3U |
Configures PWM submodule force out select update trigger source. More... | |
pwm_sm_force_software_output_value_t | eSoftOutputFor23: 1U |
Configures PWM submodule force out PwmA value when select software as output source. More... | |
pwm_sm_force_software_output_value_t | eSoftOutputFor45: 1U |
Configures PWM submodule force out PwmB value when select software as output source. More... | |
pwm_sm_force_deadtime_source_t | eForceOutput23: 2U |
Configures the source of Pwm23, which will be force to deadtime logic. More... | |
pwm_sm_force_deadtime_source_t | eForceOutput45: 2U |
Configures the source of Pwm45, which will be force to deadtime logic. More... | |
uint8_t pwm_sm_force_logic_config_t::bitPWM23OutputInitialVaule |
uint8_t pwm_sm_force_logic_config_t::bitPWM45OutputInitialVaule |
uint8_t pwm_sm_force_logic_config_t::bitPWMXOutputInitialVaule |
pwm_sm_force_signal_select_t pwm_sm_force_logic_config_t::eForceSignalSelect |
pwm_sm_force_software_output_value_t pwm_sm_force_logic_config_t::eSoftOutputFor23 |
pwm_sm_force_software_output_value_t pwm_sm_force_logic_config_t::eSoftOutputFor45 |
pwm_sm_force_deadtime_source_t pwm_sm_force_logic_config_t::eForceOutput23 |
pwm_sm_force_deadtime_source_t pwm_sm_force_logic_config_t::eForceOutput45 |
struct pwm_sm_deadtime_value_t |
Data Fields | |
uint16_t | bitsFractionalCycles: 5U |
Specify the fractional cycle added to the number of integer deadtime cycles. More... | |
uint16_t | bitsIntegerCycles: 11U |
Specify the number of integer deadtime cycles. More... | |
uint16_t pwm_sm_deadtime_value_t::bitsFractionalCycles |
In terms of 1/32 IPBus clock cycles, range is 0x0 ~ 0x1F. Only valid when the fractional delays feature is enabled (FRCNTRL[FRAC23_EN] is set when PWM23 is used to generate complementary PWM, or FRCNTRL[FRAC45_EN]) is set when PWM45 is used to generate complementary PWM.
uint16_t pwm_sm_deadtime_value_t::bitsIntegerCycles |
In terms of IPBus clock cycles, range is 0x0 ~ 0x7FF.
struct pwm_sm_deadtime_logic_config_t |
Data Fields | |
pwm_sm_deadtime_logic_mode_t | eMode |
The mode in which Deadtime logic process the force logic output signal. More... | |
pwm_sm_deadtime_value_t | sDeadTimeValue0 |
Control the deadtime during 0 to 1 transitions of the PWM_23 output (assuming normal polarity). More... | |
pwm_sm_deadtime_value_t | sDeadTimeValue1 |
Control the deadtime during 0 to 1 transitions of the PWM_45 output (assuming normal polarity). More... | |
pwm_sm_deadtime_logic_mode_t pwm_sm_deadtime_logic_config_t::eMode |
pwm_sm_deadtime_value_t pwm_sm_deadtime_logic_config_t::sDeadTimeValue0 |
When disable fractional delays, the maximum value is 0x7FF which represents 2047 cycles of IP bus cycles. When enable fractional delays, the maximum value is 0xFFFF which represents 2047 31/32 cycles cycles of IP bus cycles.
pwm_sm_deadtime_value_t pwm_sm_deadtime_logic_config_t::sDeadTimeValue1 |
When disable fractional delays, the maximum value is 0x7FF which represents 2047 cycles of IP bus cycles. When enable fractional delays, the maximum value is 0xFFFF which represents 2047 31/32 cycles cycles of IP bus cycles.
struct pwm_sm_fractional_delay_logic_config_t |
Data Fields | |
uint8_t | bitsFracValue1: 5U |
Configures PWM submodule compare register VAL1 fractional delay value, the unit is 1/32 IP bus clock. More... | |
bool | bEnableVal1FractionalDelay |
Enable the fractional delay feature of bitsFracValue1. More... | |
uint8_t | bitsFracValue2: 5U |
Configures PWM submodule compare register VAL2 fractional delay value, the unit is 1/32 IP bus clock. More... | |
uint8_t | bitsFracValue3: 5U |
Configures PWM submodule compare register VAL3 fractional delay value, the unit is 1/32 IP bus clock. More... | |
bool | bEnableVal23FractionalDelay |
Enable the fractional delay feature of bitsFracValue2 and bitsFracValue3. More... | |
uint8_t | bitsFracValue4: 5U |
Configures PWM submodule compare register VAL4 fractional delay value, the unit is 1/32 IP bus clock. More... | |
uint8_t | bitsFracValue5: 5U |
Configures PWM submodule compare register VAL5 fractional delay value, the unit is 1/32 IP bus clock. More... | |
bool | bEnableVal45FractionalDelay |
Enable the fractional delay feature of bitsFracValue4 and bitsFracValue5. More... | |
uint8_t pwm_sm_fractional_delay_logic_config_t::bitsFracValue1 |
bool pwm_sm_fractional_delay_logic_config_t::bEnableVal1FractionalDelay |
uint8_t pwm_sm_fractional_delay_logic_config_t::bitsFracValue2 |
uint8_t pwm_sm_fractional_delay_logic_config_t::bitsFracValue3 |
bool pwm_sm_fractional_delay_logic_config_t::bEnableVal23FractionalDelay |
uint8_t pwm_sm_fractional_delay_logic_config_t::bitsFracValue4 |
uint8_t pwm_sm_fractional_delay_logic_config_t::bitsFracValue5 |
bool pwm_sm_fractional_delay_logic_config_t::bEnableVal45FractionalDelay |
struct pwm_sm_output_logic_config_t |
Data Fields | |
bool | bVal0TriggerEnable: 1U |
Enable VAL0 register compare event trigger. More... | |
bool | bVal1TriggerEnable: 1U |
Enable VAL1 register compare event trigger. More... | |
bool | bVal2TriggerEnable: 1U |
Enable VAL2 register compare event trigger. More... | |
bool | bVal3TriggerEnable: 1U |
Enable VAL3 register compare event trigger. More... | |
bool | bVal4TriggerEnable: 1U |
Enable VAL4 register compare event trigger. More... | |
bool | bVal5TriggerEnable: 1U |
Enable VAL5 register compare event trigger. More... | |
bool | bEnableTriggerPostScaler: 1U |
True : Trigger outputs are generated only during the final PWM period prior to a reload opportunity, false : Trigger outputs are generated during every PWM period. More... | |
pwm_sm_mux_trigger_source_t | eMuxTrigger0: 1U |
Configures PWM submodule mux trigger output signal 1 source. More... | |
pwm_sm_mux_trigger_source_t | eMuxTrigger1: 1U |
Configures PWM submodule PWM_X output source (before polarity/mask/enable control). More... | |
bool | bInvertPwmxOutput: 1U |
True : invert PWM_X output, false : no invert PWM_X output. More... | |
bool | bInvertPwmaOutput: 1U |
True : invert PWM_A output, false : no invert PWM_A output. More... | |
bool | bInvertPwmbOutput: 1U |
True : invert PWM_B output, false : no invert PWM_B output. More... | |
bool | bMaskPwmxOutput: 1U |
True : PWM_X output masked, false : PWM_X output normal. More... | |
bool | bMaskPwmaOutput: 1U |
True : PWM_A output masked, false : PWM_A output normal. More... | |
bool | bMaskPwmbOutput: 1U |
True : PWM_B output masked, false : PWM_B output normal. More... | |
bool | bEnablePwmxOutput: 1U |
True : Enable PWM_X output. More... | |
bool | bEnablePwmaOutput: 1U |
True : Enable PWM_A output. More... | |
bool | bEnablePwmbOutput: 1U |
True : Enable PWM_B output. More... | |
pwm_sm_pwm_output_on_fault_t | ePwmxFaultState: 2U |
Configures PWM submodule PWM_A output during fault status (only works when fault status enable). More... | |
pwm_sm_pwm_output_on_fault_t | ePwmaFaultState: 2U |
Configures PWM submodule PWM_B output during fault status (only works when fault status enable). More... | |
bool pwm_sm_output_logic_config_t::bVal0TriggerEnable |
bool pwm_sm_output_logic_config_t::bVal1TriggerEnable |
bool pwm_sm_output_logic_config_t::bVal2TriggerEnable |
bool pwm_sm_output_logic_config_t::bVal3TriggerEnable |
bool pwm_sm_output_logic_config_t::bVal4TriggerEnable |
bool pwm_sm_output_logic_config_t::bVal5TriggerEnable |
bool pwm_sm_output_logic_config_t::bEnableTriggerPostScaler |
Configures PWM submodule mux trigger output signal 0 source.
pwm_sm_mux_trigger_source_t pwm_sm_output_logic_config_t::eMuxTrigger0 |
pwm_sm_mux_trigger_source_t pwm_sm_output_logic_config_t::eMuxTrigger1 |
bool pwm_sm_output_logic_config_t::bInvertPwmxOutput |
bool pwm_sm_output_logic_config_t::bInvertPwmaOutput |
bool pwm_sm_output_logic_config_t::bInvertPwmbOutput |
bool pwm_sm_output_logic_config_t::bMaskPwmxOutput |
Mask bit is buffered, and take effect until FORCE_OUT event or software update command.
bool pwm_sm_output_logic_config_t::bMaskPwmaOutput |
Mask bit is buffered, and take effect until FORCE_OUT event or software update command.
bool pwm_sm_output_logic_config_t::bMaskPwmbOutput |
Mask bit is buffered, and take effect until FORCE_OUT event or software update command.
bool pwm_sm_output_logic_config_t::bEnablePwmxOutput |
false : PWM_X is disabled and output is tristated.
bool pwm_sm_output_logic_config_t::bEnablePwmaOutput |
false : PWM_A is disabled and output is tristated.
bool pwm_sm_output_logic_config_t::bEnablePwmbOutput |
false : PWM_B is disabled and output is tristated. Configures PWM submodule PWM_X output during fault status (only works when fault status enable).
pwm_sm_pwm_output_on_fault_t pwm_sm_output_logic_config_t::ePwmxFaultState |
pwm_sm_pwm_output_on_fault_t pwm_sm_output_logic_config_t::ePwmaFaultState |
struct pwm_sm_input_capture_config_t |
Data Fields | |
bool | bEnableInputCapture: 1U |
True: enable the input capture process, false : disable the input capture process. More... | |
pwm_sm_input_capture_source_t | eInCaptureSource: 1U |
Configures capture circuit 0/1 input source. | |
pwm_sm_input_capture_edge_t | eCircuit0CaptureEdge: 2U |
Configures which edge causes a capture for capture circuit 0 , will be ignore when use edge counter as capture source. More... | |
pwm_sm_input_capture_edge_t | eCircuit1CaptureEdge: 2U |
Configures which edge causes a capture for capture circuit 1 , will be ignore when use edge counter as capture source. More... | |
bool | bEnableOneShotCapture: 1U |
True: Enable one-shot capture mode, the bEnableInputCapture will self-cleared when one or more of the enabled capture circuits has had a capture event; false: Capture circuit 0/1 will perform capture continue;. | |
uint8_t | bitsCaptureFifoWatermark: 2U |
Watermark level for circuit 0/1 capture FIFO. More... | |
uint8_t | u8EdgeCounterCompareValue |
Edge counter compare value, used only if edge counter is used as capture circuit 0/1 input source. | |
bool pwm_sm_input_capture_config_t::bEnableInputCapture |
pwm_sm_input_capture_edge_t pwm_sm_input_capture_config_t::eCircuit0CaptureEdge |
pwm_sm_input_capture_edge_t pwm_sm_input_capture_config_t::eCircuit1CaptureEdge |
uint8_t pwm_sm_input_capture_config_t::bitsCaptureFifoWatermark |
The capture flags in the status register will set if the word count in the circuit 0/1 capture FIFO is greater than this watermark level
struct pwm_sm_capture_dma_config_t |
Data Fields | |
bool | bEnableCaptureDMA: 1U |
Enables DMA read requests for the Capture FIFOs. More... | |
pwm_sm_capture_dma_source_t | eCaptureDMASource: 3U |
Select the source to enables DMA read requests for the Capture FIFOs. More... | |
bool pwm_sm_capture_dma_config_t::bEnableCaptureDMA |
pwm_sm_capture_dma_source_t pwm_sm_capture_dma_config_t::eCaptureDMASource |
Will be ignored when bEnableCaptureDMA be false.
struct pwm_sm_dma_config_t |
Data Fields | |
bool | bEnableWriteValDMA: 1U |
STS[RF] set enables DMA write requests for VALx and FRACVALx registers. More... | |
bool | bEnableReadCaptureX0DMA: 1U |
STS[CFX0] set enables DMA read requests for Capture X0 FIFO. More... | |
bool | bEnableReadCaptureX1DMA: 1U |
STS[CFX1] set enables DMA read requests for Capture X1 FIFO. More... | |
bool | bEnableReadCaptureA0DMA: 1U |
STS[CFA0] set enables DMA read requests for Capture A0 FIFO. More... | |
bool | bEnableReadCaptureA1DMA: 1U |
STS[CFA1] set enables DMA read requests for Capture A1 FIFO. More... | |
bool | bEnableReadCaptureB0DMA: 1U |
STS[CFB0] set enables DMA read requests for Capture B0 FIFO. More... | |
bool | bEnableReadCaptureB1DMA: 1U |
STS[CFB1] set enables DMA read requests for Capture B1 FIFO. More... | |
pwm_sm_capture_dma_config_t | sCaptureDma |
DMA read requests for the capture FIFOs configure. More... | |
bool pwm_sm_dma_config_t::bEnableWriteValDMA |
bool pwm_sm_dma_config_t::bEnableReadCaptureX0DMA |
And X0 FIFO watermark is selected for sCaptureDma pwm_sm_capture_dma_config_t.
bool pwm_sm_dma_config_t::bEnableReadCaptureX1DMA |
And X1 FIFO watermark is selected for sCaptureDma pwm_sm_capture_dma_config_t.
bool pwm_sm_dma_config_t::bEnableReadCaptureA0DMA |
And A0 FIFO watermark is selected for sCaptureDma pwm_sm_capture_dma_config_t.
bool pwm_sm_dma_config_t::bEnableReadCaptureA1DMA |
And A1 FIFO watermark is selected for sCaptureDma pwm_sm_capture_dma_config_t.
bool pwm_sm_dma_config_t::bEnableReadCaptureB0DMA |
And B0 FIFO watermark is selected for sCaptureDma pwm_sm_capture_dma_config_t.
bool pwm_sm_dma_config_t::bEnableReadCaptureB1DMA |
And B1 FIFO watermark is selected for sCaptureDma pwm_sm_capture_dma_config_t.
pwm_sm_capture_dma_config_t pwm_sm_dma_config_t::sCaptureDma |
struct pwm_sm_fault_input_mapping_t |
The structure for configuring PWM submodule fault input disable mapping.
Data Fields | |
bool | bFaultInput0Mapping: 1U |
Mapping fault input 0 (from fault protection channel 0) to PWM output. More... | |
bool | bFaultInput1Mapping: 1U |
Mapping fault input 1 (from fault protection channel 0) to PWM output. More... | |
bool | bFaultInput2Mapping: 1U |
Mapping fault input 2 (from fault protection channel 0) to PWM output. More... | |
bool | bFaultInput3Mapping: 1U |
Mapping fault input 3 (from fault protection channel 0) to PWM output. More... | |
bool | bFaultInput4Mapping: 1U |
Mapping fault input 4 (from fault protection channel 1) to PWM output. More... | |
bool | bFaultInput5Mapping: 1U |
Mapping fault input 5 (from fault protection channel 1) to PWM output. More... | |
bool | bFaultInput6Mapping: 1U |
Mapping fault input 6 (from fault protection channel 1) to PWM output. More... | |
bool | bFaultInput7Mapping: 1U |
Mapping fault input 7 (from fault protection channel 1) to PWM output. More... | |
bool pwm_sm_fault_input_mapping_t::bFaultInput0Mapping |
bool pwm_sm_fault_input_mapping_t::bFaultInput1Mapping |
bool pwm_sm_fault_input_mapping_t::bFaultInput2Mapping |
bool pwm_sm_fault_input_mapping_t::bFaultInput3Mapping |
bool pwm_sm_fault_input_mapping_t::bFaultInput4Mapping |
bool pwm_sm_fault_input_mapping_t::bFaultInput5Mapping |
bool pwm_sm_fault_input_mapping_t::bFaultInput6Mapping |
bool pwm_sm_fault_input_mapping_t::bFaultInput7Mapping |
struct pwm_sm_config_t |
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.
Data Fields | |
bool | enableDebugMode: 1U |
true: PWM continues to run in debug mode; false: PWM is paused in debug mode. More... | |
bool | enableWaitMode: 1U |
true: PWM continues to run in WAIT mode; false: PWM is paused in WAIT mode. More... | |
bool | enableRun: 1U |
true: PWM submodule is enabled; false: PWM submodule is disabled. More... | |
pwm_sm_counter_config_t | sCounterConfig |
Submodule counter logic config. More... | |
pwm_sm_reload_logic_config_t | sReloadConfig |
Submodule reload control logic config. More... | |
pwm_sm_value_register_config_t | sValRegisterConfig |
Submodule value registers config. More... | |
pwm_sm_force_logic_config_t | sForceConfig |
Submodule force out logic config. More... | |
pwm_sm_deadtime_logic_config_t | sDeadTimeConfig |
Submodule deadtime logic config. More... | |
pwm_sm_fractional_delay_logic_config_t | sFracDelayConfig |
Submodule fractional logic config. More... | |
pwm_sm_output_logic_config_t | sOutputConfig |
Submodule output logic config. More... | |
pwm_sm_input_capture_config_t | sInCaptureConfig [3] |
Submodule input capture config for PWM_X/A/B pins. More... | |
pwm_sm_dma_config_t | sDMAConfig |
Submodule DMA config. More... | |
pwm_sm_fault_input_mapping_t | sPwmXFaultInputMapping |
PWM_A output fault input mapping, determines which fault inputs can disable PWM_A output. More... | |
pwm_sm_fault_input_mapping_t | sPwmAFaultInputMapping |
PWM_B output fault input mapping, determines which fault inputs can disable PWM_B output. More... | |
pwm_sm_fault_input_mapping_t | sPwmBFaultInputMapping |
Submodule interrupt enable mask, logic OR of _pwm_sm_interrupt_enable. More... | |
bool pwm_sm_config_t::enableDebugMode |
bool pwm_sm_config_t::enableWaitMode |
bool pwm_sm_config_t::enableRun |
Configures submodule value registers compare mode, only can be written one time.
pwm_sm_counter_config_t pwm_sm_config_t::sCounterConfig |
pwm_sm_reload_logic_config_t pwm_sm_config_t::sReloadConfig |
pwm_sm_value_register_config_t pwm_sm_config_t::sValRegisterConfig |
pwm_sm_force_logic_config_t pwm_sm_config_t::sForceConfig |
pwm_sm_deadtime_logic_config_t pwm_sm_config_t::sDeadTimeConfig |
pwm_sm_fractional_delay_logic_config_t pwm_sm_config_t::sFracDelayConfig |
pwm_sm_output_logic_config_t pwm_sm_config_t::sOutputConfig |
pwm_sm_input_capture_config_t pwm_sm_config_t::sInCaptureConfig[3] |
pwm_sm_dma_config_t pwm_sm_config_t::sDMAConfig |
PWM_X output fault input mapping, determines which fault inputs can disable PWM_X output.
pwm_sm_fault_input_mapping_t pwm_sm_config_t::sPwmXFaultInputMapping |
pwm_sm_fault_input_mapping_t pwm_sm_config_t::sPwmAFaultInputMapping |
pwm_sm_fault_input_mapping_t pwm_sm_config_t::sPwmBFaultInputMapping |
struct pwm_fault_protection_config_t |
Data Fields | |
bool | bEnableFaultGlitchStretch: 1U |
Fault Glitch Stretch Enable: A logic 1 means that input fault signals will be stretched to at least 2 IPBus clock cycles. More... | |
uint8_t | bitsFaultFilterCount: 3U |
Configures PWM fault protection channel fault filter count. More... | |
uint8_t | u8FaultFilterPeriod |
Configures PWM fault protection channel fault filter period, value of 0 will bypass the filter. More... | |
bool pwm_fault_protection_config_t::bEnableFaultGlitchStretch |
uint8_t pwm_fault_protection_config_t::bitsFaultFilterCount |
uint8_t pwm_fault_protection_config_t::u8FaultFilterPeriod |
struct pwm_config_t |
Data Fields | |
pwm_sm_config_t * | psPwmSubmoduleConfig [FSL_FEATURE_PWM_SUBMODULE_COUNT] |
< PWM submodule config. More... | |
pwm_sm_config_t* pwm_config_t::psPwmSubmoduleConfig[FSL_FEATURE_PWM_SUBMODULE_COUNT] |
PWM fault protection channel config, will take effect for all submodules.
enum pwm_sm_number_t |
enum _pwm_sm_enable |
enum pwm_sm_pwm_out_t |
void PWM_Init | ( | PWM_Type * | base, |
const pwm_config_t * | psConfig | ||
) |
This function can initial one or more submodules of the PWM module.
This examples shows how only initial submodule 0 without fault protection channel.
base | PWM peripheral base address. |
eSubModule | PWM submodule number. See pwm_sm_number_t. |
psConfig | Pointer to PWM module configure structure. See pwm_config_t. |
void PWM_Deinit | ( | PWM_Type * | base | ) |
base | PWM peripheral base address |
void PWM_GetSMDefaultConfig | ( | pwm_sm_config_t * | psConfig | ) |
This function fills in the initialization structure member, which can make submodule generate 50% duty cycle center aligned PWM_A/B output.
The default effective values are:
psConfig | Pointer to user's PWM submodule config structure. See pwm_sm_config_t. |
void PWM_GetFaultProtectionDefaultConfig | ( | pwm_fault_protection_config_t * | psConfig | ) |
The default effective values are:
psConfig | Pointer to user's PWM fault protection config structure. See pwm_fault_protection_config_t. |
void PWM_SetupSMConfig | ( | PWM_Type * | base, |
pwm_sm_number_t | eSubModule, | ||
const pwm_sm_config_t * | psConfig | ||
) |
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to submodule configure structure, see pwm_sm_config_t. |
|
inlinestatic |
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to submodule counter configure structure, see pwm_sm_counter_config_t. |
|
inlinestatic |
This function set the INIT register value, the counter will start counting from INIT register value when initial signal assert or software force set. This write value will be loaded into inner set of buffered registers according to reload logic configure.
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
u16InitialValue | The submodule number counter initialize value. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to submodule reload logic configure structure, see pwm_sm_reload_control_config_t. |
void PWM_GetValueConfig | ( | pwm_sm_value_register_config_t * | psConfig, |
pwm_sm_typical_output_mode_t | eTypicalOutputMode, | ||
uint16_t | u16PwmPeriod, | ||
uint16_t | u16PwmAPulseWidth, | ||
uint16_t | u16PwmBPulseWidth | ||
) |
psConfig | See pwm_sm_config_t. |
eTypicalOutputMode | Typical PWM_A/B output mode. See wm_sm_typical_output_mode_t. |
u16PwmPeriod | PWM output period value in counter ticks. This value can be got by (main counter clock in Hz) / (wanted PWM signal frequency in Hz). |
u16PwmAPulseWidth | PWM_A pulse width value in counter ticks. Can got by (wanted PWM duty Cycle) * u16PwmPeriod. |
u16PwmBPulseWidth | PWM_B pulse width value in counter ticks. Can got by (wanted PWM duty Cycle) * u16PwmPeriod. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to VALn registers configure structure, see pwm_sm_output_compare_config_t. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eRegister | Value register index (range in 0~5), see pwm_sm_val_register_t. |
u16Value | The value for VALn register. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eRegister | Value register index (range in 0~5), see pwm_sm_val_register_t. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eRegister | Fractional value register index (range in 1~5), see pwm_sm_val_register_t. |
u16Value | The value for FRACVALn register. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eRegister | Fractional value register index (range in 1~5), see pwm_sm_fracval_register_t. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | Submodule ID. |
eRegister | Fractional value register index (range in 1~5), see pwm_sm_fracval_register_t. |
u32Value | 32bit value for VALx and its FRAC. VALx: BIT16~BIT31. FRACVALx: BIT11~BIT15. RESERVED: BIT10~BIT0. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | Submodule ID. |
eRegister | Fractional value register index (range in 1~5), see pwm_sm_fracval_register_t. |
|
inlinestatic |
Enable this feature can make buffered CTRL[PRSC] and the INIT, FRACVAL and VAL registers values take effect after next local load signal assert. The timing of take effect can be the next PWM reload or immediately. After loading, MCTRL[LDOK] is automatically cleared and need to enable again before the next register updated.
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
u16Mask | PWM submodules to set the LDOK bit, Logical OR of _pwm_sm_enable. |
|
inlinestatic |
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
u16Mask | PWM submodules to clear the LDOK bit, Logical OR of _pwm_sm_enable. |
|
inlinestatic |
param base PWM peripheral base address. param eSubModule PWM submodule number, see pwm_sm_number_t. param psConfig Poniter to submodule force logic configure structure, see pwm_sm_force_logic_config_t.
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
void PWM_SetupDeadtimeConfig | ( | PWM_Type * | base, |
pwm_sm_number_t | eSubModule, | ||
const pwm_sm_deadtime_logic_config_t * | psConfig | ||
) |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to deadtime logic configure structure, see pwm_sm_deadtime_logic_config_t. |
|
inlinestatic |
When use PWM_A/B in complementary mode and connect to transistor to controls the output voltage. Need insert deadtime to avoid overlap of conducting interval between the top and bottom transistor. And both transistors in complementary mode are off during deadtime. Then connect the PWM_X input to complementary transistors output, then it sampling input at the end of deadtime 0 for DT[0] and the end of deadtime 1 for DT[1]. Which DT value is not 0 indicates that there is a problem with the corresponding deadtime value. This can help to decide if there need do a deadtime correction for current complementary PWM output.
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
void PWM_SetupFractionalDelayConfig | ( | PWM_Type * | base, |
pwm_sm_number_t | eSubModule, | ||
const pwm_sm_fractional_delay_logic_config_t * | psConfig | ||
) |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to fractional delay logic configure structure, see pwm_sm_fractional_delay_logic_config_t. |
void PWM_SetupOutputConfig | ( | PWM_Type * | base, |
pwm_sm_number_t | eSubModule, | ||
const pwm_sm_output_logic_config_t * | psConfig | ||
) |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to output logic configure structure, see pwm_sm_output_logic_config_t. |
|
inlinestatic |
This function handles PWMX_EN/PWMA_EN/PWMB_EN bit filed of OUTEN register, whcih can enable one or more submodule pin in PWMX/A/B.
base | PWM peripheral base address |
u16SubModules | The submodules that enable eOutput output, logical OR of _pwm_sm_enable. |
eOutput | PWM output pin ID, see pwm_sm_pwm_out_t. |
|
inlinestatic |
This function handles PWMX_EN/PWMA_EN/PWMB_EN bit filed of OUTEN register, whcih can disable one or more submodule pin in PWMX/A/B.
base | PWM peripheral base address |
u16SubModules | The submodules that disable eOutput output, logical OR of _pwm_sm_enable. |
eOutput | PWM output pin ID, see pwm_sm_pwm_out_t. |
|
inlinestatic |
This function handles PWMX_EN/PWMA_EN/PWMB_EN bit filed of OUTEN register at the same time.
base | PWM peripheral base address |
u16XSubModules | The submodules that enable PWMX output, should be logical OR of _pwm_sm_enable. |
u16ASubModules | The submodules that enable PWMA output, should be logical OR of _pwm_sm_enable. |
u16BSubModules | The submodules that enable PWMB output, should be logical OR of _pwm_sm_enable. |
|
inlinestatic |
This function handles PWMX_EN/PWMA_EN/PWMB_EN bit filed of OUTEN register at the same time.
base | PWM peripheral base address |
u16XSubModules | The submodules that disable PWMX output, should be logical OR of _pwm_sm_enable. |
u16ASubModules | The submodules that disable PWMA output, should be logical OR of _pwm_sm_enable. |
u16BSubModules | The submodules that disable PWMB output, should be logical OR of _pwm_sm_enable. |
|
inlinestatic |
This function handles MASKA/MASKB/MASKX bit filed of MASK register, which can mask one or more submodule pin in PWMX/A/B.
base | PWM peripheral base address. |
u16SubModules | The submodules that mask eOutput output, logical OR of _pwm_sm_enable. |
eOutput | PWM output pin ID, see pwm_sm_pwm_out_t. |
|
inlinestatic |
This function handles MASKA/MASKB/MASKX bit filed of MASK register, which can mask one or more submodule pin in PWMX/A/B.
base | PWM peripheral base address |
u16SubModules | The submodules that unmask eOutput output, logical OR of _pwm_sm_enable. |
eOutput | PWM output pin ID, see pwm_sm_pwm_out_t. |
|
inlinestatic |
This function handles MASKA/MASKB/MASKX bit filed of MASK register at the same time.
base | PWM peripheral base address |
u16XSubModules | The submodules that mask PWMX output, should be logical OR of _pwm_sm_enable. |
u16ASubModules | The submodules that mask PWMA output, should be logical OR of _pwm_sm_enable. |
u16BSubModules | The submodules that mask PWMB output, should be logical OR of _pwm_sm_enable. |
|
inlinestatic |
This function handles MASKA/MASKB/MASKX bit filed of MASK register at the same time.
base | PWM peripheral base address |
u16XSubModules | The submodules that unmask PWMX output, should be logical OR of _pwm_sm_enable. |
u16ASubModules | The submodules that unmask PWMA output, should be logical OR of _pwm_sm_enable. |
u16BSubModules | The submodules that unmask PWMB output, should be logical OR of _pwm_sm_enable. |
|
inlinestatic |
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
|
inlinestatic |
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
bEnable | Enable the feature or not.
|
|
inlinestatic |
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
bEnable | Enable the feature or not.
|
|
inlinestatic |
Sets the Run bit which enables the clocks to the PWM submodule. This function can start multiple submodules at the same time.
base | PWM peripheral base address |
u16Mask | PWM submodules to start run, Logical OR of _pwm_sm_enable. |
|
inlinestatic |
Clears the Run bit which resets the submodule's counter. This function can stop multiple submodules at the same time.
base | PWM peripheral base address |
u16Mask | PWM submodules to start run, Logical OR of _pwm_sm_enable. |
|
inlinestatic |
This function read the CVALn register value, stores the value captured from the submodule counter.
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eRegister | PWM submodule input capture value register, see pwm_sm_input_capture_register_t. |
|
inlinestatic |
This function read the CVALnCYC register value, stores the cycle number corresponding to the value captured in CVALn. This register is incremented each time the counter is loaded with the INIT value at the end of a PWM modulo cycle.
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eRegister | PWM submodule input capture value register, see pwm_sm_input_capture_register_t. |
|
inlinestatic |
Each input capture logic has a edge counter, which counts both the rising and falling edges of the input capture signal and it compare signal can select as input capture trigger source.
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eInputPin | PWM submodule input capture pin number, see pwm_sm_input_capture_pin_t. |
void PWM_SetupInputCaptureConfig | ( | PWM_Type * | base, |
pwm_sm_number_t | eSubModule, | ||
pwm_sm_input_capture_pin_t | eInputPin, | ||
const pwm_sm_input_capture_config_t * | psConfig | ||
) |
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 input capture operation.
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eInputPin | PWM submodule input capture pin number, see pwm_sm_input_capture_pin_t. |
psConfig | Pointer to input capture configure structure, see pwm_sm_input_capture_config_t. |
|
inlinestatic |
Enables input capture operation will start the input capture process. The enable bit is self-cleared when in one shot mode and one or more of the enabled capture circuits has had a capture event.
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eInputPin | PWM submodule input capture pin number, see pwm_sm_input_capture_pin_t. |
|
inlinestatic |
The enable bit can be cleared at any time to disable input capture operation.
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eInputPin | PWM submodule input capture pin number, see pwm_sm_input_capture_pin_t. |
|
inlinestatic |
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
eInputPin | PWM submodule input capture pin number, see pwm_sm_input_capture_pin_t. |
void PWM_SetupFaultProtectionConfig | ( | PWM_Type * | base, |
pwm_fault_protection_channel_t | eFaultProtection, | ||
const pwm_fault_protection_config_t * | psConfig | ||
) |
base | PWM peripheral base address. |
eFaultProtection | PWM fault protection channel number, see pwm_fault_protection_channel_t. |
psConfig | Pointer to fault protection channel configure structure, see pwm_fault_protection_config_t. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
ePwmOutput | PWM submodule output, see pwm_sm_pwm_out_t. |
psMapping | The fault input disable mapping structure, see pwm_sm_fault_input_mapping_t. |
void PWM_SetupDmaConfig | ( | PWM_Type * | base, |
pwm_sm_number_t | eSubModule, | ||
const pwm_sm_dma_config_t * | psConfig | ||
) |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
psConfig | Pointer to PWM submodule DMA configure, see pwm_sm_dma_config_t. |
|
inlinestatic |
base | PWM peripheral base address. |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
u16Mask | The PWM submodule DMA requests to enable. Logical OR of _pwm_sm_dma_enable. |
|
inlinestatic |
This examples shows how to enable VAL 0 compare interrupt and VAL 1 compare interrupt.
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
u16Mask | The PWM submodule interrupts to enable. Logical OR of _qtmr_channel_interrupt_enable. |
|
inlinestatic |
This examples shows how to disable VAL 0 compare interrupt and VAL 1 compare interrupt.
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
u16Mask | The PWM submodule interrupts to enable. Logical OR of _qtmr_channel_interrupt_enable. |
|
inlinestatic |
This examples shows how to enable fault pin 0 interrupt and fault pin 1 interrupt.
base | PWM peripheral base address |
eFaultProtection | PWM fault protection channel number, see pwm_fault_protection_channel_t. |
u16Mask | The PWM fault protection channel interrupts to enable. Logical OR of _pwm_fault_protection_interrupt_enable. |
|
inlinestatic |
This examples shows how to disable fault pin 0 interrupt and fault pin 1 interrupt.
base | PWM peripheral base address |
eFaultProtection | PWM fault protection channel number, see pwm_fault_protection_channel_t. |
u16Mask | The PWM fault protection channel interrupts to disable. Logical OR of _pwm_fault_protection_interrupt_enable. |
|
inlinestatic |
This examples shows how to check whether the submodule VAL0 compare flag set.
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
|
inlinestatic |
This examples shows how to clear the submodule VAL0 compare flag.
base | PWM peripheral base address |
eSubModule | PWM submodule number, see pwm_sm_number_t. |
u8Mask | The status flags to clear. This is the logical OR of _pwm_sm_status_flags. |
|
inlinestatic |
This examples shows how to check whether the fault protection channel fault input pin 0 set.
base | PWM peripheral base address |
eFaultProtection | PWM fault protection channel number, see pwm_fault_protection_channel_t. |
|
inlinestatic |
This examples shows how to clear the fault protection channel fault 0 flag.
base | PWM peripheral base address |
eFaultProtection | PWM fault protection channel number, see pwm_fault_protection_channel_t. |
u16Mask | The PWM fault protection channel interrupts to disable. Logical OR of _pwm_fault_protection_interrupt_enable. |