diff --git a/Cargo.toml b/Cargo.toml index 6e8abe5..19a9a25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://docs.rs/ws2812-pio" repository = "https://github.com/rp-rs/ws2812-pio-rs/" [dependencies] -embedded-hal = "0.2.5" +embedded-hal = "1.0.0" fugit = "0.3.5" rp2040-hal = "0.11" pio = "0.2.0" diff --git a/src/lib.rs b/src/lib.rs index 75ad292..fe73481 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,8 +13,8 @@ //! Bear in mind that you will have to take care of timing requirements //! yourself then. -use embedded_hal::timer::CountDown; -use fugit::{ExtU32, HertzU32, MicrosDurationU32}; +use embedded_hal::delay::DelayNs; +use fugit::HertzU32; use rp2040_hal::{ gpio::AnyPin, pio::{PIOExt, StateMachineIndex, Tx, UninitStateMachine, PIO}, @@ -239,18 +239,18 @@ where ///``` pub struct Ws2812
where
- C: CountDown,
+ C: DelayNs,
I: AnyPin ,
- cd: C,
+ timer: C,
}
impl Ws2812
where
- C: CountDown,
+ C: DelayNs,
I: AnyPin ,
sm: UninitStateMachine<(P, SM)>,
clock_freq: fugit::HertzU32,
- cd: C,
+ timer: C,
) -> Ws2812 {
let driver = Ws2812Direct::new(pin, pio, sm, clock_freq);
- Self { driver, cd }
+ Self { driver, timer }
}
}
impl SmartLedsWrite for Ws2812
where
- C: CountDown,
- C::Time: From SmartLedsWrite02 for Ws2812
where
- C: CountDown,
- C::Time: From