eFlexPwm
Arduino eFlexPwm library for Teensy 4.x
|
Submodule. More...
#include <eFlexPwmSubmodule.h>
Public Member Functions | |
SubModule (int pinChanA, int pinChanB=-1) | |
Construct a new SubModule object. More... | |
bool | isValid () const |
Checks the validity of the parameters passed to the constructor. More... | |
bool | configure (const Config &config) |
Configures the peripheral for basic operation. More... | |
const Config & | config () const |
Current configuration. | |
bool | begin (bool doStart=true, bool doSync=true) |
Sets up the PWM signals for a PWM submodule. More... | |
void | enable (bool value=true) |
Enable or disable the submodule. More... | |
void | disable () |
Disable the submodule. More... | |
bool | isEnabled () const |
Returns true if the outputsof submodule were enabled. | |
void | start (bool value=true) |
Starts the PWM counter for this submodule. More... | |
void | stop () |
Stops the PWM counter for this submodule. | |
void | setPwmLdok (bool value=true) |
Sets or clears the PWM LDOK bit on all instantiated submodules for this timer. More... | |
Timer & | timer () |
Returns the parent PWM module. | |
uint8_t | index () const |
Returns the Submodule index (0 for Submodule0...) | |
bool | setPwmFrequency (uint32_t freq, bool doSync=true, bool adjustPrescaler=false) |
Set the Pwm Frequency. More... | |
uint32_t | pwmFrequency () const |
Current PWM signal frequency in Hz. More... | |
bool | setPwmMode (pwm_mode_t mode, bool doSync=true) |
Set the Pwm operation mode. More... | |
pwm_mode_t | pwmMode () const |
Current PWM signal frequency in Hz. More... | |
void | setupOutputEnable (Channel channel, bool activate=true) |
Setting output enable before calling begin. More... | |
void | setupOutputEnable (bool activate=true) |
Setting output enable for all channels before calling begin. More... | |
bool | outputEnableSetting (Channel channel) |
value of the parameter set by setupOutputEnable (Channel, bool) More... | |
void | setupDutyCyclePercent (Channel channel, uint8_t dutyCyclePercent) |
Setting the duty cycle before calling begin. More... | |
void | setupDutyCyclePercent (uint8_t dutyCyclePercent) |
Setting the duty cycle for all channels before calling begin. More... | |
uint8_t | dutyCyclePercentSetting (Channel channel) |
value of the parameter set by setupDutyCyclePercent (Channel, uint8_t) More... | |
void | setupLevel (Channel channel, pwm_level_select_t level) |
Setting the output pulse mode before calling begin. More... | |
void | setupLevel (pwm_level_select_t level) |
Setting the output pulse mode for all channels before calling begin. More... | |
pwm_level_select_t | levelSetting (Channel channel) |
value of the parameter set by setupLevel (Channel, pwm_level_select_t) More... | |
void | setupDeadtime (Channel channel, uint16_t deadtimeValue, uint32_t unit=1) |
Setting the deadtime before calling begin. More... | |
void | setupDeadtime (uint16_t deadtimeValue, uint32_t unit=1) |
Setting the deadtime for all channels before calling begin. More... | |
uint16_t | deadtimeSetting (Channel channel) |
value of the parameter set by setupDeadtime (Channel, uint16_t) More... | |
void | setupFaultState (Channel channel, pwm_fault_state_t faultState) |
Setting the output fault status before calling begin. More... | |
void | setupFaultState (pwm_fault_state_t faultState) |
Setting the output fault status for all channels before calling begin. More... | |
pwm_fault_state_t | faultStateSetting (Channel channel) |
value of the parameter set by setupFaultState (Channel, pwm_fault_state_t) More... | |
bool | updateSetting (bool doSync=true) |
Update PWM signals for a PWM submodule. More... | |
void | setInitValue (uint16_t value) |
Set the PWM INIT register. More... | |
void | setVal0Value (uint16_t value) |
Set the PWM VAL0 register. More... | |
void | setVal1Value (uint16_t value) |
Set the PWM VAL1 register. More... | |
void | setVal2Value (uint16_t value) |
Set the PWM VAL2 register. More... | |
void | setVal3Value (uint16_t value) |
Set the PWM VAL3 register. More... | |
void | setVal4Value (uint16_t value) |
Set the PWM VAL4 register. More... | |
void | setVal5Value (uint16_t value) |
Set the PWM VAL5 register. More... | |
uint16_t | initValue () |
Get the PWM INIT register. More... | |
uint16_t | val0Value () |
Get the PWM VAL1 register. More... | |
uint16_t | val1Value () |
Get the PWM VAL1 register. More... | |
uint16_t | val2Value () |
Get the PWM VAL2 register. More... | |
uint16_t | val3Value () |
Get the PWM VAL3 register. More... | |
uint16_t | val4Value () |
Get the PWM VAL4 register. More... | |
uint16_t | val5Value () |
Get the PWM VAL5 register. More... | |
void | printRegs (Stream &out=Serial) |
Print submodule registers to stream out. More... | |
void | updateDutyCyclePercent (uint8_t dutyCyclePercent, Channel channel=ChanA) |
Updates the PWM signal's dutycycle. More... | |
void | updateDutyCycle (uint16_t dutyCycle, Channel channel=ChanA) |
Updates the PWM signal's dutycycle with 16-bit accuracy. More... | |
bool | setupPwmPhaseShift (Channel channel, uint8_t shiftvalue, bool doSync=true) |
Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle.. More... | |
void | setupInputCapture (Channel channel, const pwm_input_capture_param_t *inputCaptureParams) |
Sets up the PWM input capture. More... | |
void | setupForceSignal (Channel channel, pwm_force_signal_t mode) |
Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. More... | |
uint32_t | statusFlags () |
Gets the PWM status flags. More... | |
void | clearStatusFlags (uint32_t mask) |
Clears the PWM status flags. More... | |
void | enableInterrupts (uint32_t mask) |
Enables the selected PWM interrupts. More... | |
void | disableInterrupts (uint32_t mask) |
Disables the selected PWM interrupts. More... | |
uint32_t | enabledInterrupts () |
Gets the enabled PWM interrupts. More... | |
void | setDMAWatermarkControl (pwm_watermark_control_t pwm_watermark_control) |
Capture DMA Enable Source Select. More... | |
void | setDMACaptureSourceSelect (pwm_dma_source_select_t pwm_dma_source_select) |
Capture DMA Enable Source Select. More... | |
void | enableDMACapture (uint16_t mask, bool activate=true) |
Enables or disables the selected PWM DMA Capture read request. More... | |
void | enableDMAWrite (bool activate) |
Enables or disables the PWM DMA write request. More... | |
void | setVALxValue (pwm_value_register_t valueRegister, uint16_t value) |
Set the PWM VALx registers. More... | |
uint16_t | VALxValue (pwm_value_register_t valueRegister) |
Get the PWM VALx registers. More... | |
void | enableOutputTrigger (pwm_value_register_t valueRegister, bool activate=true) |
Enables or disables the PWM output trigger. More... | |
void | enableOutputTrigger (uint16_t valueRegisterMask) |
Enables the PWM output trigger. More... | |
void | disableOutputTrigger (uint16_t valueRegisterMask) |
Disables the PWM output trigger. More... | |
void | setupSwCtrlOut (Channel channel, bool value) |
Sets the software control output for a pin to high or low. More... | |
void | setPwmFaultState (Channel channel, pwm_fault_state_t faultState) |
Set PWM output fault status. More... | |
void | setupFaultDisableMap (Channel channel, pwm_fault_channels_t pwm_fault_channels, uint16_t value) |
Set PWM fault disable mapping. More... | |
void | enableOutput (Channel channel) |
Set PWM output enable. More... | |
void | disableOutput (Channel channel) |
Set PWM output disable. More... | |
uint8_t | dutyCyclePercent (Channel channel) |
Get the dutycycle value. More... | |
bool | setOutputToIdle (Channel channel, bool idleStatus) |
Set PWM output in idle status (high or low). More... | |
void | setPrescaler (pwm_clock_prescale_t prescaler) |
Set the pwm submodule prescaler. More... | |
void | setClockMode (pwm_clock_prescale_t prescaler) |
Set the pwm submodule prescaler. More... | |
pwm_clock_prescale_t | prescaler () const |
the pwm submodule prescaler | |
void | setPwmForceOutputToZero (Channel channel, bool forcetozero) |
This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. More... | |
void | setChannelOutput (Channel channel, pwm_output_state_t outputstate) |
This function set the output state of the PWM pin as requested for the current cycle. More... | |
uint32_t | minPwmFrequency () const |
Current minimal PWM frequency in Hz. More... | |
bool | adjustPrescaler (uint32_t pwmFreq) |
Adjust the prescaler if necessary. More... | |
Submodule.
This class is used to perform most operations.
Definition at line 20 of file eFlexPwmSubmodule.h.
eFlex::SubModule::SubModule | ( | int | pinChanA, |
int | pinChanB = -1 |
||
) |
Construct a new SubModule object.
If the pin is valid (eFlexPwm type), its channel is configured with default values: pwmchannelenable = true; level = kPWM_HighTrue; dutyCyclePercent = 50; deadtimeValue = 0; faultState = kPWM_PwmFaultState0;
pinChanA | Arduino pin number of output A, this pin must correspond to an output A (23) of an eFlexPWM sub-module (refer to the datasheet) |
pinChanB | Arduino pin number of output B, this pin must correspond to output B (45) of the same submodule as pinA (refer to datasheet) |
bool eFlex::SubModule::adjustPrescaler | ( | uint32_t | pwmFreq | ) |
Adjust the prescaler if necessary.
Checks if pwmFreq is less than the minPwmFrequency() and increases the prescaler if necessary. Otherwise and if the prescaler is greater than 1, try to reduce it to the minimum.
pwmFreq | the desired PWM frequency |
bool eFlex::SubModule::begin | ( | bool | doStart = true , |
bool | doSync = true |
||
) |
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.
doStart | starts signal generation |
doSync | synchronizes the operation by surrounding it with setPwmLdok (false) / setPwmLdok (true) |
|
inline |
Clears the PWM status flags.
mask | The status flags to clear. This is a logical OR of members of the enumeration pwm_status_flags_t |
Definition at line 654 of file eFlexPwmSubmodule.h.
bool eFlex::SubModule::configure | ( | const Config & | config | ) |
Configures the peripheral for basic operation.
config | Reference to user's PWM config structure. |
|
inline |
value of the parameter set by setupDeadtime (Channel, uint16_t)
channel | PWM channel to read; ChanA or ChanB |
Definition at line 333 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::deadtimeValue.
|
inline |
Disable the submodule.
This function allows you to disable the output pins without changing anything in the configuration. When the submodule is disabled, its output pins are forced to zero.
Definition at line 101 of file eFlexPwmSubmodule.h.
References enable().
|
inline |
Disables the selected PWM interrupts.
mask | The interrupts to enable. This is a logical OR of members of the enumeration pwm_interrupt_enable_t |
Definition at line 674 of file eFlexPwmSubmodule.h.
|
inline |
Set PWM output disable.
This feature allows the user to disable the PWM output.
channel | PWM channel to configure |
Definition at line 852 of file eFlexPwmSubmodule.h.
|
inline |
Disables the PWM output trigger.
This function allows the user to disables one or more (VAL0-5) PWM trigger.
valueRegisterMask | Value register mask that will Deactivate one or more (VAL0-5) trigger enumeration _pwm_value_register_mask |
Definition at line 785 of file eFlexPwmSubmodule.h.
|
inline |
Get the dutycycle value.
channel | PWM channel to configure |
Definition at line 863 of file eFlexPwmSubmodule.h.
Referenced by setupDutyCyclePercent(), and updateDutyCyclePercent().
|
inline |
value of the parameter set by setupDutyCyclePercent (Channel, uint8_t)
channel | PWM channel to read; ChanA or ChanB |
Definition at line 260 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::dutyCyclePercent.
void eFlex::SubModule::enable | ( | bool | value = true | ) |
Enable or disable the submodule.
This function allows you to enable/disable the output pins without changing anything in the configuration. When the submodule is disabled, its output pins are forced to zero.
value | true to enable, false otherwise |
Referenced by disable().
|
inline |
Gets the enabled PWM interrupts.
Definition at line 684 of file eFlexPwmSubmodule.h.
|
inline |
Enables or disables the selected PWM DMA Capture read request.
mask | The DMA to enable or disable. This is a logical OR of members of the enumeration pwm_dma_enable_t |
activate | true: Enable DMA read request; false: Disable DMA read request |
Definition at line 713 of file eFlexPwmSubmodule.h.
|
inline |
Enables or disables the PWM DMA write request.
activate | true: Enable DMA write request; false: Disable DMA write request |
Definition at line 722 of file eFlexPwmSubmodule.h.
|
inline |
Enables the selected PWM interrupts.
mask | The interrupts to enable. This is a logical OR of members of the enumeration pwm_interrupt_enable_t |
Definition at line 664 of file eFlexPwmSubmodule.h.
|
inline |
Set PWM output enable.
This feature allows the user to enable the PWM Output.
channel | PWM channel to configure |
Definition at line 841 of file eFlexPwmSubmodule.h.
|
inline |
Enables or disables the PWM output trigger.
This function allows the user to enable or disable the PWM trigger. The PWM has 2 triggers. Trigger 0 is activated when the counter matches VAL 0, VAL 2, or VAL 4 register. Trigger 1 is activated when the counter matches VAL 1, VAL 3, or VAL 5 register.
valueRegister | Value register that will activate the trigger |
activate | true: Enable the trigger; false: Disable the trigger |
Definition at line 761 of file eFlexPwmSubmodule.h.
|
inline |
Enables the PWM output trigger.
This function allows the user to enable one or more (VAL0-5) PWM trigger.
valueRegisterMask | Value register mask that will activate one or more (VAL0-5) trigger enumeration _pwm_value_register_mask |
Definition at line 773 of file eFlexPwmSubmodule.h.
|
inline |
value of the parameter set by setupFaultState (Channel, pwm_fault_state_t)
channel | PWM channel to read; ChanA or ChanB |
Definition at line 367 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::faultState.
|
inline |
Get the PWM INIT register.
Definition at line 489 of file eFlexPwmSubmodule.h.
bool eFlex::SubModule::isValid | ( | ) | const |
Checks the validity of the parameters passed to the constructor.
false otherwise
|
inline |
value of the parameter set by setupLevel (Channel, pwm_level_select_t)
channel | PWM channel to read; ChanA or ChanB |
Definition at line 292 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::level.
|
inline |
Current minimal PWM frequency in Hz.
this value is calculated by configure() and updated by setPrescaler()
Definition at line 936 of file eFlexPwmSubmodule.h.
|
inline |
value of the parameter set by setupOutputEnable (Channel, bool)
channel | PWM channel to read; ChanA or ChanB |
Definition at line 227 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::pwmchannelenable.
void eFlex::SubModule::printRegs | ( | Stream & | out = Serial | ) |
Print submodule registers to stream out.
out | the output stream, Serial by default |
|
inline |
Current PWM signal frequency in Hz.
Definition at line 170 of file eFlexPwmSubmodule.h.
References config(), and eFlex::Config::pwmFreqHz().
|
inline |
Current PWM signal frequency in Hz.
Definition at line 194 of file eFlexPwmSubmodule.h.
References config(), and eFlex::Config::mode().
|
inline |
This function set the output state of the PWM pin as requested for the current cycle.
channel | PWM channel to configure |
outputstate | Set pwm output state, see pwm_output_state_t. |
Definition at line 927 of file eFlexPwmSubmodule.h.
|
inline |
Set the pwm submodule prescaler.
prescaler | Set prescaler value |
Definition at line 899 of file eFlexPwmSubmodule.h.
References prescaler(), and setPrescaler().
|
inline |
Capture DMA Enable Source Select.
pwm_dma_source_select | PWM capture DMA enable source select |
Definition at line 702 of file eFlexPwmSubmodule.h.
|
inline |
Capture DMA Enable Source Select.
pwm_watermark_control | PWM FIFO watermark and control |
Definition at line 693 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM INIT register.
This function allows the user to write value into registers directly. And it will destroying the PWM clock period set by the begin()/updateSetting()/setupPwmPhaseShift() functions. Due to the registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
value | Value that will been write into register |
Definition at line 396 of file eFlexPwmSubmodule.h.
|
inline |
Set PWM output in idle status (high or low).
channel | PWM channel to configure |
idleStatus | true: PWM output is high in idle status; false: PWM output is low in idle status. |
Definition at line 877 of file eFlexPwmSubmodule.h.
|
inline |
Set the pwm submodule prescaler.
prescaler | Set prescaler value |
Definition at line 886 of file eFlexPwmSubmodule.h.
References prescaler(), eFlex::Timer::prescalerToMinPwmFrequency(), and eFlex::Config::setPrescale().
Referenced by setClockMode().
|
inline |
Set PWM output fault status.
These bits determine the fault state for the PWM_A output in fault conditions and STOP mode. It may also define the output state in WAIT and DEBUG modes depending on the settings of CTRL2[WAITEN] and CTRL2[DBGEN]. This function can update PWM output fault status.
channel | Channel to configure |
faultState | PWM output fault status |
Definition at line 813 of file eFlexPwmSubmodule.h.
|
inline |
This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0.
channel | PWM channel to configure |
forcetozero | true: Enable the pwm force output to zero; false: Disable the pwm output resumes normal function. |
Definition at line 917 of file eFlexPwmSubmodule.h.
bool eFlex::SubModule::setPwmFrequency | ( | uint32_t | freq, |
bool | doSync = true , |
||
bool | adjustPrescaler = false |
||
) |
Set the Pwm Frequency.
freq | PWM signal frequency in Hz |
doSync | true : Set LDOK bit for the submodule; false: LDOK bit don't set, need to call setPwmLdok to sync update. |
adjustPrescaler | false: no change prescaler, if freq is less than minPwmFrequency(), nothing is done and false is returned; true: calls adjustPrescaler() to try to adjust the prescaler, the prescaler is adjusted if possible, otherwise, false is returned. |
|
inline |
Sets or clears the PWM LDOK bit on all instantiated submodules for this timer.
begin()
was called with doSync=truevalue | true: Set LDOK bit for the submodule list; false: Clear LDOK bit |
Definition at line 134 of file eFlexPwmSubmodule.h.
References index(), eFlex::Timer::setPwmLdok(), and timer().
|
inline |
Set the Pwm operation mode.
mode | PWM operation mode |
doSync | true: Set LDOK bit for the submodule; false: LDOK bit don't set, need to call setPwmLdok to sync update. |
Definition at line 184 of file eFlexPwmSubmodule.h.
References eFlex::Config::setMode(), and updateSetting().
|
inline |
Setting the deadtime before calling begin.
channel | PWM channel being setting; ChanA or ChanB |
deadtimeValue | The deadtime value in clock cycles; only used if channel pair is operating in complementary mode |
unit | The unit of the deadtimeValue; 1: clock cycles; 1000: milliseconds; 1000000: microseconds; 1000000000: nanoseconds |
Definition at line 305 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::deadtimeValue, eFlex::Timer::srcClockHz(), and timer().
Referenced by setupDeadtime().
|
inline |
Setting the deadtime for all channels before calling begin.
deadtimeValue | The deadtime value in clock cycles; only used if channel pair is operating in complementary mode |
unit | The unit of the deadtimeValue; 1: clock cycles; 1000: milliseconds; 1000000: microseconds; 1000000000: nanoseconds |
Definition at line 322 of file eFlexPwmSubmodule.h.
References setupDeadtime().
|
inline |
Setting the duty cycle before calling begin.
channel | PWM channel being setting; ChanA or ChanB |
dutyCyclePercent | duty cycle in percent |
Definition at line 239 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::dutyCyclePercent, and dutyCyclePercent().
Referenced by setupDutyCyclePercent().
|
inline |
Setting the duty cycle for all channels before calling begin.
dutyCyclePercent | duty cycle in percent |
Definition at line 249 of file eFlexPwmSubmodule.h.
References dutyCyclePercent(), and setupDutyCyclePercent().
|
inline |
Set PWM fault disable mapping.
Each of the four bits of this read/write field is one-to-one associated with the four FAULTx inputs of fault channel 0/1. The PWM output will be turned off if there is a logic 1 on an FAULTx input and a 1 in the corresponding bit of this field. A reset sets all bits in this field.
channel | PWM channel to configure |
pwm_fault_channels | PWM fault channel to configure |
value | Fault disable mapping mask value enumeration pwm_fault_disable_t |
Definition at line 830 of file eFlexPwmSubmodule.h.
|
inline |
Setting the output fault status before calling begin.
channel | PWM channel being setting; ChanA or ChanB |
faultState | the output fault status |
Definition at line 345 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::faultState.
Referenced by setupFaultState().
|
inline |
Setting the output fault status for all channels before calling begin.
faultState | the output fault status |
Definition at line 356 of file eFlexPwmSubmodule.h.
References setupFaultState().
|
inline |
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.
channel | Channel to configure |
mode | Signal to output when a FORCE_OUT is triggered |
Definition at line 634 of file eFlexPwmSubmodule.h.
|
inline |
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.
channel | Channel in the submodule to setup |
inputCaptureParams | Parameters passed in to set up the input pin |
Definition at line 621 of file eFlexPwmSubmodule.h.
|
inline |
Setting the output pulse mode before calling begin.
channel | PWM channel being setting; ChanA or ChanB |
level | output pulse mode |
Definition at line 271 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::level.
Referenced by setupLevel().
|
inline |
Setting the output pulse mode for all channels before calling begin.
level | output pulse mode |
Definition at line 281 of file eFlexPwmSubmodule.h.
References setupLevel().
|
inline |
Setting output enable for all channels before calling begin.
activate | true to enable the outputs |
Definition at line 216 of file eFlexPwmSubmodule.h.
References setupOutputEnable().
|
inline |
Setting output enable before calling begin.
channel | PWM channel being setting; ChanA or ChanB |
activate | true to enable the output |
Definition at line 205 of file eFlexPwmSubmodule.h.
References _pwm_signal_param::pwmchannelenable.
Referenced by setupOutputEnable().
|
inline |
Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle..
channel | PWM channel to configure |
shiftvalue | Phase shift value |
doSync | true: Set LDOK bit for the submodule list; false: LDOK bit don't set, need to call setPwmLdok to sync update. |
Definition at line 607 of file eFlexPwmSubmodule.h.
References eFlex::Config::pwmFreqHz(), and timer().
|
inline |
Sets the software control output for a pin to high or low.
The user specifies which channel to modify by supplying the submodule number and whether to modify PWM A or PWM B within that submodule.
channel | Channel to configure |
value | true: Supply a logic 1, false: Supply a logic 0. |
Definition at line 798 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM VAL0 register.
This function allows the user to write value into registers directly. And it will destroying the PWM clock period set by the begin()/updateSetting()/setupPwmPhaseShift() functions. Due to the registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
value | Value that will been write into register |
Definition at line 410 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM VAL1 register.
This function allows the user to write value into registers directly. And it will destroying the PWM clock period set by the begin()/updateSetting()/setupPwmPhaseShift() functions. Due to the registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
value | Value that will been write into register |
Definition at line 424 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM VAL2 register.
This function allows the user to write value into registers directly. And it will destroying the PWM clock period set by the begin()/updateSetting()/setupPwmPhaseShift() functions. Due to the registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
value | Value that will been write into register |
Definition at line 438 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM VAL3 register.
This function allows the user to write value into registers directly. And it will destroying the PWM clock period set by the begin()/updateSetting()/setupPwmPhaseShift() functions. Due to the registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
value | Value that will been write into register |
Definition at line 452 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM VAL4 register.
This function allows the user to write value into registers directly. And it will destroying the PWM clock period set by the begin()/updateSetting()/setupPwmPhaseShift() functions. Due to the registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
value | Value that will been write into register |
Definition at line 466 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM VAL5 register.
This function allows the user to write value into registers directly. And it will destroying the PWM clock period set by the begin()/updateSetting()/setupPwmPhaseShift() functions. Due to the registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
value | Value that will been write into register |
Definition at line 480 of file eFlexPwmSubmodule.h.
|
inline |
Set the PWM VALx registers.
This function allows the user to write value into VAL registers directly. And it will destroying the PWM clock period set by the setupPwm()/PWM_SetupPwmPhaseShift() functions. Due to VALx registers are bufferd, the new value will not active uless call setPwmLdok() and the reload point is reached.
valueRegister | VALx register that will be writen new value |
value | Value that will been write into VALx register |
Definition at line 737 of file eFlexPwmSubmodule.h.
|
inline |
Starts the PWM counter for this submodule.
begin()
was called with doStart=true Definition at line 115 of file eFlexPwmSubmodule.h.
References index(), eFlex::Timer::start(), and timer().
Referenced by stop().
|
inline |
Gets the PWM status flags.
Definition at line 644 of file eFlexPwmSubmodule.h.
|
inline |
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.
channel | Channel (PWM A or PWM B) to update |
dutyCycle | New PWM pulse width, value should be between 0 to 65535 0=inactive signal(0% duty cycle)... 65535=active signal (100% duty cycle) |
Definition at line 591 of file eFlexPwmSubmodule.h.
|
inline |
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.
channel | Channel (PWM A or PWM B) to update |
dutyCyclePercent | New PWM pulse width, value should be between 0 to 100 0=inactive signal(0% duty cycle)... 100=active signal (100% duty cycle) |
Definition at line 571 of file eFlexPwmSubmodule.h.
References dutyCyclePercent(), and eFlex::reloadValue().
bool eFlex::SubModule::updateSetting | ( | bool | doSync = true | ) |
Update 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.
doSync | true: Set LDOK bit for the submodule; false: LDOK bit don't set, need to call setPwmLdok to sync update. |
Referenced by setPwmMode().
|
inline |
Get the PWM VAL1 register.
Definition at line 498 of file eFlexPwmSubmodule.h.
|
inline |
Get the PWM VAL1 register.
Definition at line 507 of file eFlexPwmSubmodule.h.
|
inline |
Get the PWM VAL2 register.
Definition at line 516 of file eFlexPwmSubmodule.h.
|
inline |
Get the PWM VAL3 register.
Definition at line 525 of file eFlexPwmSubmodule.h.
|
inline |
Get the PWM VAL4 register.
Definition at line 534 of file eFlexPwmSubmodule.h.
|
inline |
Get the PWM VAL5 register.
Definition at line 543 of file eFlexPwmSubmodule.h.
|
inline |
Get the PWM VALx registers.
valueRegister | VALx register that will be read value |
Definition at line 747 of file eFlexPwmSubmodule.h.