Crate bxcan

source ·
Expand description

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

FeatureDescription
unstable-defmtImplements 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. 

Modules§

Structs§

Enums§

  • Identifies one of the two receive FIFOs.
  • A CAN Identifier (standard or extended).
  • bxCAN interrupt sources.
  • Identifies one of the three transmit mailboxes.

Traits§

  • A bxCAN instance that owns filter banks.
  • A bxCAN peripheral instance.
  • A bxCAN master instance that shares filter banks with a slave instance.