cansimple 0.1.0

An implementation of the CANSimple identifier scheme
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented1 out of 7 items with examples
  • Size
  • Source code size: 7.36 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 859.29 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • liamkinne

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();