cansimple

Crates.iocansimple
lib.rscansimple
version0.1.0
created_at2025-06-20 12:17:39.484548+00
updated_at2025-06-20 12:17:39.484548+00
descriptionAn implementation of the CANSimple identifier scheme
homepage
repository
max_upload_size
id1719514
size7,834
Liam Kinne (liamkinne)

documentation

README

CANSimple

An implementation of the CANSimple identifier scheme mainly used by ODrive products.

Features

  • defmt-1 enables defmt formatting on relevant types.

Overview

The CANsimple protocol uses only 11-bit identifiers and features a node and command components.

| 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Node ID                | Command ID        |

A full explanation can be found in the ODrive documentation.

Examples

Identifiers can be created from either raw ids or from node and command ids.

// From components
let id = cansimple::Id::new(1, 15).unwrap();

// From raw id
let id = cansimple::Id::from_raw(0x029);

CANsimple identifers can be converted to and from embedded_can identifers.

let id = cansimple::Id::new(1, 15).unwrap();
let embedded_id: embedded_can::Id = id.into();
Commit count: 0

cargo fmt