[][src]Enum pololu_smc::command::Command

pub enum Command {
    ExitSafeStart,
    MotorFwd {
        speed: u16,
    },
    MotorRev {
        speed: u16,
    },
    MotorFwd7bit {
        speed: u8,
    },
    MotorRev7bit {
        speed: u8,
    },
    MotorBrake {
        brake_amount: u8,
    },
    SetCurrentLimit {
        value: u16,
    },
    StopMotor,
}

Representations of the commands that can be sent to the controller.

These only contain the commands which do not provide any response, which can thus be used in [SimpleMotorController::send_command]. There are some additional commands available that do provide a response. These are handled separately by the methods [SimpleMotorController::set_motor_limit] and [SimpleMotorController::get_firmware_version].

Variants

ExitSafeStart

If safe-start protection is enabled, this command is required before the motor can run.

MotorFwd

Sets the full-resolution motor target speed in the forward direction.

Fields of MotorFwd

speed: u16

Target speed, 0 (motor stopped) to 3200 (full speed).

MotorRev

Sets the full-resolution motor target speed in the reverse direction.

Fields of MotorRev

speed: u16

Target speed, 0 (motor stopped) to 3200 (full speed).

MotorFwd7bit

Sets the low-resolution motor target speed in the forward direction.

Fields of MotorFwd7bit

speed: u8

Target speed, 0 (motor stopped) to 127 (full speed).

MotorRev7bit

Sets the low-resolution motor target speed in the reverse direction.

Fields of MotorRev7bit

speed: u8

Target speed, 0 (motor stopped) to 127 (full speed).

MotorBrake

Causes the motor to immediately brake or coast (configured deceleration limits are ignored).

Fields of MotorBrake

brake_amount: u8

The amount of braking action. 0 (coasting) to 32.

SetCurrentLimit

This command lets you change the hardware current limit temporarily until the next reset.

Fields of SetCurrentLimit

value: u16

The current limit in internal units. See section 5.2 in the official user's guide for instructions on how to convert mA into these internal units.

StopMotor

Sets the motor target speed to zero, stopping the motor respecting the configured deceleration limits. This also makes the controller susceptible to a safe-start violation error is safe-start is enabled.

Trait Implementations

impl Clone for Command[src]

impl Copy for Command[src]

impl Debug for Command[src]

impl Eq for Command[src]

impl Hash for Command[src]

impl Ord for Command[src]

impl PartialEq<Command> for Command[src]

impl PartialOrd<Command> for Command[src]

impl StructuralEq for Command[src]

impl StructuralPartialEq for Command[src]

Auto Trait Implementations

impl Send for Command

impl Sync for Command

impl Unpin for Command

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.