33#pragma warning(disable : 4996)
37#pragma GCC diagnostic push
38#pragma GCC diagnostic ignored "-Wdeprecated"
39#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
67 friend class ::ConfigBase;
91 other = (faults & 0x1) != 0;
93 sensor = (faults & 0x4) != 0;
94 can = (faults & 0x8) != 0;
119 sensor = (warnings & 0x10) != 0;
120 stall = (warnings & 0x20) != 0;
122 other = (warnings & 0x80) != 0;
137 void Set(
double speed)
override;
149 void SetVoltage(units::volt_t output)
override;
156 double Get()
const override;
462#pragma GCC diagnostic pop
Definition: SparkAbsoluteEncoder.h:44
Definition: SparkAnalogSensor.h:51
Definition: SparkBaseConfig.h:46
Definition: SparkBase.h:57
bool HasStickyWarning()
Definition: SparkBase.cpp:188
SparkRelativeEncoder & GetEncoder()
Definition: SparkBase.cpp:104
uint8_t GetMotorInterface()
Definition: SparkBase.cpp:134
Warnings GetStickyWarnings()
Definition: SparkBase.cpp:218
std::atomic< bool > m_absoluteEncoderCreated
Definition: SparkBase.h:447
IdleMode
Definition: SparkBase.h:70
bool IsFollower()
Definition: SparkBase.cpp:161
REVLibError SetCANTimeout(int milliseconds)
Definition: SparkBase.cpp:259
SoftLimitDirection
Definition: SparkBase.h:72
virtual SparkAbsoluteEncoder & GetAbsoluteEncoder()
Definition: SparkBase.cpp:114
Faults GetStickyFaults()
Definition: SparkBase.cpp:202
std::atomic< bool > m_relativeEncoderCreated
Definition: SparkBase.h:441
std::atomic< bool > m_forwardLimitSwitchCreated
Definition: SparkBase.h:453
~SparkBase() override=default
double GetAppliedOutput()
Definition: SparkBase.cpp:232
SparkClosedLoopController & GetClosedLoopController()
Definition: SparkBase.cpp:119
std::atomic< bool > m_reverseLimitSwitchCreated
Definition: SparkBase.h:456
bool HasActiveFault()
Definition: SparkBase.cpp:168
SparkLimitSwitch m_ReverseLimitSwitch
Definition: SparkBase.h:455
Warnings GetWarnings()
Definition: SparkBase.cpp:210
Faults GetFaults()
Definition: SparkBase.cpp:195
std::atomic< bool > m_analogSensorCreated
Definition: SparkBase.h:444
bool HasStickyFault()
Definition: SparkBase.cpp:174
std::atomic< bool > m_closedLoopControllerCreated
Definition: SparkBase.h:450
SparkClosedLoopController m_ClosedLoopController
Definition: SparkBase.h:449
void Disable() override
Definition: SparkBase.cpp:85
double Get() const override
Definition: SparkBase.cpp:71
REVLibError ClearFaults()
Definition: SparkBase.cpp:253
SparkRelativeEncoder GetEncoderEvenIfAlreadyCreated()
Definition: SparkBase.cpp:271
double m_setpoint
Definition: SparkBase.h:409
ResetMode
Definition: SparkBase.h:74
double GetOutputCurrent()
Definition: SparkBase.cpp:239
rev::REVLibError PauseFollowerMode()
Definition: SparkBase.cpp:155
void SetInverted(bool isInverted) override
Definition: SparkBase.cpp:73
virtual REVLibError Configure(SparkBaseConfig &config, ResetMode resetMode, PersistMode persistMode)
Definition: SparkBase.cpp:89
SparkAnalogSensor m_AnalogSensor
Definition: SparkBase.h:443
REVLibError GetLastError()
Definition: SparkBase.cpp:265
bool GetInverted() const override
Definition: SparkBase.cpp:78
void Set(double speed) override
Definition: SparkBase.cpp:56
virtual SparkLimitSwitch & GetReverseLimitSwitch()
Definition: SparkBase.cpp:129
SparkBase::SparkModel GetSparkModel()
Definition: SparkBase.cpp:142
SparkAnalogSensor & GetAnalog()
Definition: SparkBase.cpp:109
rev::REVLibError ResumeFollowerMode()
Definition: SparkBase.cpp:149
SparkAbsoluteEncoder m_AbsoluteEncoder
Definition: SparkBase.h:446
bool HasActiveWarning()
Definition: SparkBase.cpp:181
void SetVoltage(units::volt_t output) override
Definition: SparkBase.cpp:62
SparkRelativeEncoder m_RelativeEncoder
Definition: SparkBase.h:440
double GetBusVoltage()
Definition: SparkBase.cpp:226
PersistMode
Definition: SparkBase.h:76
double GetMotorTemperature()
Definition: SparkBase.cpp:246
SparkLimitSwitch m_ForwardLimitSwitch
Definition: SparkBase.h:452
virtual SparkLimitSwitch & GetForwardLimitSwitch()
Definition: SparkBase.cpp:124
void StopMotor() override
Definition: SparkBase.cpp:87
Definition: SparkClosedLoopController.h:51
Definition: SparkFlex.h:37
Definition: SparkLimitSwitch.h:48
Definition: SparkLowLevel.h:49
MotorType
Definition: SparkLowLevel.h:77
friend class SparkBase
Definition: SparkLowLevel.h:50
SparkModel
Definition: SparkLowLevel.h:209
Definition: SparkMaxAlternateEncoder.h:46
Definition: SparkMax.h:37
Definition: SparkRelativeEncoder.h:46
Definition: SparkSim.h:48
Definition: SparkLowLevel.cpp:40
REVLibError
Definition: REVLibError.h:33
Definition: SparkBase.h:78
Faults()
Definition: SparkBase.h:88
bool motorType
Definition: SparkBase.h:80
bool other
Definition: SparkBase.h:79
Faults(uint16_t faults)
Definition: SparkBase.h:90
bool temperature
Definition: SparkBase.h:83
bool can
Definition: SparkBase.h:82
bool gateDriver
Definition: SparkBase.h:84
bool escEeprom
Definition: SparkBase.h:85
bool sensor
Definition: SparkBase.h:81
bool firmware
Definition: SparkBase.h:86
Definition: SparkBase.h:102
bool extEeprom
Definition: SparkBase.h:106
bool escEeprom
Definition: SparkBase.h:105
bool overcurrent
Definition: SparkBase.h:104
bool hasReset
Definition: SparkBase.h:109
bool sensor
Definition: SparkBase.h:107
Warnings()
Definition: SparkBase.h:112
bool other
Definition: SparkBase.h:110
Warnings(uint16_t warnings)
Definition: SparkBase.h:114
bool stall
Definition: SparkBase.h:108
bool brownout
Definition: SparkBase.h:103