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 query;
27
28pub use frame::{calculate_arbitration_id, parse_arbitration_id, CanFdFrame, Toggle};
29pub use mode::{HomeState, Mode};
30pub use multiplex::{
31    parse_frame, FrameParser, Subframe, SubframeType, Value, WriteCanData, WriteCombiner,
32    CLIENT_POLL_SERVER, CLIENT_TO_SERVER, NOP, READ_ERROR, READ_FLOAT, READ_INT16, READ_INT32,
33    READ_INT8, REPLY_FLOAT, REPLY_INT16, REPLY_INT32, REPLY_INT8, SERVER_TO_CLIENT, WRITE_ERROR,
34    WRITE_FLOAT, WRITE_INT16, WRITE_INT32, WRITE_INT8,
35};
36pub use register::Register;
37pub use resolution::Resolution;
38pub use scaling::Scaling;
39
40/// The current register map version expected from moteus controllers.
41/// If the version differs, semantics of one or more registers may have changed.
42pub const CURRENT_REGISTER_MAP_VERSION: u8 = 5;