eFlexPwm
Arduino eFlexPwm library for Teensy 4.x
eFlex::Config

Configuration. More...

#include <eFlexPwmConfig.h>

Collaboration diagram for eFlex::Config:

Public Member Functions

 Config ()
 Construct a new Config object with the default settings. More...
 
void setPwmFreqHz (uint32_t pwmFreqHz)
 Set the PWM signal frequency in Hz.
 
uint32_t pwmFreqHz () const
 PWM signal frequency in Hz, default 5000.
 
void setMode (pwm_mode_t mode)
 Set the PWM operation mode.
 
pwm_mode_t mode () const
 PWM operation mode, default CenterAligned.
 
void setReloadSelect (pwm_reload_source_select_t reloadSelect)
 Set the reload source select.
 
pwm_reload_source_select_t reloadSelect () const
 Option to initialize the counter, default kPWM_LocalReload.
 
void setClockSource (pwm_clock_source_t clockSource)
 Select the Clock source for the counter.
 
pwm_clock_source_t clockSource () const
 Clock source for the counter, default kPWM_BusClock.
 
void setPrescale (pwm_clock_prescale_t prescale)
 Set the Pre-scaler to divide down the clock.
 
pwm_clock_prescale_t prescale () const
 Pre-scaler to divide down the clock, default kPWM_Prescale_Divide_1.
 
void setInitializationControl (pwm_init_source_t initializationControl)
 Set the Option to initialize the counter.
 
pwm_init_source_t initializationControl () const
 Reload source select, default kPWM_Initialize_LocalSync.
 
void setForceTrigger (pwm_force_output_trigger_t forceTrigger)
 Specify which signal will trigger a FORCE_OUT.
 
pwm_force_output_trigger_t forceTrigger () const
 Specify which signal will trigger a FORCE_OUT, default kPWM_Force_Local.
 
void setReloadFrequency (pwm_load_frequency_t reloadFrequency)
 Specifies when to reload.
 
pwm_load_frequency_t reloadFrequency () const
 Specifies when to reload, default kPWM_LoadEveryOportunity. More...
 
void setReloadLogic (pwm_register_reload_t reloadLogic)
 Set the PWM Reload logic setup.
 
pwm_register_reload_t reloadLogic () const
 PWM Reload logic setup, default kPWM_ReloadImmediate.
 
void setPairOperation (pwm_chnl_pair_operation_t pairOperation)
 Set the channel pair in indepedent or complementary mode.
 
pwm_chnl_pair_operation_t pairOperation () const
 Channel pair in indepedent or complementary mode, default kPWM_Independent.
 
void enableDebugMode (bool enable)
 enable Debug Mode More...
 
bool debugModeEnabled () const
 Debug mode, default false. More...
 
void enableWaitMode (bool enable)
 enable Wait Mode More...
 
bool waitModeEnabled () const
 Wait mode, default false. More...
 

Detailed Description

Configuration.

Definition at line 20 of file eFlexPwmConfig.h.

Constructor & Destructor Documentation

◆ Config()

eFlex::Config::Config ( )

Construct a new Config object with the default settings.

The default values are:

Member Function Documentation

◆ debugModeEnabled()

bool eFlex::Config::debugModeEnabled ( ) const
inline

Debug mode, default false.

Returns
true PWM continues to run in debug mode
false PWM is paused in debug mode

Definition at line 220 of file eFlexPwmConfig.h.

◆ enableDebugMode()

void eFlex::Config::enableDebugMode ( bool  enable)
inline

enable Debug Mode

Parameters
enabletrue PWM continues to run in debug mode, false PWM is paused in debug mode

Definition at line 209 of file eFlexPwmConfig.h.

◆ enableWaitMode()

void eFlex::Config::enableWaitMode ( bool  enable)
inline

enable Wait Mode

Parameters
enabletrue PWM is paused in debug mode, false PWM is paused in WAIT mode

Definition at line 230 of file eFlexPwmConfig.h.

References _pwm_config::enableWait.

◆ reloadFrequency()

pwm_load_frequency_t eFlex::Config::reloadFrequency ( ) const
inline

Specifies when to reload, default kPWM_LoadEveryOportunity.

used when user's choice is not immediate reload

Definition at line 167 of file eFlexPwmConfig.h.

References _pwm_config::reloadFrequency.

Referenced by setReloadFrequency().

◆ waitModeEnabled()

bool eFlex::Config::waitModeEnabled ( ) const
inline

Wait mode, default false.

Returns
true PWM is paused in debug mode
false PWM is paused in WAIT mode

Definition at line 241 of file eFlexPwmConfig.h.

References _pwm_config::enableWait.