diff --git a/src/epd2in13bc/command.rs b/src/epd2in13bc/command.rs index 7121c50..48c7541 100644 --- a/src/epd2in13bc/command.rs +++ b/src/epd2in13bc/command.rs @@ -1,4 +1,4 @@ -//! SPI Commands for the Waveshare 2.9" (B/C) E-Ink Display +//! SPI Commands for the Waveshare 2.13" (B/C) E-Ink Display use crate::traits; #[allow(dead_code)] diff --git a/src/epd2in13bc/graphics.rs b/src/epd2in13bc/graphics.rs index 16d12d1..64eea72 100644 --- a/src/epd2in13bc/graphics.rs +++ b/src/epd2in13bc/graphics.rs @@ -1,4 +1,4 @@ -use crate::epd2in9bc::{DEFAULT_BACKGROUND_COLOR, HEIGHT, NUM_DISPLAY_BITS, WIDTH}; +use crate::epd2in13bc::{DEFAULT_BACKGROUND_COLOR, HEIGHT, NUM_DISPLAY_BITS, WIDTH}; use crate::graphics::{Display, DisplayRotation}; use embedded_graphics::pixelcolor::BinaryColor; use embedded_graphics::prelude::*; @@ -6,21 +6,21 @@ use embedded_graphics::prelude::*; /// Full size buffer for use with the 2in9b/c EPD /// /// Can also be manually constructed and be used together with VarDisplay -pub struct Display2in9bc { +pub struct Display2in13bc { buffer: [u8; NUM_DISPLAY_BITS as usize], rotation: DisplayRotation, } -impl Default for Display2in9bc { +impl Default for Display2in13bc { fn default() -> Self { - Display2in9bc { + Display2in13bc { buffer: [DEFAULT_BACKGROUND_COLOR.get_byte_value(); NUM_DISPLAY_BITS as usize], rotation: DisplayRotation::default(), } } } -impl DrawTarget for Display2in9bc { +impl DrawTarget for Display2in13bc { type Error = core::convert::Infallible; fn draw_pixel(&mut self, pixel: Pixel) -> Result<(), Self::Error> { @@ -32,7 +32,7 @@ impl DrawTarget for Display2in9bc { } } -impl Display for Display2in9bc { +impl Display for Display2in13bc { fn buffer(&self) -> &[u8] { &self.buffer } diff --git a/src/epd2in13bc/mod.rs b/src/epd2in13bc/mod.rs index 37280f3..d3db78e 100644 --- a/src/epd2in13bc/mod.rs +++ b/src/epd2in13bc/mod.rs @@ -1,6 +1,6 @@ -//! A simple Driver for the Waveshare 2.9" (B/C) E-Ink Display via SPI +//! A simple Driver for the Waveshare 2.13" (B/C) E-Ink Display via SPI //! -//! # Example for the 2.9" E-Ink Display +//! # Example for the 2.13" E-Ink Display //! //!```rust, no_run //!# use embedded_hal_mock::*; @@ -8,7 +8,7 @@ //!use embedded_graphics::{ //! pixelcolor::BinaryColor::On as Black, prelude::*, primitives::Line, style::PrimitiveStyle, //!}; -//!use epd_waveshare::{epd2in9bc::*, prelude::*}; +//!use epd_waveshare::{epd2in13bc::*, prelude::*}; //!# //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); @@ -20,11 +20,11 @@ //!# let mut delay = delay::MockNoop::new(); //! //!// Setup EPD -//!let mut epd = Epd2in9bc::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?; +//!let mut epd = Epd2in13bc::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?; //! //!// Use display graphics from embedded-graphics //!// This display is for the black/white pixels -//!let mut mono_display = Display2in9bc::default(); +//!let mut mono_display = Display2in13bc::default(); //! //!// Use embedded graphics for drawing //!// A black line @@ -33,7 +33,7 @@ //! .draw(&mut mono_display); //! //!// Use a second display for red/yellow -//!let mut chromatic_display = Display2in9bc::default(); +//!let mut chromatic_display = Display2in13bc::default(); //! //!// We use `Black` but it will be shown as red/yellow //!let _ = Line::new(Point::new(15, 120), Point::new(15, 200)) @@ -63,9 +63,9 @@ use crate::traits::{ InternalWiAdditions, RefreshLut, WaveshareDisplay, WaveshareThreeColorDisplay, }; -/// Width of epd2in9bc in pixels +/// Width of epd2in13bc in pixels pub const WIDTH: u32 = 128; -/// Height of epd2in9bc in pixels +/// Height of epd2in13bc in pixels pub const HEIGHT: u32 = 296; /// Default background color (white) of epd2in9bc display pub const DEFAULT_BACKGROUND_COLOR: Color = Color::White; @@ -87,16 +87,16 @@ use self::command::Command; #[cfg(feature = "graphics")] mod graphics; #[cfg(feature = "graphics")] -pub use self::graphics::Display2in9bc; +pub use self::graphics::Display2in13bc; /// Epd2in9bc driver -pub struct Epd2in9bc { +pub struct Epd2in13bc { interface: DisplayInterface, color: Color, } impl InternalWiAdditions - for Epd2in9bc + for Epd2in13bc where SPI: Write, CS: OutputPin, @@ -140,7 +140,7 @@ where } impl WaveshareThreeColorDisplay - for Epd2in9bc + for Epd2in13bc where SPI: Write, CS: OutputPin, @@ -185,7 +185,7 @@ where } impl WaveshareDisplay - for Epd2in9bc + for Epd2in13bc where SPI: Write, CS: OutputPin, @@ -206,7 +206,7 @@ where let interface = DisplayInterface::new(cs, busy, dc, rst); let color = DEFAULT_BACKGROUND_COLOR; - let mut epd = Epd2in9bc { interface, color }; + let mut epd = Epd2in13bc { interface, color }; epd.init(spi, delay)?; @@ -332,7 +332,7 @@ where } } -impl Epd2in9bc +impl Epd2in13bc where SPI: Write, CS: OutputPin, diff --git a/src/lib.rs b/src/lib.rs index 9d43e31..50ee2d2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,6 +76,7 @@ pub mod epd1in54; pub mod epd1in54b; pub mod epd1in54c; pub mod epd2in13_v2; +pub mod epd2in13bc; pub mod epd2in7b; pub mod epd2in9; pub mod epd2in9_v2;