Crate pololu_tic

Crate pololu_tic 

Source
Expand description

§Pololu Tic Driver

A platform agnostic Rust driver for the Pololu Tic motor driver boards. Currently this library only supports the I2C interface of the boards, but serial support is planned.

This library supports the same boards the equivalent Arduino library supports, currently the T500, T834, T825, T249, 36v4 are supported.

§Example

A basic example of using this library to set up and control a Tic36v4 is as follows. Ensure you replace <i2c_bus> with your platform’s embedded_hal I²C interface.

use pololu_tic::{TicBase, TicI2C, TicProduct};

let mut tic = pololu_tic::TicI2C::new_with_address(
    <i2c_bus>,
    TicProduct::Tic36v4,
    14
);

tic.set_target_velocity(2000000);

loop {
    tic.reset_command_timeout();
}

Modules§

base
Base functions
i2c
I2C interface to a Tic motor driver board.

Structs§

TicI2C
I2C interface to a Tic board.

Enums§

TicAgcBottomCurrentLimit
Possible AGC buttom current limit percentages.
TicAgcCurrentBoostSteps
Possible AGC current boost steps values.
TicAgcFrequencyLimit
Possible AGC frequency limit values.
TicAgcMode
Possible AGC modes.
TicCommand
The Tic command codes which are used for its serial, I2C, and USB interface. These codes are used by the library and you should not need to use them.
TicDecayMode
The possible decay modes.
TicError
This enum defines the Tic’s error bits. See the “Error handling” section of the Tic user’s guide for more information about what these errors mean.
TicHandlerError
The generic error type for anything in this crate.
TicHpDriverError
The bits in the “Last HP driver errors” variable.
TicInputState
The possible states of the Tic’s main input.
TicMiscFlags1
The bits in the Tic’s Misc Flags 1 register. You should not need to use this directly. See TicBase::is_energized() and TicBase::is_position_uncertain().
TicMotorDriverError
Possible motor driver errors for the Tic T249.
TicOperationState
The possible operation states for the Tic.
TicPin
The Tic’s control pins.
TicPinState
The Tic’s pin states.
TicPlanningMode
The possible planning modes for the Tic’s step generation code.
TicProduct
The type of Tic driver that is being represented.
TicReset
The possible causes of a full microcontroller reset for the Tic.
TicStepMode
The possible step modes.

Traits§

TicBase