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
andRx1
).
§Limitations
- Support for querying error states and handling error interrupts is incomplete.
§Cargo Features
The specific version of defmt is unspecified and may be updated in a patch release. ↩
Modules§
- filter
- Filter bank API.
Structs§
- Can
- Interface to a bxCAN peripheral.
- CanBuilder
- Builder returned by
Can::builder
. - CanConfig
- Configuration proxy returned by
Can::modify_config
. - Data
- Payload of a CAN data frame.
- Extended
Id - Extended 29-bit CAN Identifier (
0..=1FFF_FFFF
). - Frame
- A CAN data or remote frame.
- Frame
Priority - Priority of a CAN frame.
- Interrupts
- A set of bxCAN interrupts.
- Overrun
Error - Error that indicates that an incoming message has been lost due to buffer overrun.
- Register
Block - Register block of bxCAN peripherals.
- Rx0
- Interface to receiver FIFO 0.
- Rx1
- Interface to receiver FIFO 1.
- Standard
Id - Standard 11-bit CAN Identifier (
0..=0x7FF
). - Transmit
Status - Contains information about a frame enqueued for transmission via
Can::transmit
orTx::transmit
. - Tx
- Interface to the CAN transmitter part.
Enums§
- Fifo
- Identifies one of the two receive FIFOs.
- Id
- A CAN Identifier (standard or extended).
- Interrupt
- bxCAN interrupt sources.
- Mailbox
- Identifies one of the three transmit mailboxes.
Traits§
- Filter
Owner - A bxCAN instance that owns filter banks.
- Instance
- A bxCAN peripheral instance.
- Master
Instance - A bxCAN master instance that shares filter banks with a slave instance.