emcyphal_stm32_native/
lib.rs

1//! Native STM32 FDCAN driver for the Emcyphal stack
2//!
3//! This implementation uses direct register access for better integration with the hardware.
4//!
5//! # Features
6//!
7//! * 14 subject filters
8//! * 1 destination (node address) filter
9//! * Software and hardware timestamps
10//! * Loop-back frames for TX timestamping
11//! * Full TX timeout support
12//! * Transmitter delay compensation for data bit rates up to 8 Mbps
13//!
14//! # Limitations
15//!
16//! * Anonymous frame transmission is not supported
17//! * System timestamps are measured in the runner task
18//! * Discontinuous transmission: a runner task wakes up to initial transmission of each frame
19//! * An 8-frame buffer is allocated even in Classic mode
20//!
21//! # Feature flags
22//!
23//! To use this crate:
24//! * Include the `embassy-stm32` crate with appropriate flags for your target chip
25//! * Choose an STM32 chip family flag: `stm32g4` (the same code should work on G0 and L5 families,
26//!   but has not been tested)
27//! * Enable bindings for available peripherals: `fdcan1`, `fdcan2`, `fdcan3`. Multiple instances
28//!   are supported.
29//!
30//! # Examples
31//!
32//! See the `pubsub_native` example in the 
33//! [nucleo-g431rb](https://github.com/dan-stefanov/emcyphal/tree/emcyphal-stm32-native-v0.1.0/nucleo-g431rb)
34//! crate.
35#![no_std]
36
37#[cfg(not(feature = "stm32g4"))]
38compile_error!("At least one target family should be chosen");
39
40// This mod MUST go first, so that the others see its macros.
41pub(crate) mod fmt;
42
43pub mod config;
44mod driver;
45mod format;
46mod message_ram;
47#[allow(unused_imports, unused_macros)]
48mod periphery;
49mod raw;
50mod utils;
51
52pub use driver::SUBJECT_SLOT_COUNT;
53pub use driver::{Driver, RxFilterRunner, RxRunner, TxRunner};
54pub use driver::{IT0InterruptHandler, IT1InterruptHandler};