From f208a9e5a8cd987bbcbf35388555deb10c7cd1bf Mon Sep 17 00:00:00 2001 From: Zhouqi Jiang Date: Fri, 29 Nov 2024 11:49:15 +0800 Subject: [PATCH] prelude: add HAL prelude module, import embedded-io and embedded-hal traits in prelude Signed-off-by: Zhouqi Jiang --- allwinner-hal/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/allwinner-hal/src/lib.rs b/allwinner-hal/src/lib.rs index d6b2532..a476a32 100644 --- a/allwinner-hal/src/lib.rs +++ b/allwinner-hal/src/lib.rs @@ -17,9 +17,17 @@ pub mod smhc; pub mod spi; #[doc(hidden)] pub mod sysctl; -#[macro_use] pub mod uart; +#[doc(hidden)] +pub mod prelude { + pub use embedded_hal::{ + digital::{InputPin as _, OutputPin as _, StatefulOutputPin as _}, + spi::SpiBus as _, + }; + pub use embedded_io::{Read as _, Write as _}; +} + #[allow(unused)] macro_rules! impl_pins_trait { ($(($p: expr, $i: expr, $f: expr): $Trait: ty;)+) => {