Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The section describes the programming interface of the eFlexPWM HAL driver.

Data Structures

struct  pwm_module_setup_t
 Structure is used to hold the parameters to configure a PWM module. More...
 
struct  pwm_fault_setup_t
 Structure is used to hold the parameters to configure a PWM fault. More...
 
struct  pwm_capture_setup_t
 Structure is used to hold parameters to configure the capture capability of a signal pin. More...
 

Enumerations

enum  pwm_module_t {
  kFlexPwmModule0 = 0U,
  kFlexPwmModule1,
  kFlexPwmModule2,
  kFlexPwmModule3
}
 PWM submodules. More...
 
enum  pwm_module_signal_t
 PWM signals from each module.
 
enum  pwm_val_regs_t {
  kFlexPwmVAL0 = 0U,
  kFlexPwmVAL1,
  kFlexPwmVAL2,
  kFlexPwmVAL3,
  kFlexPwmVAL4,
  kFlexPwmVAL5
}
 PWM value registers. More...
 
enum  pwm_status_t {
  kStatusPwmSuccess = 0U,
  kStatusPwmError = 1U,
  kStatusPwmInvalidArgument = 2U
}
 PWM status. More...
 
enum  pwm_clock_src_t {
  kClkSrcPwmIPBusClk = 0U,
  kClkSrcPwmExtClk,
  kClkSrcPwm0Clk
}
 PWM clock source selection. More...
 
enum  pwm_clock_ps_t {
  kPwmDividedBy1 = 0U,
  kPwmDividedBy2,
  kPwmDividedBy4,
  kPwmDividedBy8,
  kPwmDividedBy16,
  kPwmDividedBy32,
  kPwmDividedBy64,
  kPwmDividedBy128
}
 PWM prescaler factor selection for clock source. More...
 
enum  pwm_force_output_trigger_t {
  kForceOutputLocalForce = 0U,
  kForceOutputMasterForce,
  kForceOutputLocalReload,
  kForceOutputMasterReload,
  kForceOutputLocalSync,
  kForceOutputMasterSync,
  kForceOutputExternalForce,
  kForceOutputExternalSync
}
 Options that can trigger a PWM FORCE_OUT. More...
 
enum  pwm_init_src_t {
  kInitSrcLocalSync = 0U,
  kInitSrcMasterReload,
  kInitSrcMasterSync,
  kInitSrcExtSync
}
 PWM counter initialization options. More...
 
enum  pwm_load_frequency_t {
  kPwmLoadEvery1Oportunity = 0U,
  kPwmLoadEvery2Oportunity,
  kPwmLoadEvery3Oportunity,
  kPwmLoadEvery4Oportunity,
  kPwmLoadEvery5Oportunity,
  kPwmLoadEvery6Oportunity,
  kPwmLoadEvery7Oportunity,
  kPwmLoadEvery8Oportunity,
  kPwmLoadEvery9Oportunity,
  kPwmLoadEvery10Oportunity,
  kPwmLoadEvery11Oportunity,
  kPwmLoadEvery12Oportunity,
  kPwmLoadEvery13Oportunity,
  kPwmLoadEvery14Oportunity,
  kPwmLoadEvery15Oportunity,
  kPwmLoadEvery16Oportunity
}
 PWM load frequency selection. More...
 
enum  pwm_fault_input_t {
  kFlexPwmFault0 = 0U,
  kFlexPwmFault1,
  kFlexPwmFault2,
  kFlexPwmFault3
}
 PWM fault select. More...
 
enum  pwm_capture_edge_t {
  kCaptureDisable = 0U,
  kCaptureFallingEdges,
  kCaptureRisingEdges,
  kCaptureAnyEdges
}
 PWM capture edge select. More...
 
enum  pwm_force_signal_t {
  kFlexPwmUsePwm = 0U,
  kFlexPwmInvertedPwm,
  kFlexPwmSoftwareControl,
  kFlexPwmUseExternal
}
 PWM output options when a FORCE_OUT signal is asserted. More...
 
enum  pwm_chnl_pair_operation_t {
  kFlexPwmIndependent = 0U,
  kFlexPwmComplementaryPwmA,
  kFlexPwmComplementaryPwmB
}
 Optiona available for the PWM A & B pair operation. More...
 
enum  pwm_reg_reload_t {
  kFlexPwmReloadImmediate = 0U,
  kFlexPwmReloadPwmHalfCycle,
  kFlexPwmReloadPwmFullCycle,
  kFlexPwmReloadPwmHalfAndFullCycle
}
 Options available on how to load the buffered-registers with new values. More...
 
enum  pwm_fault_recovery_mode_t {
  kFlexPwmNoRecovery = 0U,
  kFlexPwmRecoverHalfCycle,
  kFlexPwmRecoverFullCycle,
  kFlexPwmRecoverHalfAndFullCycle
}
 Options available on how to re-enable the PWM output when recovering from a fault. More...
 
enum  pwm_event_t {
  kFlexPwmCompareVal0Event = (1U << 0),
  kFlexPwmCompareVal1Event = (1U << 1),
  kFlexPwmCompareVal2Event = (1U << 2),
  kFlexPwmCompareVal3Event = (1U << 3),
  kFlexPwmCompareVal4Event = (1U << 4),
  kFlexPwmCompareVal5Event = (1U << 5),
  kFlexPwmCaptureX0Event = (1U << 6),
  kFlexPwmCaptureX1Event = (1U << 7),
  kFlexPwmCaptureB0Event = (1U << 8),
  kFlexPwmCaptureB1Event = (1U << 9),
  kFlexPwmCaptureA0Event = (1U << 10),
  kFlexPwmCaptureA1Event = (1U << 11),
  kFlexPwmReloadEvent = (1U << 12),
  kFlexPwmReloadErrorEvent = (1U << 13),
  kFlexPwmFault0Event = (1U << 16),
  kFlexPwmFault1Event = (1U << 17),
  kFlexPwmFault2Event = (1U << 18),
  kFlexPwmFault3Event = (1U << 19)
}
 PWM interrupt options available. More...
 

Functions

void PWM_HAL_Init (PWM_Type *base)
 Initializes the PWM to its reset state. More...
 
void PWM_HAL_SetupPwmSubModule (PWM_Type *base, pwm_module_t subModuleNum, pwm_module_setup_t *setupParams)
 Sets up a PWM sub-module. More...
 
void PWM_HAL_SetupFaults (PWM_Type *base, pwm_fault_input_t faultNum, pwm_fault_setup_t *setupParams)
 Sets up the Flex PWM fault protection. More...
 
void PWM_HAL_SetupCapture (PWM_Type *base, pwm_module_t subModuleNum, pwm_module_signal_t pwmSignal, pwm_capture_setup_t *setupParams)
 Sets up the Flex PWM capture.s. More...
 
uint16_t PWM_HAL_GetCaptureValReg (PWM_Type *base, pwm_module_t subModuleNum, pwm_val_regs_t cmpReg)
 Gets the PWM capture value. More...
 
void PWM_HAL_SetValReg (PWM_Type *base, uint8_t subModuleNum, pwm_val_regs_t valReg, uint16_t val)
 Sets the PWM value register. More...
 
void PWM_HAL_SetupForceSignal (PWM_Type *base, pwm_module_t subModuleNum, pwm_module_signal_t pwmSignal, pwm_force_signal_t mode)
 Selects the signal to output when a FORCE_OUT signal is asserted. More...
 
void PWM_HAL_EnableInterrupts (PWM_Type *base, pwm_module_t subModuleNum, uint32_t eventmask)
 Enables all relevant PWM interrupts. More...
 
void PWM_HAL_DisableInterrupts (PWM_Type *base, pwm_module_t subModuleNum, uint32_t eventmask)
 Disables all PWM interrupts. More...
 
void PWM_HAL_ClearStatus (PWM_Type *base, pwm_module_t subModuleNum, uint32_t eventmask)
 Clears all PWM status flags. More...
 
static uint16_t PWM_HAL_GetCounter (PWM_Type *base, pwm_module_t subModuleNum)
 Returns the PWM peripheral current counter value. More...
 
static void PWM_HAL_SetCounterInitVal (PWM_Type *base, pwm_module_t subModuleNum, uint16_t val)
 Sets the PWM timer counter initial value. More...
 
static void PWM_HAL_SetForceCmd (PWM_Type *base, pwm_module_t subModuleNum, bool val)
 Outputs a FORCE signal. More...
 
static void PWM_HAL_SetOutputPolarityPwmBCmd (PWM_Type *base, pwm_module_t subModuleNum, bool val)
 Sets the output polarity for the PWM_B. More...
 
static void PWM_HAL_SetOutputPolarityPwmACmd (PWM_Type *base, pwm_module_t subModuleNum, bool val)
 Sets the output polarity for the PWM_A. More...
 
static void PWM_HAL_SetOutputPolarityPwmXCmd (PWM_Type *base, pwm_module_t subModuleNum, bool val)
 Sets the output polarity for the PWM_X. More...
 
static void PWM_HAL_SetOutputTriggerCmd (PWM_Type *base, pwm_module_t subModuleNum, uint8_t valueReg, bool val)
 Enables or disables if a match with a value register causes an output trigger. More...
 
static void PWM_HAL_SetPwmAFaultInputCmd (PWM_Type *base, pwm_module_t subModuleNum, pwm_fault_input_t fault, bool val)
 Enables or disables the fault input for the PWM A. More...
 
static void PWM_HAL_SetPwmBFaultInputCmd (PWM_Type *base, pwm_module_t subModuleNum, pwm_fault_input_t fault, bool val)
 Enables or disables the fault input for the PWM B. More...
 
static void PWM_HAL_SetPwmXFaultInputCmd (PWM_Type *base, pwm_module_t subModuleNum, pwm_fault_input_t fault, bool val)
 Enables or disables the fault input for the PWM X. More...
 
static void PWM_HAL_SetOutputPwmXCmd (PWM_Type *base, pwm_module_t subModuleNum, bool val)
 Sets the PWM_X pin to input or output. More...
 
static void PWM_HAL_SetOutputPwmBCmd (PWM_Type *base, pwm_module_t subModuleNum, bool val)
 Sets the PWM_B pin to input or output. More...
 
static void PWM_HAL_SetOutputPwmACmd (PWM_Type *base, pwm_module_t subModuleNum, bool val)
 Sets the PWM_A pin to input or output. More...
 
static void PWM_HAL_SetSwCtrlOutCmd (PWM_Type *base, pwm_module_t subModuleNum, pwm_module_signal_t output, bool val)
 Sets the software control output for a pin to high or low. More...
 
static void PWM_HAL_SetPwmRunCmd (PWM_Type *base, uint8_t subModules, bool val)
 Sets the PWM generator run. More...
 

Data Structure Documentation

struct pwm_module_setup_t

Data Fields

pwm_init_src_t cntrInitSel
 Option to initialize the counter.
 
pwm_clock_src_t clkSrc
 Clock source for the counter.
 
pwm_clock_ps_t prescale
 Pre-scaler to divide down the clock.
 
pwm_chnl_pair_operation_t chnlPairOper
 Channel pair in indepedent or complementary mode.
 
pwm_reg_reload_t reloadLogic
 PWM Reload logic setup.
 
pwm_load_frequency_t reloadFreq
 Specifies when to reload, used when user's choice is not immediate reload.
 
pwm_force_output_trigger_t forceTrig
 Specify which signal will trigger a FORCE_OUT.
 
struct pwm_fault_setup_t

Data Fields

bool automaticClearing
 true: Use automatic fault clearing; false: Manual fault clearing.
 
bool faultLevel
 true: Logic 1 indicates fault; false: Logic 0 indicates fault.
 
bool useFaultFilter
 true: Use the filtered fault signal; false: Use the direct path from fault input.
 
pwm_fault_recovery_mode_t recMode
 Specify when to re-enable the PWM output.
 
struct pwm_capture_setup_t

Data Fields

bool captureInputSel
 true: Use the edge counter signal as source false: Use the raw input signal from the pin as source
 
uint8_t edgeCompareVal
 Compare value, used only if edge counter is used as source.
 
pwm_capture_edge_t edge0
 Specify which edge causes a capture for input circuitry 0.
 
pwm_capture_edge_t edge1
 Specify which edge causes a capture for input circuitry 1.
 
bool oneShotCapture
 true: Use one-shot capture mode; false: Use free-running capture mode
 

Enumeration Type Documentation

Enumerator
kFlexPwmModule0 

Sub-module 0.

kFlexPwmModule1 

Sub-module 1.

kFlexPwmModule2 

Sub-module 2.

kFlexPwmModule3 

Sub-module 3.

Enumerator
kFlexPwmVAL0 

PWM VAL0 reg.

kFlexPwmVAL1 

PWM VAL1 reg.

kFlexPwmVAL2 

PWM VAL2 reg.

kFlexPwmVAL3 

PWM VAL3 reg.

kFlexPwmVAL4 

PWM VAL4 reg.

kFlexPwmVAL5 

PWM VAL5 reg.

Enumerator
kStatusPwmSuccess 

PWM success status.

kStatusPwmError 

PWM error status.

kStatusPwmInvalidArgument 

PWM invalid argument.

Enumerator
kClkSrcPwmIPBusClk 

The IPBus clock is used as the clock.

kClkSrcPwmExtClk 

EXT_CLK is used as the clock.

kClkSrcPwm0Clk 

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

Enumerator
kPwmDividedBy1 

PWM clock frequency = fclk/1.

kPwmDividedBy2 

PWM clock frequency = fclk/2.

kPwmDividedBy4 

PWM clock frequency = fclk/4.

kPwmDividedBy8 

PWM clock frequency = fclk/8.

kPwmDividedBy16 

PWM clock frequency = fclk/16.

kPwmDividedBy32 

PWM clock frequency = fclk/32.

kPwmDividedBy64 

PWM clock frequency = fclk/64.

kPwmDividedBy128 

PWM clock frequency = fclk/128.

Enumerator
kForceOutputLocalForce 

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

kForceOutputMasterForce 

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

kForceOutputLocalReload 

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

kForceOutputMasterReload 

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

kForceOutputLocalSync 

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

kForceOutputMasterSync 

The master sync signal from submodule0 is used to force updates.

kForceOutputExternalForce 

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

kForceOutputExternalSync 

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

Enumerator
kInitSrcLocalSync 

Local sync (PWM_X) causes initialization.

kInitSrcMasterReload 

Master reload from submodule 0 causes initialization.

kInitSrcMasterSync 

Master sync from submodule 0 causes initialization.

kInitSrcExtSync 

EXT_SYNC causes initialization.

Enumerator
kPwmLoadEvery1Oportunity 

Every 1 PWM opportunity.

kPwmLoadEvery2Oportunity 

Every 2 PWM opportunities.

kPwmLoadEvery3Oportunity 

Every 3 PWM opportunities.

kPwmLoadEvery4Oportunity 

Every 4 PWM opportunities.

kPwmLoadEvery5Oportunity 

Every 5 PWM opportunities.

kPwmLoadEvery6Oportunity 

Every 6 PWM opportunities.

kPwmLoadEvery7Oportunity 

Every 7 PWM opportunities.

kPwmLoadEvery8Oportunity 

Every 8 PWM opportunities.

kPwmLoadEvery9Oportunity 

Every 9 PWM opportunities.

kPwmLoadEvery10Oportunity 

Every 10 PWM opportunities.

kPwmLoadEvery11Oportunity 

Every 11 PWM opportunities.

kPwmLoadEvery12Oportunity 

Every 12 PWM opportunities.

kPwmLoadEvery13Oportunity 

Every 13 PWM opportunities.

kPwmLoadEvery14Oportunity 

Every 14 PWM opportunities.

kPwmLoadEvery15Oportunity 

Every 15 PWM opportunities.

kPwmLoadEvery16Oportunity 

Every 16 PWM opportunities.

Enumerator
kFlexPwmFault0 

Fault 0 input pin.

kFlexPwmFault1 

Fault 1 input pin.

kFlexPwmFault2 

Fault 2 input pin.

kFlexPwmFault3 

Fault 3 input pin.

Enumerator
kCaptureDisable 

Disabled.

kCaptureFallingEdges 

Capture falling edges.

kCaptureRisingEdges 

Capture rising edges.

kCaptureAnyEdges 

Capture any edge.

Enumerator
kFlexPwmUsePwm 

Generated PWM signal is used by the deadtime logic.

kFlexPwmInvertedPwm 

Inverted PWM signal is used by the deadtime logic.

kFlexPwmSoftwareControl 

Software controlled value is used by the deadtime logic.

kFlexPwmUseExternal 

PWM_EXTA signal is used by the deadtime logic.

Enumerator
kFlexPwmIndependent 

PWM A & PWM B operation as 2 independent channels.

kFlexPwmComplementaryPwmA 

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

kFlexPwmComplementaryPwmB 

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

Enumerator
kFlexPwmReloadImmediate 

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

kFlexPwmReloadPwmHalfCycle 

Registers loaded on a PWM half cycle.

kFlexPwmReloadPwmFullCycle 

Registers loaded on a PWM full cycle.

kFlexPwmReloadPwmHalfAndFullCycle 

Registers loaded on a PWM half & full cycle.

Enumerator
kFlexPwmNoRecovery 

PWM output will stay inactive.

kFlexPwmRecoverHalfCycle 

PWM output re-enabled at the first half cycle.

kFlexPwmRecoverFullCycle 

PWM output re-enabled at the first full cycle.

kFlexPwmRecoverHalfAndFullCycle 

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

Enumerator
kFlexPwmCompareVal0Event 

PWM VAL0 compare event.

kFlexPwmCompareVal1Event 

PWM VAL1 compare event.

kFlexPwmCompareVal2Event 

PWM VAL2 compare event.

kFlexPwmCompareVal3Event 

PWM VAL3 compare event.

kFlexPwmCompareVal4Event 

PWM VAL4 compare event.

kFlexPwmCompareVal5Event 

PWM VAL5 compare event.

kFlexPwmCaptureX0Event 

PWM capture X0 event.

kFlexPwmCaptureX1Event 

PWM capture X1 event.

kFlexPwmCaptureB0Event 

PWM capture B0 event.

kFlexPwmCaptureB1Event 

PWM capture B1 event.

kFlexPwmCaptureA0Event 

PWM capture A0 event.

kFlexPwmCaptureA1Event 

PWM capture A1 event.

kFlexPwmReloadEvent 

PWM reload event.

kFlexPwmReloadErrorEvent 

PWM reload error event.

kFlexPwmFault0Event 

PWM fault 0 event.

kFlexPwmFault1Event 

PWM fault 1 event.

kFlexPwmFault2Event 

PWM fault 2 event.

kFlexPwmFault3Event 

PWM fault 3 event.

Function Documentation

void PWM_HAL_Init ( PWM_Type *  base)

Set the control registers to their reset state

Parameters
baseBase address pointer of eflexPWM module
void PWM_HAL_SetupPwmSubModule ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_module_setup_t setupParams 
)

Flex PWM has 4 sub-modules. This function sets up the key features that configure each sub-module. This function sets up the following:

  1. Clock source and clock prescaler
  2. Submodules PWM A & PWM B signals operation (independent or complementary)
  3. Reload logic to use and reload frequency
  4. Force trigger to use to generate the FORCE_OUT signal.
Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
setupParamsParameters passed in to set up the submodule
void PWM_HAL_SetupFaults ( PWM_Type *  base,
pwm_fault_input_t  faultNum,
pwm_fault_setup_t setupParams 
)

Flex PWM has 4 fault inputs. This function sets up each fault as follows:

  1. Fault automatic clearing function
  2. Sets up the fault level
  3. Defines if the fault filter should be used for this fault input
  4. Recovery mode to be used to re-enable the PWM output
Parameters
baseBase address pointer of eflexPWM module
faultNumis a number of the PWM fault to configure.
setupParamsParameters passed in to set up the fault
void PWM_HAL_SetupCapture ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_module_signal_t  pwmSignal,
pwm_capture_setup_t setupParams 
)

Each PWM submodule has 3 pins can be configured to use for capture. This function sets up the capture for each pin as follows:

  1. Whether to use the edge counter or raw input
  2. Edge capture mode
  3. One-shot or continuous
Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
pwmSignalWhich signal in the submodule to setup
setupParamsParameters passed in to set up the input pin
uint16_t PWM_HAL_GetCaptureValReg ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_val_regs_t  cmpReg 
)

Reads one of the 6 capture value registers.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
cmpRegis a number of value compare register to get
Returns
PWM value register
void PWM_HAL_SetValReg ( PWM_Type *  base,
uint8_t  subModuleNum,
pwm_val_regs_t  valReg,
uint16_t  val 
)

Sets one of the 6 value registers.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
valRegis the number of the value register to be set
valis a number of value to write
void PWM_HAL_SetupForceSignal ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_module_signal_t  pwmSignal,
pwm_force_signal_t  mode 
)

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

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
pwmSignalspecifies which signal to work with in the module
modesignal to output when a FORCE_OUT is triggered
void PWM_HAL_EnableInterrupts ( PWM_Type *  base,
pwm_module_t  subModuleNum,
uint32_t  eventmask 
)

The user can pass in an OR'ed list of PWM interrupts to enable. The list of PWM interrupts is available in the enum pwm_event_t.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
eventmaskOR'ed list of interrupts to enable
void PWM_HAL_DisableInterrupts ( PWM_Type *  base,
pwm_module_t  subModuleNum,
uint32_t  eventmask 
)

The user can pass in an OR'ed list of PWM interrupts to disable. The list of PWM interrupts is available in the enum pwm_event_t.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
eventmaskOR'ed list of interrupts to disable
void PWM_HAL_ClearStatus ( PWM_Type *  base,
pwm_module_t  subModuleNum,
uint32_t  eventmask 
)

The user can pass in an OR'ed list of status flags to clear. The list of PWM interrupts is available in the enum pwm_event_t.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
eventmaskOR'ed list of status flags to clear
static uint16_t PWM_HAL_GetCounter ( PWM_Type *  base,
pwm_module_t  subModuleNum 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
Returns
current PWM counter value
static void PWM_HAL_SetCounterInitVal ( PWM_Type *  base,
pwm_module_t  subModuleNum,
uint16_t  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
valinitial value to be set
static void PWM_HAL_SetForceCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
bool  val 
)
inlinestatic

This function enables/disables the force initialization logic and asserts/deasserts the FORCE signal.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
valtrue to enable, false to disable.
static void PWM_HAL_SetOutputPolarityPwmBCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
bool  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
valtrue to set inverted output, false to set non inverted output.
static void PWM_HAL_SetOutputPolarityPwmACmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
bool  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
valtrue to set inverted output, false to set non inverted output.
static void PWM_HAL_SetOutputPolarityPwmXCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
bool  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
valtrue to set inverted output, false to set non inverted output.
static void PWM_HAL_SetOutputTriggerCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
uint8_t  valueReg,
bool  val 
)
inlinestatic

There are 2 triggers available per PWM submodule. This function allows the user to activate a trigger when the counter matches one of the 6 value registers. Enabling VAL0, VAL2, or VAL4 outputs a trigger on a match on TRIG0. Enabling VAL1, VAL3, VAL5 outputs a trigger on a match on TRIG1.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
valueRegregister that is the cause for the output triger.
valtrue to trigger enable, false to disable.
static void PWM_HAL_SetPwmAFaultInputCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_fault_input_t  fault,
bool  val 
)
inlinestatic

Enabling the specified fault causes the PWM A signal to deactivate when the fault occurs. The user should configure the PWM faults by calling the PWM_HAL_SetupFaults() function prior to enabling them in the submodules.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
faultnumber, options: 0,1,2,3 .
valtrue to enable the fault input, false to disable fault input.
static void PWM_HAL_SetPwmBFaultInputCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_fault_input_t  fault,
bool  val 
)
inlinestatic

Enabling the specified fault causes the PWM B signal to deactivate when the fault occurs. The user should configure the PWM faults by calling the PWM_HAL_SetupFaults() function prior to enabling them in the submodules.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
faultnumber, options: 0,1,2,3 .
valtrue to enable the fault input, false to disable fault input.
static void PWM_HAL_SetPwmXFaultInputCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_fault_input_t  fault,
bool  val 
)
inlinestatic

Enabling the specified fault causes the PWM X signal to deactivate when the fault occurs. The user should configure the PWM faults by calling the PWM_HAL_SetupFaults() function prior to enabling them in the submodules.

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
faultnumber, options: 0,1,2,3.
valtrue to enable the fault input; false to disable the fault input
static void PWM_HAL_SetOutputPwmXCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
bool  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumNumber of the PWM submodule.
valtrue to make the pin as output output, false to make the pin as input
static void PWM_HAL_SetOutputPwmBCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
bool  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumNumber of the PWM submodule.
valtrue to make the pin as output output, false to make the pin as input
static void PWM_HAL_SetOutputPwmACmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
bool  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModuleNumNumber of the PWM submodule.
valtrue to make the pin as output output, false to make the pin as input
static void PWM_HAL_SetSwCtrlOutCmd ( PWM_Type *  base,
pwm_module_t  subModuleNum,
pwm_module_signal_t  output,
bool  val 
)
inlinestatic

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

Parameters
baseBase address pointer of eflexPWM module
subModuleNumis a number of the PWM submodule.
outputspecifies which signal to work with in the module, 0 is PWM B, 1 is PWM A
valtrue to supply a logic 1, false to supply a logic 0.
static void PWM_HAL_SetPwmRunCmd ( PWM_Type *  base,
uint8_t  subModules,
bool  val 
)
inlinestatic
Parameters
baseBase address pointer of eflexPWM module
subModulesrepresented by corresponded bits.
valtrue to run selected subModuleNums, false to stop selected subModuleNums output.