From 0ff5bee9d119cf0628976398034416c85e878592 Mon Sep 17 00:00:00 2001 From: Caemor <11088935+caemor@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:46:38 +0100 Subject: [PATCH 1/2] Clippy fixes --- src/epd2in13_v2/command.rs | 1 - src/epd2in9d/mod.rs | 8 ++++---- src/epd5in65f/command.rs | 4 ++-- src/graphics.rs | 6 +++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/epd2in13_v2/command.rs b/src/epd2in13_v2/command.rs index 55e6d048..1eaf242f 100644 --- a/src/epd2in13_v2/command.rs +++ b/src/epd2in13_v2/command.rs @@ -89,7 +89,6 @@ impl DriverOutput { /// | | `------------- load temp /// | `--------------- enable clock /// `----------------- enable analog - pub(crate) struct DisplayUpdateControl2(pub u8); #[allow(dead_code)] impl DisplayUpdateControl2 { diff --git a/src/epd2in9d/mod.rs b/src/epd2in9d/mod.rs index 4a7e0952..50619060 100644 --- a/src/epd2in9d/mod.rs +++ b/src/epd2in9d/mod.rs @@ -291,10 +291,10 @@ where RST: OutputPin, DELAY: DelayNs, { - /// Wake Up Screen - /// - /// After the screen sleeps, it enters deep sleep mode. If you need to refresh the screen while in deep sleep mode, you must first execute awaken(). - /// Wake the screen. + // /// Wake Up Screen + // /// + // /// After the screen sleeps, it enters deep sleep mode. If you need to refresh the screen while in deep sleep mode, you must first execute awaken(). + // /// Wake the screen. // fn awaken(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { // // reset the device // self.interface.reset(delay, 20_000, 2_000); diff --git a/src/epd5in65f/command.rs b/src/epd5in65f/command.rs index 23d2246e..b990b10c 100644 --- a/src/epd5in65f/command.rs +++ b/src/epd5in65f/command.rs @@ -111,10 +111,10 @@ pub(crate) enum Command { /// This command defines alternative resolution and this setting is of higher priority /// than the RES\[1:0\] in R00H (PSR). TconResolution = 0x61, - /// This command defines MCU host direct access external memory mode. + // /// This command defines MCU host direct access external memory mode. //SpiFlashControl = 0x65, - /// The LUT_REV / Chip Revision is read from OTP address = 25001 and 25000. + // /// The LUT_REV / Chip Revision is read from OTP address = 25001 and 25000. //Revision = 0x70, /// This command reads the IC status. GetStatus = 0x71, diff --git a/src/graphics.rs b/src/graphics.rs index cd5e1eda..d24b535c 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -192,7 +192,7 @@ pub struct VarDisplay<'a, COLOR: ColorType + PixelColor> { } /// For use with embedded_grahics -impl<'a, COLOR: ColorType + PixelColor> DrawTarget for VarDisplay<'a, COLOR> { +impl DrawTarget for VarDisplay<'_, COLOR> { type Color = COLOR; type Error = core::convert::Infallible; @@ -208,7 +208,7 @@ impl<'a, COLOR: ColorType + PixelColor> DrawTarget for VarDisplay<'a, COLOR> { } /// For use with embedded_grahics -impl<'a, COLOR: ColorType + PixelColor> OriginDimensions for VarDisplay<'a, COLOR> { +impl OriginDimensions for VarDisplay<'_, COLOR> { fn size(&self) -> Size { match self.rotation { DisplayRotation::Rotate0 | DisplayRotation::Rotate180 => { @@ -296,7 +296,7 @@ impl<'a, COLOR: ColorType + PixelColor> VarDisplay<'a, COLOR> { } /// Some Tricolor specifics -impl<'a> VarDisplay<'a, TriColor> { +impl VarDisplay<'_, TriColor> { /// get black/white internal buffer to use it (to draw in epd) pub fn bw_buffer(&self) -> &[u8] { &self.buffer[..self.buffer_size() / 2] From c6427c15d099b45e11d3a939100904233fd64080 Mon Sep 17 00:00:00 2001 From: Caemor <11088935+caemor@users.noreply.github.com> Date: Thu, 5 Dec 2024 21:03:24 +0100 Subject: [PATCH 2/2] Update min required version to real minimum required version (1.62) --- Cargo.toml | 1 + README.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 763e25ad..73c33370 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ readme = "README.md" repository = "https://github.com/Caemor/epd-waveshare.git" version = "0.6.0" edition = "2021" +rust-version = "1.62" [dependencies] embedded-graphics-core = { version = "0.4", optional = true } diff --git a/README.md b/README.md index 3b4afd74..7e075b8d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Display ones). It uses the [embedded graphics](https://crates.io/crates/embedded-graphics) library for the optional graphics support. -A 2018-edition compatible version (Rust 1.31+) is needed. +A 2021-edition compatible version (Rust 1.62+) is needed. Other similar libraries with support for much more displays are [u8g2](https://github.com/olikraus/u8g2) and [GxEPD](https://github.com/ZinggJM/GxEPD) for arduino. @@ -46,6 +46,7 @@ epd4in2.update_and_display_frame(&mut spi, display.buffer(), &mut delay).expect( // Going to sleep epd4in2.sleep(&mut spi, &mut delay) ``` + > Check the complete example [here](./examples/epd4in2.rs). ## (Supported) Devices