Skip to main content

moteus_protocol/
lib.rs

1// Copyright 2026 mjbots Robotic Systems, LLC.  info@mjbots.com
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![doc = include_str!("../README.md")]
16#![no_std]
17
18mod frame;
19mod mode;
20pub(crate) mod multiplex;
21mod register;
22mod resolution;
23pub mod scaling;
24
25pub mod command;
26pub mod diagnostic;
27pub mod fdcanusb;
28pub mod query;
29
30pub use frame::{calculate_arbitration_id, parse_arbitration_id, CanFdFrame, Toggle};
31pub use mode::{HomeState, Mode};
32pub use multiplex::{
33    parse_frame, FrameParser, Subframe, SubframeType, Value, WriteCanData, WriteCombiner,
34    CLIENT_POLL_SERVER, CLIENT_POLL_SERVER_FLOW, CLIENT_TO_SERVER, NOP, READ_ERROR, READ_FLOAT,
35    READ_INT16, READ_INT32, READ_INT8, REPLY_FLOAT, REPLY_INT16, REPLY_INT32, REPLY_INT8,
36    SERVER_TO_CLIENT, SERVER_TO_CLIENT_FLOW, WRITE_ERROR, WRITE_FLOAT, WRITE_INT16, WRITE_INT32,
37    WRITE_INT8,
38};
39pub use register::Register;
40pub use resolution::Resolution;
41pub use scaling::Scaling;
42
43/// The current register map version expected from moteus controllers.
44/// If the version differs, semantics of one or more registers may have changed.
45pub const CURRENT_REGISTER_MAP_VERSION: u8 = 5;