From 378918f7ad11919e2d3cf86022f617605eb05482 Mon Sep 17 00:00:00 2001 From: Alex Martens Date: Thu, 28 Dec 2023 14:44:48 -0800 Subject: [PATCH] embedded-hal: 1.0.0-rc.1 -> 1.0.0-rc.3 --- Cargo.toml | 8 +++----- examples/epd1in54_no_graphics.rs | 6 +++--- examples/epd2in13_v2.rs | 6 +++--- examples/epd2in13bc.rs | 6 +++--- examples/epd4in2.rs | 6 +++--- examples/epd4in2_variable_size.rs | 6 +++--- src/epd1in54/mod.rs | 6 +++--- src/epd1in54_v2/mod.rs | 6 +++--- src/epd1in54b/mod.rs | 8 ++++---- src/epd1in54c/mod.rs | 8 ++++---- src/epd2in13_v2/mod.rs | 8 ++++---- src/epd2in13bc/mod.rs | 8 ++++---- src/epd2in7b/mod.rs | 8 ++++---- src/epd2in9/mod.rs | 6 +++--- src/epd2in9_v2/mod.rs | 8 ++++---- src/epd2in9bc/mod.rs | 8 ++++---- src/epd3in7/mod.rs | 6 +++--- src/epd4in2/mod.rs | 8 ++++---- src/epd5in65f/mod.rs | 8 ++++---- src/epd5in83b_v2/mod.rs | 10 +++++----- src/epd7in5/mod.rs | 8 ++++---- src/epd7in5_hd/mod.rs | 8 ++++---- src/epd7in5_v2/mod.rs | 8 ++++---- src/epd7in5_v3/mod.rs | 10 +++++----- src/epd7in5b_v2/mod.rs | 8 ++++---- src/interface.rs | 4 ++-- src/traits.rs | 8 ++++---- 27 files changed, 98 insertions(+), 100 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6eff17ec..69f4b33c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,20 +17,18 @@ edition = "2021" [dependencies] embedded-graphics-core = { version = "0.4", optional = true } -embedded-hal = { version = "1.0.0-rc.1" } +embedded-hal = "1.0.0-rc.3" bit_field = "0.10.1" [dev-dependencies] embedded-graphics = "0.8" - -embedded-hal-mock = { git = "https://github.com/newAM/embedded-hal-mock", branch = "eh1-rc.1", default-features = false, features = [ +embedded-hal-mock = { version = "=0.10.0-rc.4", default-features = false, features = [ "eh1", ] } -# embedded-hal-mock = "0.9" [target.'cfg(unix)'.dev-dependencies] # linux-embedded-hal = "0.3" -linux-embedded-hal = { git = "https://github.com/rust-embedded/linux-embedded-hal" } +linux-embedded-hal = { git = "https://github.com/rust-embedded/linux-embedded-hal", rev = "a1fb24103e575615a29c6748cdeff1f0e7a3dae3" } [[example]] name = "epd1in54_no_graphics" diff --git a/examples/epd1in54_no_graphics.rs b/examples/epd1in54_no_graphics.rs index 7df04a00..4baac378 100644 --- a/examples/epd1in54_no_graphics.rs +++ b/examples/epd1in54_no_graphics.rs @@ -1,11 +1,11 @@ #![deny(warnings)] -use embedded_hal::delay::DelayUs; +use embedded_hal::delay::DelayNs; use epd_waveshare::{epd1in54::Epd1in54, prelude::*}; use linux_embedded_hal::{ spidev::{self, SpidevOptions}, sysfs_gpio::Direction, - Delay, SPIError, Spidev, SysfsPin, + Delay, SPIError, SpidevDevice, SysfsPin, }; // activate spi, gpio in raspi-config @@ -15,7 +15,7 @@ use linux_embedded_hal::{ fn main() -> Result<(), SPIError> { // Configure SPI // SPI settings are from eink-waveshare-rs documenation - let mut spi = Spidev::open("/dev/spidev0.0")?; + let mut spi = SpidevDevice::open("/dev/spidev0.0")?; let options = SpidevOptions::new() .bits_per_word(8) .max_speed_hz(4_000_000) diff --git a/examples/epd2in13_v2.rs b/examples/epd2in13_v2.rs index d4c63c4c..b3cb64eb 100644 --- a/examples/epd2in13_v2.rs +++ b/examples/epd2in13_v2.rs @@ -6,7 +6,7 @@ use embedded_graphics::{ primitives::{Circle, Line, PrimitiveStyle}, text::{Baseline, Text, TextStyleBuilder}, }; -use embedded_hal::delay::DelayUs; +use embedded_hal::delay::DelayNs; use epd_waveshare::{ color::*, epd2in13_v2::{Display2in13, Epd2in13}, @@ -16,7 +16,7 @@ use epd_waveshare::{ use linux_embedded_hal::{ spidev::{self, SpidevOptions}, sysfs_gpio::Direction, - Delay, SPIError, Spidev, SysfsPin, + Delay, SPIError, SpidevDevice, SysfsPin, }; // The pins in this example are for the Universal e-Paper Raw Panel Driver HAT @@ -27,7 +27,7 @@ use linux_embedded_hal::{ fn main() -> Result<(), SPIError> { // Configure SPI // Settings are taken from - let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory"); + let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory"); let options = SpidevOptions::new() .bits_per_word(8) .max_speed_hz(4_000_000) diff --git a/examples/epd2in13bc.rs b/examples/epd2in13bc.rs index 82a23961..8007acf3 100644 --- a/examples/epd2in13bc.rs +++ b/examples/epd2in13bc.rs @@ -6,7 +6,7 @@ use embedded_graphics::{ primitives::{Circle, Line, PrimitiveStyle}, text::{Baseline, Text, TextStyleBuilder}, }; -use embedded_hal::delay::DelayUs; +use embedded_hal::delay::DelayNs; use epd_waveshare::{ color::*, epd2in13bc::{Display2in13bc, Epd2in13bc}, @@ -16,7 +16,7 @@ use epd_waveshare::{ use linux_embedded_hal::{ spidev::{self, SpidevOptions}, sysfs_gpio::Direction, - Delay, SPIError, Spidev, SysfsPin, + Delay, SPIError, SpidevDevice, SysfsPin, }; // activate spi, gpio in raspi-config @@ -61,7 +61,7 @@ fn main() -> Result<(), SPIError> { // Configure SPI // Settings are taken from - let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory"); + let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory"); let options = SpidevOptions::new() .bits_per_word(8) .max_speed_hz(10_000_000) diff --git a/examples/epd4in2.rs b/examples/epd4in2.rs index 74a6a992..10576124 100644 --- a/examples/epd4in2.rs +++ b/examples/epd4in2.rs @@ -6,7 +6,7 @@ use embedded_graphics::{ primitives::{Circle, Line, PrimitiveStyleBuilder}, text::{Baseline, Text, TextStyleBuilder}, }; -use embedded_hal::delay::DelayUs; +use embedded_hal::delay::DelayNs; use epd_waveshare::{ color::*, epd4in2::{Display4in2, Epd4in2}, @@ -16,7 +16,7 @@ use epd_waveshare::{ use linux_embedded_hal::{ spidev::{self, SpidevOptions}, sysfs_gpio::Direction, - Delay, SPIError, Spidev, SysfsPin, + Delay, SPIError, SpidevDevice, SysfsPin, }; // activate spi, gpio in raspi-config @@ -26,7 +26,7 @@ use linux_embedded_hal::{ fn main() -> Result<(), SPIError> { // Configure SPI // Settings are taken from - let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory"); + let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory"); let options = SpidevOptions::new() .bits_per_word(8) .max_speed_hz(4_000_000) diff --git a/examples/epd4in2_variable_size.rs b/examples/epd4in2_variable_size.rs index e6d92c68..8ff8259d 100644 --- a/examples/epd4in2_variable_size.rs +++ b/examples/epd4in2_variable_size.rs @@ -7,7 +7,7 @@ use embedded_graphics::{ primitives::{Circle, Line, PrimitiveStyleBuilder}, text::{Baseline, Text, TextStyleBuilder}, }; -use embedded_hal::delay::DelayUs; +use embedded_hal::delay::DelayNs; use epd_waveshare::{ color::*, epd4in2::{self, Epd4in2}, @@ -17,7 +17,7 @@ use epd_waveshare::{ use linux_embedded_hal::{ spidev::{self, SpidevOptions}, sysfs_gpio::Direction, - Delay, SPIError, Spidev, SysfsPin, + Delay, SPIError, SpidevDevice, SysfsPin, }; // activate spi, gpio in raspi-config @@ -27,7 +27,7 @@ use linux_embedded_hal::{ fn main() -> Result<(), SPIError> { // Configure SPI // Settings are taken from - let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory"); + let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory"); let options = SpidevOptions::new() .bits_per_word(8) .max_speed_hz(4_000_000) diff --git a/src/epd1in54/mod.rs b/src/epd1in54/mod.rs index 9bc1b7fe..4a4514ed 100644 --- a/src/epd1in54/mod.rs +++ b/src/epd1in54/mod.rs @@ -94,7 +94,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { self.interface.reset(delay, 10_000, 10_000); @@ -149,7 +149,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn width(&self) -> u32 { @@ -300,7 +300,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { pub(crate) fn use_full_frame( &mut self, diff --git a/src/epd1in54_v2/mod.rs b/src/epd1in54_v2/mod.rs index 0f0399f7..1208d960 100644 --- a/src/epd1in54_v2/mod.rs +++ b/src/epd1in54_v2/mod.rs @@ -44,7 +44,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { self.interface.reset(delay, 10_000, 10_000); @@ -94,7 +94,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn width(&self) -> u32 { @@ -267,7 +267,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { pub(crate) fn use_full_frame( &mut self, diff --git a/src/epd1in54b/mod.rs b/src/epd1in54b/mod.rs index 0a477bf4..22177db9 100644 --- a/src/epd1in54b/mod.rs +++ b/src/epd1in54b/mod.rs @@ -50,7 +50,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { self.interface.reset(delay, 10_000, 10_000); @@ -96,7 +96,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn update_color_frame( &mut self, @@ -146,7 +146,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -324,7 +324,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd1in54c/mod.rs b/src/epd1in54c/mod.rs index 341baf7d..445f9ab7 100644 --- a/src/epd1in54c/mod.rs +++ b/src/epd1in54c/mod.rs @@ -47,7 +47,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Based on Reference Program Code from: @@ -83,7 +83,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn update_color_frame( &mut self, @@ -128,7 +128,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -265,7 +265,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd2in13_v2/mod.rs b/src/epd2in13_v2/mod.rs index 7712835d..5d8d4e0b 100644 --- a/src/epd2in13_v2/mod.rs +++ b/src/epd2in13_v2/mod.rs @@ -16,7 +16,7 @@ //! use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -87,7 +87,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // HW reset @@ -180,7 +180,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -392,7 +392,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// When using partial refresh, the controller uses the provided buffer for /// comparison with new buffer. diff --git a/src/epd2in13bc/mod.rs b/src/epd2in13bc/mod.rs index 280f47a7..b47250de 100644 --- a/src/epd2in13bc/mod.rs +++ b/src/epd2in13bc/mod.rs @@ -104,7 +104,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Values taken from datasheet and sample code @@ -147,7 +147,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn update_color_frame( &mut self, @@ -198,7 +198,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = TriColor; fn new( @@ -347,7 +347,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd2in7b/mod.rs b/src/epd2in7b/mod.rs index 941d0393..2db23059 100644 --- a/src/epd2in7b/mod.rs +++ b/src/epd2in7b/mod.rs @@ -54,7 +54,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // reset the device @@ -119,7 +119,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -280,7 +280,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn update_color_frame( &mut self, @@ -335,7 +335,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index 6e3e178d..48c5bdcc 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -91,7 +91,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { self.interface.reset(delay, 10_000, 10_000); @@ -142,7 +142,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn width(&self) -> u32 { @@ -296,7 +296,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn use_full_frame(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // choose full frame/ram diff --git a/src/epd2in9_v2/mod.rs b/src/epd2in9_v2/mod.rs index 7004a77e..d9c4bcf0 100644 --- a/src/epd2in9_v2/mod.rs +++ b/src/epd2in9_v2/mod.rs @@ -114,7 +114,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { self.interface.reset(delay, 10_000, 2_000); @@ -155,7 +155,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn width(&self) -> u32 { @@ -297,7 +297,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn use_full_frame(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // choose full frame/ram @@ -383,7 +383,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// To be followed immediately by `update_new_frame`. fn update_old_frame( diff --git a/src/epd2in9bc/mod.rs b/src/epd2in9bc/mod.rs index 121c5680..30611706 100644 --- a/src/epd2in9bc/mod.rs +++ b/src/epd2in9bc/mod.rs @@ -108,7 +108,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Values taken from datasheet and sample code @@ -151,7 +151,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn update_color_frame( &mut self, @@ -202,7 +202,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -351,7 +351,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd3in7/mod.rs b/src/epd3in7/mod.rs index c7f06855..c01c49fa 100644 --- a/src/epd3in7/mod.rs +++ b/src/epd3in7/mod.rs @@ -3,7 +3,7 @@ //! //! Build with the help of documentation/code from [Waveshare](https://www.waveshare.com/wiki/3.7inch_e-Paper_HAT), use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -57,7 +57,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // reset the device @@ -130,7 +130,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index fe43d0ef..a1c2a0d4 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -101,7 +101,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // reset the device @@ -155,7 +155,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -354,7 +354,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) @@ -449,7 +449,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// To be followed immediately after by `update_old_frame`. fn update_old_frame( diff --git a/src/epd5in65f/mod.rs b/src/epd5in65f/mod.rs index 6233955b..1a70b78a 100644 --- a/src/epd5in65f/mod.rs +++ b/src/epd5in65f/mod.rs @@ -7,7 +7,7 @@ //! - [Waveshare Python driver](https://github.com/waveshare/e-Paper/blob/master/RaspberryPi%26JetsonNano/python/lib/waveshare_epd/epd5in65f.py) use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -55,7 +55,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Reset the device @@ -87,7 +87,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = OctColor; fn new( @@ -213,7 +213,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd5in83b_v2/mod.rs b/src/epd5in83b_v2/mod.rs index d1df524e..abafbf3b 100644 --- a/src/epd5in83b_v2/mod.rs +++ b/src/epd5in83b_v2/mod.rs @@ -7,7 +7,7 @@ //! - [Waveshare Python driver](https://github.com/waveshare/e-Paper/blob/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd5in83b_V2.py) use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -57,7 +57,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Reset the device @@ -101,7 +101,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn update_color_frame( &mut self, @@ -145,7 +145,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -308,7 +308,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd7in5/mod.rs b/src/epd7in5/mod.rs index 5b89e1a1..121b780d 100644 --- a/src/epd7in5/mod.rs +++ b/src/epd7in5/mod.rs @@ -7,7 +7,7 @@ //! - [Waveshare Python driver](https://github.com/waveshare/e-Paper/blob/702def06bcb75983c98b0f9d25d43c552c248eb0/RaspberryPi%26JetsonNano/python/lib/waveshare_epd/epd7in5.py) use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -55,7 +55,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Reset the device @@ -110,7 +110,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -243,7 +243,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd7in5_hd/mod.rs b/src/epd7in5_hd/mod.rs index 5ef9cd47..c566b56c 100644 --- a/src/epd7in5_hd/mod.rs +++ b/src/epd7in5_hd/mod.rs @@ -10,7 +10,7 @@ //! - [Waveshare Python driver](https://github.com/waveshare/e-Paper/blob/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd7in5_HD.py) //! use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -58,7 +58,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Reset the device @@ -110,7 +110,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -240,7 +240,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd7in5_v2/mod.rs b/src/epd7in5_v2/mod.rs index f971bf43..26fa9dba 100644 --- a/src/epd7in5_v2/mod.rs +++ b/src/epd7in5_v2/mod.rs @@ -11,7 +11,7 @@ //! The hardware and interface of V2 are compatible with V1, however, the related software should be updated. use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -59,7 +59,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Reset the device @@ -92,7 +92,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = Color; fn new( @@ -217,7 +217,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd7in5_v3/mod.rs b/src/epd7in5_v3/mod.rs index 962924af..657db1e0 100644 --- a/src/epd7in5_v3/mod.rs +++ b/src/epd7in5_v3/mod.rs @@ -8,7 +8,7 @@ //! use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -63,7 +63,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Reset the device @@ -97,7 +97,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn update_color_frame( &mut self, @@ -148,7 +148,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = TriColor; fn new( @@ -284,7 +284,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> { self.interface.cmd(spi, command) diff --git a/src/epd7in5b_v2/mod.rs b/src/epd7in5b_v2/mod.rs index c71d030c..ed79a36e 100644 --- a/src/epd7in5b_v2/mod.rs +++ b/src/epd7in5b_v2/mod.rs @@ -11,7 +11,7 @@ //! The hardware and interface of V2 are compatible with V1, however, the related software should be updated. use embedded_hal::{ - delay::DelayUs, + delay::DelayNs, digital::{InputPin, OutputPin}, spi::SpiDevice, }; @@ -61,7 +61,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // Reset the device @@ -110,7 +110,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { type DisplayColor = TriColor; fn new( @@ -247,7 +247,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// temporary replacement for missing delay in the trait to call wait_until_idle #[allow(clippy::too_many_arguments)] diff --git a/src/interface.rs b/src/interface.rs index e53d9186..f3a9a3d7 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -28,7 +28,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// Creates a new `DisplayInterface` struct /// @@ -182,7 +182,7 @@ where /// /// Most likely there was a mistake with the 2in9 busy connection /// //TODO: use the #cfg feature to make this compile the right way for the certain types - pub(crate) fn is_busy(&self, is_busy_low: bool) -> bool { + pub(crate) fn is_busy(&mut self, is_busy_low: bool) -> bool { (is_busy_low && self.busy.is_low().unwrap_or(false)) || (!is_busy_low && self.busy.is_high().unwrap_or(false)) } diff --git a/src/traits.rs b/src/traits.rs index 25df34ad..b1f3f731 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -24,7 +24,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// This initialises the EPD and powers it up /// @@ -47,7 +47,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// Transmit data to the SRAM of the EPD /// @@ -132,7 +132,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// The Color Type used by the Display type DisplayColor; @@ -291,7 +291,7 @@ where BUSY: InputPin, DC: OutputPin, RST: OutputPin, - DELAY: DelayUs, + DELAY: DelayNs, { /// Updates the old frame. fn update_old_frame(