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§
Structs§
- TicI2C
- I2C interface to a Tic board.
Enums§
- TicAgc
Bottom Current Limit - Possible AGC buttom current limit percentages.
- TicAgc
Current Boost Steps - Possible AGC current boost steps values.
- TicAgc
Frequency Limit - Possible AGC frequency limit values.
- TicAgc
Mode - 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.
- TicDecay
Mode - 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.
- TicHandler
Error - The generic error type for anything in this crate.
- TicHp
Driver Error - The bits in the “Last HP driver errors” variable.
- TicInput
State - The possible states of the Tic’s main input.
- TicMisc
Flags1 - The bits in the Tic’s Misc Flags 1 register. You should
not need to use this directly. See
TicBase::is_energized()
andTicBase::is_position_uncertain()
. - TicMotor
Driver Error - Possible motor driver errors for the Tic T249.
- TicOperation
State - The possible operation states for the Tic.
- TicPin
- The Tic’s control pins.
- TicPin
State - The Tic’s pin states.
- TicPlanning
Mode - 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.
- TicStep
Mode - The possible step modes.