diff --git a/src/epd1in54/mod.rs b/src/epd1in54/mod.rs index 5d0c7f1..7b19b7d 100644 --- a/src/epd1in54/mod.rs +++ b/src/epd1in54/mod.rs @@ -94,7 +94,7 @@ where } -impl WaveshareInterface +impl WaveshareInterface for EPD1in54 where SPI: Write, @@ -102,7 +102,6 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - Delay: DelayUs + DelayMs, { fn width(&self) -> u16 { WIDTH diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index db6fa03..7eaeccd 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -189,7 +189,7 @@ where } } -impl EPD2in9 +impl EPD2in9 where SPI: Write, CS: OutputPin, diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index 3905f99..f4bac81 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -285,14 +285,13 @@ where } } -impl EPD4in2 +impl EPD4in2 where SPI: Write, CS: OutputPin, BUSY: InputPin, DC: OutputPin, RST: OutputPin, - D: DelayUs + DelayMs, { fn command(&mut self, command: Command) -> Result<(), ERR> { self.interface.cmd(command) diff --git a/src/traits/mod.rs b/src/traits/mod.rs index c6f58ea..0ec5c8f 100644 --- a/src/traits/mod.rs +++ b/src/traits/mod.rs @@ -61,8 +61,8 @@ where /// Creates a new driver from a SPI peripheral, CS Pin, Busy InputPin, DC /// /// This already initialises the device. That means [init()](WaveshareInterface::init()) isn't needed directly afterwards - fn new>( - spi: SPI, cs: CS, busy: BUSY, dc: DC, rst: RST, delay: DELAY, + fn new>( + spi: SPI, cs: CS, busy: BUSY, dc: DC, rst: RST, delay: &mut DELAY, ) -> Result where Self: Sized; @@ -75,7 +75,7 @@ where /// and initialising which already contains the reset fn sleep(&mut self) -> Result<(), ERR>; - fn wake_up(&mut self) -> Result<(), ERR>; + fn wake_up>(&mut self, delay: &mut DELAY) -> Result<(), ERR>; /// Sets the backgroundcolor for various commands like [clear_frame()](WaveshareInterface::clear_frame())