Skip to main content

embassy_drv2605l/
lib.rs

1#![no_std]
2#![allow(async_fn_in_trait)]
3
4pub mod common;
5pub mod registers;
6
7#[cfg(feature = "blocking")]
8pub mod blocking;
9
10#[cfg(feature = "async")]
11pub mod async_i2c;
12
13// Re-export common types at crate root
14pub use common::{Effect, Error, Library, Mode, MotorType, DRV2605L_ADDR};
15
16// Re-export the appropriate driver based on features
17#[cfg(all(feature = "blocking", not(feature = "async")))]
18pub use blocking::Drv2605l;
19
20#[cfg(feature = "async")]
21pub use async_i2c::Drv2605l;
22
23// If both features are enabled, require explicit module usage
24#[cfg(all(feature = "blocking", feature = "async"))]
25pub mod prelude {
26    pub use crate::async_i2c::Drv2605l as AsyncDrv2605l;
27    pub use crate::blocking::Drv2605l as BlockingDrv2605l;
28}