REVLib - C++
rev::spark::SparkMaxConfig Class Reference

#include <SparkMaxConfig.h>

Inherits rev::spark::SparkBaseConfig.

Public Types

enum  DataPortConfig { kInvalid = -1 , kLimitSwitchesAndAbsoluteEncoder = 0 , kAlternateEncoder = 1 }
 
- Public Types inherited from rev::spark::SparkBaseConfig
enum  IdleMode : uint32_t { kCoast = 0 , kBrake = 1 }
 

Public Member Functions

 SparkMaxConfig ()=default
 
 ~SparkMaxConfig () override=default
 
 SparkMaxConfig (const SparkMaxConfig &)=delete
 
SparkMaxConfigoperator= (const SparkMaxConfig &)=delete
 
 SparkMaxConfig (SparkMaxConfig &&) noexcept=delete
 
SparkMaxConfigoperator= (SparkMaxConfig &&) noexcept=delete
 
SparkMaxConfigApply (SparkMaxConfig &config)
 
SparkMaxConfigApply (AlternateEncoderConfig &config)
 
std::string Flatten () override
 
virtual SparkBaseConfigApply (SparkBaseConfig &config)
 
virtual SparkBaseConfigApply (AbsoluteEncoderConfig &config)
 
virtual SparkBaseConfigApply (AnalogSensorConfig &config)
 
virtual SparkBaseConfigApply (EncoderConfig &config)
 
virtual SparkBaseConfigApply (LimitSwitchConfig &config)
 
virtual SparkBaseConfigApply (SoftLimitConfig &config)
 
virtual SparkBaseConfigApply (ClosedLoopConfig &config)
 
virtual SparkBaseConfigApply (SignalsConfig &config)
 
- Public Member Functions inherited from rev::spark::SparkBaseConfig
 SparkBaseConfig ()=default
 
 ~SparkBaseConfig () override=default
 
 SparkBaseConfig (const SparkBaseConfig &)=delete
 
SparkBaseConfigoperator= (const SparkBaseConfig &)=delete
 
 SparkBaseConfig (SparkBaseConfig &&) noexcept=delete
 
SparkBaseConfigoperator= (SparkBaseConfig &&) noexcept=delete
 
virtual SparkBaseConfigSetIdleMode (IdleMode idleMode)
 
virtual SparkBaseConfigInverted (bool inverted)
 
virtual SparkBaseConfigSmartCurrentLimit (int stallLimit, int freeLimit=0, int limitRpm=20000)
 
virtual SparkBaseConfigSecondaryCurrentLimit (double limit, int chopCycles=0)
 
virtual SparkBaseConfigOpenLoopRampRate (double rate)
 
virtual SparkBaseConfigClosedLoopRampRate (double rate)
 
virtual SparkBaseConfigVoltageCompensation (double nominalVoltage)
 
virtual SparkBaseConfigDisableVoltageCompensation ()
 
virtual SparkBaseConfigFollow (int leaderCanId, bool invert=false)
 
virtual SparkBaseConfigFollow (SparkBase &leader, bool invert=false)
 
virtual SparkBaseConfigDisableFollowerMode ()
 
- Public Member Functions inherited from rev::spark::BaseConfig
virtual ~BaseConfig ()=default
 

Public Attributes

AlternateEncoderConfig alternateEncoder
 
- Public Attributes inherited from rev::spark::SparkBaseConfig
AbsoluteEncoderConfig absoluteEncoder
 
AnalogSensorConfig analogSensor
 
ClosedLoopConfig closedLoop
 
EncoderConfig encoder
 
LimitSwitchConfig limitSwitch
 
SignalsConfig signals
 
SoftLimitConfig softLimit
 

Additional Inherited Members

- Protected Types inherited from rev::spark::BaseConfig
using SparkConfig_t = std::variant< int32_t, uint32_t, float, bool >
 
- Protected Member Functions inherited from rev::spark::BaseConfig
 BaseConfig ()=default
 
 BaseConfig (const BaseConfig &)=delete
 
BaseConfigoperator= (const BaseConfig &)=delete
 
 BaseConfig (BaseConfig &&) noexcept=delete
 
BaseConfigoperator= (BaseConfig &&) noexcept=delete
 
template<typename ConfigType >
void PutParameter (uint8_t parameterId, ConfigType value)
 
std::optional< SparkConfig_tGetParameter (uint8_t parameterId)
 
std::optional< SparkConfig_tGetParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void RemoveParameter (uint8_t parameterId)
 
void RemoveParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void Apply (BaseConfig &config)
 

Member Enumeration Documentation

◆ DataPortConfig

Enumerator
kInvalid 
kLimitSwitchesAndAbsoluteEncoder 
kAlternateEncoder 

Constructor & Destructor Documentation

◆ SparkMaxConfig() [1/3]

rev::spark::SparkMaxConfig::SparkMaxConfig ( )
default

◆ ~SparkMaxConfig()

rev::spark::SparkMaxConfig::~SparkMaxConfig ( )
overridedefault

◆ SparkMaxConfig() [2/3]

rev::spark::SparkMaxConfig::SparkMaxConfig ( const SparkMaxConfig )
delete

◆ SparkMaxConfig() [3/3]

rev::spark::SparkMaxConfig::SparkMaxConfig ( SparkMaxConfig &&  )
deletenoexcept

Member Function Documentation

◆ operator=() [1/2]

SparkMaxConfig & rev::spark::SparkMaxConfig::operator= ( const SparkMaxConfig )
delete

◆ operator=() [2/2]

SparkMaxConfig & rev::spark::SparkMaxConfig::operator= ( SparkMaxConfig &&  )
deletenoexcept

◆ Apply() [1/10]

SparkMaxConfig & SparkMaxConfig::Apply ( SparkMaxConfig config)

Applies settings from another SparkMaxConfig to this one, including all of its nested configurations.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe SparkMaxConfig to copy settings from
Returns
The updated SparkMaxConfig for method chaining

◆ Apply() [2/10]

SparkMaxConfig & SparkMaxConfig::Apply ( AlternateEncoderConfig config)

Applies settings from an AlternateEncoderConfig to this SparkMaxConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe AlternateEncoderConfig to copy settings from
Returns
The updated SparkMaxConfig for method chaining

◆ Flatten()

std::string SparkMaxConfig::Flatten ( )
overridevirtual

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [3/10]

SparkBaseConfig & SparkBaseConfig::Apply ( SparkBaseConfig config)
virtual

Applies settings from another SparkBaseConfig to this one, including all of its nested configurations.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe SparkBaseConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [4/10]

SparkBaseConfig & SparkBaseConfig::Apply ( AbsoluteEncoderConfig config)
virtual

Applies settings from an AbsoluteEncoderConfig to this SparkBaseConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe AbsoluteEncoderConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [5/10]

SparkBaseConfig & SparkBaseConfig::Apply ( AnalogSensorConfig config)
virtual

Applies settings from an AnalogSensorConfig to this SparkBaseConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe AnalogSensorConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [6/10]

SparkBaseConfig & SparkBaseConfig::Apply ( EncoderConfig config)
virtual

Applies settings from an EncoderConfig to this SparkBaseConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe EncoderConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [7/10]

SparkBaseConfig & SparkBaseConfig::Apply ( LimitSwitchConfig config)
virtual

Applies settings from a LimitSwitchConfig to this SparkBaseConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe LimitSwitchConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [8/10]

SparkBaseConfig & SparkBaseConfig::Apply ( SoftLimitConfig config)
virtual

Applies settings from a SoftLimitConfig to this SparkBaseConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe SoftLimitConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [9/10]

SparkBaseConfig & SparkBaseConfig::Apply ( ClosedLoopConfig config)
virtual

Applies settings from a ClosedLoopConfig to this SparkBaseConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe ClosedLoopConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

◆ Apply() [10/10]

SparkBaseConfig & SparkBaseConfig::Apply ( SignalsConfig config)
virtual

Applies settings from a SignalsConfig to this SparkBaseConfig.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe SignalsConfig to copy settings from
Returns
The updated SparkBaseConfig for method chaining

Reimplemented from rev::spark::SparkBaseConfig.

Member Data Documentation

◆ alternateEncoder

AlternateEncoderConfig rev::spark::SparkMaxConfig::alternateEncoder

The documentation for this class was generated from the following files: