|
| CANSparkFlex (int deviceID, MotorType type) |
|
SparkRelativeEncoder | GetEncoder () |
|
SparkFlexExternalEncoder | GetExternalEncoder (int countsPerRev) |
|
SparkFlexExternalEncoder | GetExternalEncoder (SparkFlexExternalEncoder::Type encoderType, int countsPerRev) |
|
| ~CANSparkFlex () override=default |
|
virtual SparkRelativeEncoder | GetEncoder ()=0 |
|
SparkRelativeEncoder | GetEncoder (SparkRelativeEncoder::Type encoderType, int countsPerRev) |
|
SparkRelativeEncoder | GetEncoder (SparkMaxRelativeEncoder::Type encoderType, int countsPerRev) |
|
SparkRelativeEncoder | GetEncoder (CANEncoder::EncoderType encoderType, int countsPerRev) |
|
| ~CANSparkBase () override=default |
|
void | Set (double speed) override |
|
void | SetVoltage (units::volt_t output) override |
|
double | Get () const override |
|
void | SetInverted (bool isInverted) override |
|
bool | GetInverted () const override |
|
void | Disable () override |
|
void | StopMotor () override |
|
SparkRelativeEncoder | GetEncoder (SparkRelativeEncoder::Type encoderType, int countsPerRev) |
|
SparkRelativeEncoder | GetEncoder (SparkMaxRelativeEncoder::Type encoderType, int countsPerRev) |
|
SparkRelativeEncoder | GetEncoder (CANEncoder::EncoderType encoderType, int countsPerRev) |
|
SparkAnalogSensor | GetAnalog (SparkAnalogSensor::Mode mode=SparkAnalogSensor::Mode::kAbsolute) |
|
SparkAnalogSensor | GetAnalog (SparkMaxAnalogSensor::Mode mode) |
|
SparkAnalogSensor | GetAnalog (CANAnalog::AnalogMode mode) |
|
SparkAbsoluteEncoder | GetAbsoluteEncoder (SparkAbsoluteEncoder::Type encoderType=SparkAbsoluteEncoder::Type::kDutyCycle) |
|
SparkAbsoluteEncoder | GetAbsoluteEncoder (SparkMaxAbsoluteEncoder::Type encoderType) |
|
SparkPIDController | GetPIDController () |
|
SparkLimitSwitch | GetForwardLimitSwitch (SparkLimitSwitch::Type switchType) |
|
SparkLimitSwitch | GetForwardLimitSwitch (SparkMaxLimitSwitch::Type switchType) |
|
SparkLimitSwitch | GetForwardLimitSwitch (CANDigitalInput::LimitSwitchPolarity polarity) |
|
SparkLimitSwitch | GetReverseLimitSwitch (SparkLimitSwitch::Type switchType) |
|
SparkLimitSwitch | GetReverseLimitSwitch (SparkMaxLimitSwitch::Type switchType) |
|
SparkLimitSwitch | GetReverseLimitSwitch (CANDigitalInput::LimitSwitchPolarity polarity) |
|
REVLibError | SetSmartCurrentLimit (unsigned int limit) |
|
REVLibError | SetSmartCurrentLimit (unsigned int stallLimit, unsigned int freeLimit, unsigned int limitRPM=20000) |
|
REVLibError | SetSecondaryCurrentLimit (double limit, int limitCycles=0) |
|
REVLibError | SetIdleMode (IdleMode mode) |
|
IdleMode | GetIdleMode () |
|
REVLibError | EnableVoltageCompensation (double nominalVoltage) |
|
REVLibError | DisableVoltageCompensation () |
|
double | GetVoltageCompensationNominalVoltage () |
|
REVLibError | SetOpenLoopRampRate (double rate) |
|
REVLibError | SetClosedLoopRampRate (double rate) |
|
double | GetOpenLoopRampRate () |
|
double | GetClosedLoopRampRate () |
|
REVLibError | Follow (const CANSparkBase &leader, bool invert=false) |
|
REVLibError | Follow (ExternalFollower leader, int deviceID, bool invert=false) |
|
bool | IsFollower () |
|
uint16_t | GetFaults () |
|
uint16_t | GetStickyFaults () |
|
bool | GetFault (FaultID faultID) const |
|
bool | GetStickyFault (FaultID faultID) const |
|
double | GetBusVoltage () |
|
double | GetAppliedOutput () |
|
double | GetOutputCurrent () |
|
double | GetMotorTemperature () |
|
REVLibError | ClearFaults () |
|
REVLibError | BurnFlash () |
|
REVLibError | SetCANTimeout (int milliseconds) |
|
REVLibError | EnableSoftLimit (SoftLimitDirection direction, bool enable) |
|
bool | IsSoftLimitEnabled (SoftLimitDirection direction) |
|
REVLibError | SetSoftLimit (SoftLimitDirection direction, double limit) |
|
double | GetSoftLimit (SoftLimitDirection direction) |
|
REVLibError | GetLastError () |
|
virtual | ~CANSparkLowLevel () |
|
uint32_t | GetFirmwareVersion () |
|
uint32_t | GetFirmwareVersion (bool &isDebugBuild) |
|
std::string | GetFirmwareString () |
|
std::vector< uint8_t > | GetSerialNumber () |
|
int | GetDeviceId () const |
|
MotorType | GetInitialMotorType () |
|
MotorType | GetMotorType () |
|
REVLibError | SetPeriodicFramePeriod (PeriodicFrame frame, int periodMs) |
|
REVLibError | SetPeriodicFramePeriod (CANSparkMaxLowLevel::PeriodicFrame frame, int periodMs) |
|
void | SetPeriodicFrameTimeout (int timeoutMs) |
|
void | SetCANMaxRetries (int numRetries) |
|
void | SetControlFramePeriodMs (int periodMs) |
|
REVLibError | RestoreFactoryDefaults (bool persist=false) |
|
|
enum class | IdleMode { kCoast = 0
, kBrake = 1
} |
|
enum class | InputMode { kPWM = 0
, kCAN = 1
} |
|
enum class | SoftLimitDirection { kForward
, kReverse
} |
|
enum class | FaultID {
kBrownout = 0
, kOvercurrent = 1
, kIWDTReset = 2
, kMotorFault = 3
,
kSensorFault = 4
, kStall = 5
, kEEPROMCRC = 6
, kCANTX = 7
,
kCANRX = 8
, kHasReset = 9
, kDRVFault = 10
, kOtherFault = 11
,
kSoftLimitFwd = 12
, kSoftLimitRev = 13
, kHardLimitFwd = 14
, kHardLimitRev = 15
} |
|
enum class | MotorType { kBrushed = 0
, kBrushless = 1
} |
|
enum class | ControlType {
kDutyCycle = 0
, kVelocity = 1
, kVoltage = 2
, kPosition = 3
,
kSmartMotion = 4
, kCurrent = 5
, kSmartVelocity = 6
} |
|
enum class | ParameterStatus {
kOK = 0
, kInvalidID = 1
, kMismatchType = 2
, kAccessMode = 3
,
kInvalid = 4
, kNotImplementedDeprecated = 5
} |
|
enum class | PeriodicFrame {
kStatus0 = 0
, kStatus1 = 1
, kStatus2 = 2
, kStatus3 = 3
,
kStatus4 = 4
, kStatus5 = 5
, kStatus6 = 6
, kStatus7 = 7
} |
|
enum class | TelemetryID {
kBusVoltage = 0
, kOutputCurrent
, kVelocity
, kPosition
,
kIAccum
, kAppliedOutput
, kMotorTemp
, kFaults
,
kStickyFaults
, kAnalogVoltage
, kAnalogPosition
, kAnalogVelocity
,
kAltEncPosition
, kAltEncVelocity
, kTotalStreams
} |
|
enum class | SparkModel { kSparkMax = 0
, kSparkFlex = 1
, kUnknown = 255
} |
|
static void | EnableExternalUSBControl (bool enable) |
|
static void | SetEnable (bool enable) |
|
static constexpr ExternalFollower | kFollowerDisabled {0, 0} |
|
static constexpr ExternalFollower | kFollowerSparkMax {0x2051800, 26} |
|
static constexpr ExternalFollower | kFollowerSpark {0x2051800, 26} |
|
static constexpr ExternalFollower | kFollowerPhoenix {0x2040080, 27} |
|
static const uint8_t | kAPIMajorVersion = c_SparkMax_kAPIMajorVersion |
|
static const uint8_t | kAPIMinorVersion = c_SparkMax_kAPIMinorVersion |
|
static const uint8_t | kAPIBuildVersion = c_SparkMax_kAPIBuildVersion |
|
static const uint32_t | kAPIVersion = c_SparkMax_kAPIVersion |
|
enum class | FeedbackSensorType {
kNoSensor = 0
, kHallSensor = 1
, kQuadrature = 2
, kSensorless = 3
,
kAnalog = 4
, kAltQuadrature = 5
, kDutyCycleSensor = 6
} |
|
void | attemptToSetDataportConfigOrThrow (c_SparkMax_DataPortConfig config, std::string errorText) |
|
PeriodicStatus0 | GetPeriodicStatus0 () |
|
PeriodicStatus1 | GetPeriodicStatus1 () |
|
PeriodicStatus2 | GetPeriodicStatus2 () |
|
REVLibError | SetFollow (FollowConfig config) |
|
REVLibError | SetpointCommand (double value, CANSparkLowLevel::ControlType ctrl=ControlType::kDutyCycle, int pidSlot=0, double arbFeedforward=0, int arbFFUnits=0) |
|
float | GetSafeFloat (float f) |
|
MotorType | m_motorType |
|
SparkModel | m_expectedSparkModel |
|
void * | m_sparkMaxHandle |
|
Returns an object for interfacing with the encoder connected to the encoder pins or front port of the SPARK MAX or the motor interface of the SPARK Flex.
For a SPARK MAX in brushless mode, it is assumed that the default encoder type is hall effect and the counts per revolution is 42.
For a SPARK Flex in brushless mode, it is assumed that the default encoder type is quadrature and the counts per revolution is 7168.
Implements rev::CANSparkBase.