From 3edeac413dc6e1621de9e32f26b60df6a00e8cd8 Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Wed, 14 Jul 2021 23:06:29 +0200 Subject: [PATCH 1/3] Provide full QuickRefresh interface for 4in2 too This display needs no special commands for displaying the new frame. But it will come in handy to support the full QuickRefresh trait when it comes to supporting different quick refresh capable displays from an application. --- src/epd4in2/mod.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index 3ab7e6e..9560206 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -482,21 +482,24 @@ where Ok(()) } - /// This function is not needed for this display - #[allow(unused)] + /// This is wrapper around `display_frame` for using this device as a true + /// `QuickRefresh` device. fn display_new_frame(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { - unimplemented!() + self.display_frame(spi, delay) } - /// This function is not needed for this display - #[allow(unused)] + /// This is wrapper around `update_new_frame` and `display_frame` for using + /// this device as a true `QuickRefresh` device. + /// + /// To be used immediately after `update_old_frame`. fn update_and_display_new_frame( &mut self, spi: &mut SPI, buffer: &[u8], delay: &mut DELAY, ) -> Result<(), SPI::Error> { - unimplemented!() + self.update_new_frame(spi, buffer, delay)?; + self.display_frame(spi, delay) } fn update_partial_old_frame( From 1a09b81ab6ba6b54afd977d082b9810434c9a59f Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Wed, 14 Jul 2021 23:19:28 +0200 Subject: [PATCH 2/3] Clean up some warnings from 'cargo doc' --- src/epd2in13bc/mod.rs | 2 +- src/epd2in9_v2/mod.rs | 2 +- src/lib.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/epd2in13bc/mod.rs b/src/epd2in13bc/mod.rs index ef5a044..12d6972 100644 --- a/src/epd2in13bc/mod.rs +++ b/src/epd2in13bc/mod.rs @@ -1,5 +1,5 @@ //! A simple Driver for the Waveshare 2.13" (B/C) E-Ink Display via SPI -//! More information on this display can be found at the [Waveshare Wiki]:(https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT_(B)) +//! More information on this display can be found at the [Waveshare Wiki](https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT_(B)) //! This driver was build and tested for 212x104, 2.13inch E-Ink display HAT for Raspberry Pi, three-color, SPI interface //! //! # Example for the 2.13" E-Ink Display diff --git a/src/epd2in9_v2/mod.rs b/src/epd2in9_v2/mod.rs index 1c94e46..5158627 100644 --- a/src/epd2in9_v2/mod.rs +++ b/src/epd2in9_v2/mod.rs @@ -1,6 +1,6 @@ //! A simple Driver for the Waveshare 2.9" E-Ink Display V2 via SPI //! -//! Specification: https://www.waveshare.com/w/upload/7/79/2.9inch-e-paper-v2-specification.pdf +//! Specification: //! //! # Example for the 2.9 in E-Ink Display V2 //! diff --git a/src/lib.rs b/src/lib.rs index 0319c0e..2fe9c5f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,9 +109,9 @@ pub mod prelude { /// unused /// bits width /// <----><------------------------> -/// [XXXXX210][76543210]...[76543210] ^ -/// [XXXXX210][76543210]...[76543210] | height -/// [XXXXX210][76543210]...[76543210] v +/// \[XXXXX210\]\[76543210\]...\[76543210\] ^ +/// \[XXXXX210\]\[76543210\]...\[76543210\] | height +/// \[XXXXX210\]\[76543210\]...\[76543210\] v pub const fn buffer_len(width: usize, height: usize) -> usize { (width + 7) / 8 * height } From b84531977152e17e37cc09f0f9e263552c1c1cd2 Mon Sep 17 00:00:00 2001 From: Chris <11088935+caemor@users.noreply.github.com> Date: Thu, 15 Jul 2021 07:54:13 +0200 Subject: [PATCH 3/3] Update src/epd4in2/mod.rs --- src/epd4in2/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index 9560206..900d20d 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -482,7 +482,7 @@ where Ok(()) } - /// This is wrapper around `display_frame` for using this device as a true + /// This is a wrapper around `display_frame` for using this device as a true /// `QuickRefresh` device. fn display_new_frame(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { self.display_frame(spi, delay)