13 releases (7 breaking)

0.8.0 Sep 17, 2024
0.7.0 May 30, 2022
0.6.2 Nov 15, 2021
0.5.1 May 15, 2021
0.3.0 Dec 28, 2020

#502 in Embedded development

Download history 2226/week @ 2024-07-31 1435/week @ 2024-08-07 1393/week @ 2024-08-14 1221/week @ 2024-08-21 1014/week @ 2024-08-28 1314/week @ 2024-09-04 1461/week @ 2024-09-11 1319/week @ 2024-09-18 1563/week @ 2024-09-25 1347/week @ 2024-10-02 955/week @ 2024-10-09 1027/week @ 2024-10-16 977/week @ 2024-10-23 1443/week @ 2024-10-30 1189/week @ 2024-11-06 935/week @ 2024-11-13

4,756 downloads per month
Used in 51 crates (19 directly)

MIT/Apache

270KB
8K SLoC

bxCAN peripheral driver

crates.io docs.rs CI

This crate implements a driver for the bxCAN peripheral found in many low- to middle-end STM32 microcontrollers.

Please refer to the changelog to see what changed in the last releases.

Usage

Add an entry to your Cargo.toml:

[dependencies]
bxcan = "0.8.0"

Check the API Documentation for how to use the crate's functionality.

Rust version support

This crate supports at least the 3 latest stable Rust releases. Bumping the minimum supported Rust version (MSRV) is not considered a breaking change as long as these 3 versions are still supported.


lib.rs:

Driver for the STM32 bxCAN peripheral.

This crate provides a reusable driver for the bxCAN peripheral found in many low- to middle-end STM32 microcontrollers. HALs for compatible chips can reexport this crate and implement its traits to easily expose a featureful CAN driver.

Features

  • Supports both single- and dual-peripheral configurations (where one bxCAN instance manages the filters of a secondary instance).
  • Handles standard and extended frames, and data and remote frames.
  • Support for interrupts emitted by the bxCAN peripheral.
  • Transmission respects CAN IDs and protects against priority inversion (a lower-priority frame may be dequeued when enqueueing a higher-priority one).
  • Implements the embedded-hal traits for interoperability.
  • Support for both RX FIFOs (as [Rx0] and [Rx1]).

Limitations

  • Support for querying error states and handling error interrupts is incomplete.

Cargo Features

Feature Description
unstable-defmt Implements defmt's Format trait for the types in this crate.[^1]

[^1]: The specific version of defmt is unspecified and may be updated in a patch release.

Dependencies

~110–275KB