Merge pull request #81 from sirhcel/quickrefresh-interface-epd4in2
Provide full QuickRefresh interface for 4.2 inch display and some doc improvements thanks to @sirhcelmain
commit
2f31f4bebc
|
|
@ -1,5 +1,5 @@
|
||||||
//! A simple Driver for the Waveshare 2.13" (B/C) E-Ink Display via SPI
|
//! 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
|
//! 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
|
//! # Example for the 2.13" E-Ink Display
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//! A simple Driver for the Waveshare 2.9" E-Ink Display V2 via SPI
|
//! 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: <https://www.waveshare.com/w/upload/7/79/2.9inch-e-paper-v2-specification.pdf>
|
||||||
//!
|
//!
|
||||||
//! # Example for the 2.9 in E-Ink Display V2
|
//! # Example for the 2.9 in E-Ink Display V2
|
||||||
//!
|
//!
|
||||||
|
|
|
||||||
|
|
@ -482,21 +482,24 @@ where
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This function is not needed for this display
|
/// This is a wrapper around `display_frame` for using this device as a true
|
||||||
#[allow(unused)]
|
/// `QuickRefresh` device.
|
||||||
fn display_new_frame(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
|
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
|
/// This is wrapper around `update_new_frame` and `display_frame` for using
|
||||||
#[allow(unused)]
|
/// this device as a true `QuickRefresh` device.
|
||||||
|
///
|
||||||
|
/// To be used immediately after `update_old_frame`.
|
||||||
fn update_and_display_new_frame(
|
fn update_and_display_new_frame(
|
||||||
&mut self,
|
&mut self,
|
||||||
spi: &mut SPI,
|
spi: &mut SPI,
|
||||||
buffer: &[u8],
|
buffer: &[u8],
|
||||||
delay: &mut DELAY,
|
delay: &mut DELAY,
|
||||||
) -> Result<(), SPI::Error> {
|
) -> Result<(), SPI::Error> {
|
||||||
unimplemented!()
|
self.update_new_frame(spi, buffer, delay)?;
|
||||||
|
self.display_frame(spi, delay)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_partial_old_frame(
|
fn update_partial_old_frame(
|
||||||
|
|
|
||||||
|
|
@ -109,9 +109,9 @@ pub mod prelude {
|
||||||
/// unused
|
/// unused
|
||||||
/// bits width
|
/// bits width
|
||||||
/// <----><------------------------>
|
/// <----><------------------------>
|
||||||
/// [XXXXX210][76543210]...[76543210] ^
|
/// \[XXXXX210\]\[76543210\]...\[76543210\] ^
|
||||||
/// [XXXXX210][76543210]...[76543210] | height
|
/// \[XXXXX210\]\[76543210\]...\[76543210\] | height
|
||||||
/// [XXXXX210][76543210]...[76543210] v
|
/// \[XXXXX210\]\[76543210\]...\[76543210\] v
|
||||||
pub const fn buffer_len(width: usize, height: usize) -> usize {
|
pub const fn buffer_len(width: usize, height: usize) -> usize {
|
||||||
(width + 7) / 8 * height
|
(width + 7) / 8 * height
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue