dynamixel2/
lib.rs

1//! An implementation of the [Dynamixel Protocol 2.0].
2//!
3//! [Dynamixel Protocol 2.0]: https://emanual.robotis.com/docs/en/dxl/protocol2/
4//!
5//! This library aims to provide a easy to use but low level implementation of the Dynamixel Protocol 2.0.
6//! That means it allows you to execute arbitrary commands with arbitrary parameters.
7//!
8//! The library does not aim to provide an easy interface to the higher level functions of a servo motor,
9//! such as moving it to a specific angle or at a specific speed.
10//! Instead, you will have to write the appropriate values to the correct registers yourself.
11//!
12//! The main interface is the [`Bus`] struct, which represents the serial communication bus.
13//! The [`Bus`] struct exposes functions for all supported instructions such as [`Bus::ping`], [`Bus::read`], [`Bus::write`] and much more.
14//! Additionally, you can also transmit raw commands using [`Bus::write_instruction`] and [`Bus::read_status_response`], or [`Bus::transfer_single`].
15//!
16//! The library currently implements all instructions except for the Control Table Backup, Fast Sync Read and Fast Sync Write instructions.
17//!
18//! # Optional features
19//!
20//! You can enable the `log` feature to have the library use `log::trace!()` to log all sent instructions and received replies.
21
22#![warn(missing_docs)]
23#![warn(missing_debug_implementations)]
24
25#[macro_use]
26mod log;
27
28pub mod checksum;
29pub mod instructions;
30
31mod bytestuff;
32mod endian;
33
34mod bus;
35pub use bus::*;
36
37mod error;
38pub use error::*;
39
40
41/// Re-exported `serial2` crate in case you need to modify serial port settings.
42pub use serial2;