Skip to main content

cu_bdshot/
lib.rs

1#![cfg_attr(not(test), no_std)]
2
3#[cfg(all(feature = "rp2350", feature = "stm32h7"))]
4compile_error!("Enable only one cu-bdshot feature: rp2350 or stm32h7.");
5#[cfg(all(
6    not(any(feature = "rp2350", feature = "stm32h7")),
7    not(feature = "messages-only")
8))]
9compile_error!("Enable one cu-bdshot feature: rp2350 or stm32h7 (or messages-only for host use).");
10
11#[cfg(any(feature = "rp2350", feature = "stm32h7"))]
12pub mod board;
13#[cfg(any(feature = "rp2350", feature = "stm32h7"))]
14pub mod bridge;
15pub mod messages;
16
17#[cfg(any(feature = "rp2350", feature = "stm32h7"))]
18mod decode;
19#[cfg(feature = "stm32h7")]
20mod dshot;
21#[cfg(feature = "rp2350")]
22mod esc_channel;
23
24#[cfg(feature = "rp2350")]
25pub use board::{
26    Rp2350Board, Rp2350BoardConfig, Rp2350BoardProvider, Rp2350BoardResources,
27    register_rp2350_board,
28};
29#[cfg(feature = "stm32h7")]
30pub use board::{
31    Stm32H7Board, Stm32H7BoardProvider, Stm32H7BoardResources, register_stm32h7_board,
32};
33#[cfg(any(feature = "rp2350", feature = "stm32h7"))]
34pub use bridge::{BdshotBoardProvider, CuBdshotBridge};
35pub use messages::{DShotTelemetry, EscCommand, EscTelemetry};
36
37#[cfg(feature = "rp2350")]
38pub type RpBdshotBridge = CuBdshotBridge<Rp2350BoardProvider>;
39#[cfg(feature = "stm32h7")]
40pub type Stm32BdshotBridge = CuBdshotBridge<Stm32H7BoardProvider>;