CANSparkMax

Struct CANSparkMax 

Source
#[repr(C)]
pub struct CANSparkMax { pub _base: CANSparkMaxLowLevel, pub m_setpoint: f64, pub m_relativeEncoderCreated: atomic<bool>, pub m_alternateEncoderCreated: atomic<bool>, pub m_analogSensorCreated: atomic<bool>, pub m_pidControllerCreated: atomic<bool>, pub m_forwardLimitSwitchCreated: atomic<bool>, pub m_reverseLimitSwitchCreated: atomic<bool>, }

Fields§

§_base: CANSparkMaxLowLevel§m_setpoint: f64§m_relativeEncoderCreated: atomic<bool>§m_alternateEncoderCreated: atomic<bool>§m_analogSensorCreated: atomic<bool>§m_pidControllerCreated: atomic<bool>§m_forwardLimitSwitchCreated: atomic<bool>§m_reverseLimitSwitchCreated: atomic<bool>

Implementations§

Source§

impl CANSparkMax

Source

pub unsafe fn GetEncoder( &mut self, encoderType: SparkMaxRelativeEncoder_Type, countsPerRev: c_int, ) -> SparkMaxRelativeEncoder

Source

pub unsafe fn GetEncoder1( &mut self, encoderType: CANEncoder_EncoderType, countsPerRev: c_int, ) -> SparkMaxRelativeEncoder

Source

pub unsafe fn GetAlternateEncoder( &mut self, countsPerRev: c_int, ) -> SparkMaxAlternateEncoder

Source

pub unsafe fn GetAlternateEncoder1( &mut self, encoderType: SparkMaxAlternateEncoder_Type, countsPerRev: c_int, ) -> SparkMaxAlternateEncoder

Source

pub unsafe fn GetAlternateEncoder2( &mut self, encoderType: CANEncoder_AlternateEncoderType, countsPerRev: c_int, ) -> SparkMaxAlternateEncoder

Source

pub unsafe fn GetAnalog( &mut self, mode: SparkMaxAnalogSensor_Mode, ) -> SparkMaxAnalogSensor

Source

pub unsafe fn GetAnalog1( &mut self, mode: CANAnalog_AnalogMode, ) -> SparkMaxAnalogSensor

Source

pub unsafe fn GetPIDController(&mut self) -> SparkMaxPIDController

Source

pub unsafe fn GetForwardLimitSwitch( &mut self, switchType: SparkMaxLimitSwitch_Type, ) -> SparkMaxLimitSwitch

Source

pub unsafe fn GetForwardLimitSwitch1( &mut self, polarity: CANDigitalInput_LimitSwitchPolarity, ) -> SparkMaxLimitSwitch

Source

pub unsafe fn GetReverseLimitSwitch( &mut self, switchType: SparkMaxLimitSwitch_Type, ) -> SparkMaxLimitSwitch

Source

pub unsafe fn GetReverseLimitSwitch1( &mut self, polarity: CANDigitalInput_LimitSwitchPolarity, ) -> SparkMaxLimitSwitch

Source

pub unsafe fn SetSmartCurrentLimit(&mut self, limit: c_uint) -> REVLibError

Source

pub unsafe fn SetSmartCurrentLimit1( &mut self, stallLimit: c_uint, freeLimit: c_uint, limitRPM: c_uint, ) -> REVLibError

Source

pub unsafe fn SetSecondaryCurrentLimit( &mut self, limit: f64, limitCycles: c_int, ) -> REVLibError

Source

pub unsafe fn SetIdleMode(&mut self, mode: CANSparkMax_IdleMode) -> REVLibError

Source

pub unsafe fn GetIdleMode(&mut self) -> CANSparkMax_IdleMode

Source

pub unsafe fn EnableVoltageCompensation( &mut self, nominalVoltage: f64, ) -> REVLibError

Source

pub unsafe fn DisableVoltageCompensation(&mut self) -> REVLibError

Source

pub unsafe fn GetVoltageCompensationNominalVoltage(&mut self) -> f64

Source

pub unsafe fn SetOpenLoopRampRate(&mut self, rate: f64) -> REVLibError

Source

pub unsafe fn SetClosedLoopRampRate(&mut self, rate: f64) -> REVLibError

Source

pub unsafe fn GetOpenLoopRampRate(&mut self) -> f64

Source

pub unsafe fn GetClosedLoopRampRate(&mut self) -> f64

Source

pub unsafe fn Follow( &mut self, leader: *const CANSparkMax, invert: bool, ) -> REVLibError

Source

pub unsafe fn Follow1( &mut self, leader: CANSparkMax_ExternalFollower, deviceID: c_int, invert: bool, ) -> REVLibError

Source

pub unsafe fn IsFollower(&mut self) -> bool

Source

pub unsafe fn GetFaults(&mut self) -> u16

Source

pub unsafe fn GetStickyFaults(&mut self) -> u16

Source

pub unsafe fn GetFault(&self, faultID: CANSparkMax_FaultID) -> bool

Source

pub unsafe fn GetStickyFault(&self, faultID: CANSparkMax_FaultID) -> bool

Source

pub unsafe fn GetBusVoltage(&mut self) -> f64

Source

pub unsafe fn GetAppliedOutput(&mut self) -> f64

Source

pub unsafe fn GetOutputCurrent(&mut self) -> f64

Source

pub unsafe fn GetMotorTemperature(&mut self) -> f64

Source

pub unsafe fn ClearFaults(&mut self) -> REVLibError

Source

pub unsafe fn BurnFlash(&mut self) -> REVLibError

Source

pub unsafe fn SetCANTimeout(&mut self, milliseconds: c_int) -> REVLibError

Source

pub unsafe fn EnableSoftLimit( &mut self, direction: CANSparkMax_SoftLimitDirection, enable: bool, ) -> REVLibError

Source

pub unsafe fn IsSoftLimitEnabled( &mut self, direction: CANSparkMax_SoftLimitDirection, ) -> bool

Source

pub unsafe fn SetSoftLimit( &mut self, direction: CANSparkMax_SoftLimitDirection, limit: f64, ) -> REVLibError

Source

pub unsafe fn GetSoftLimit( &mut self, direction: CANSparkMax_SoftLimitDirection, ) -> f64

Source

pub unsafe fn GetLastError(&mut self) -> REVLibError

Source

pub unsafe fn new(deviceID: c_int, type_: CANSparkMaxLowLevel_MotorType) -> Self

Trait Implementations§

Source§

impl Debug for CANSparkMax

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more