From d69884eb7c0d35d98a08b2e66f15597979b1f08d Mon Sep 17 00:00:00 2001 From: Caemor <11088935+caemor@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:17:21 +0100 Subject: [PATCH 1/4] Update to embedded hal mock 0.11 --- Cargo.toml | 2 +- src/epd1in54/mod.rs | 8 ++++---- src/epd2in13bc/mod.rs | 8 ++++---- src/epd2in9/mod.rs | 8 ++++---- src/epd2in9_v2/mod.rs | 8 ++++---- src/epd2in9bc/mod.rs | 8 ++++---- src/epd4in2/mod.rs | 8 ++++---- src/lib.rs | 8 ++++---- src/traits.rs | 16 ++++++++-------- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 55d682a7..8c2f029d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ bit_field = "0.10.1" [dev-dependencies] embedded-graphics = "0.8" -embedded-hal-mock = { version = "=0.10.0", default-features = false, features = [ +embedded-hal-mock = { version = "0.11", default-features = false, features = [ "eh1", ] } diff --git a/src/epd1in54/mod.rs b/src/epd1in54/mod.rs index 4a4514ed..b598693e 100644 --- a/src/epd1in54/mod.rs +++ b/src/epd1in54/mod.rs @@ -13,10 +13,10 @@ //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); //!# let expectations = []; -//!# let cs_pin = pin::Mock::new(&expectations); -//!# let busy_in = pin::Mock::new(&expectations); -//!# let dc = pin::Mock::new(&expectations); -//!# let rst = pin::Mock::new(&expectations); +//!# let cs_pin = digital::Mock::new(&expectations); +//!# let busy_in = digital::Mock::new(&expectations); +//!# let dc = digital::Mock::new(&expectations); +//!# let rst = digital::Mock::new(&expectations); //!# let mut delay = delay::NoopDelay::new(); //! //!// Setup EPD diff --git a/src/epd2in13bc/mod.rs b/src/epd2in13bc/mod.rs index 9d1f0d88..d1256c4c 100644 --- a/src/epd2in13bc/mod.rs +++ b/src/epd2in13bc/mod.rs @@ -13,10 +13,10 @@ //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); //!# let expectations = []; -//!# let cs_pin = pin::Mock::new(&expectations); -//!# let busy_in = pin::Mock::new(&expectations); -//!# let dc = pin::Mock::new(&expectations); -//!# let rst = pin::Mock::new(&expectations); +//!# let cs_pin = digital::Mock::new(&expectations); +//!# let busy_in = digital::Mock::new(&expectations); +//!# let dc = digital::Mock::new(&expectations); +//!# let rst = digital::Mock::new(&expectations); //!# let mut delay = delay::NoopDelay::new(); //! //!// Setup EPD diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index 48c5bdcc..0ad3d771 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -14,10 +14,10 @@ //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); //!# let expectations = []; -//!# let cs_pin = pin::Mock::new(&expectations); -//!# let busy_in = pin::Mock::new(&expectations); -//!# let dc = pin::Mock::new(&expectations); -//!# let rst = pin::Mock::new(&expectations); +//!# let cs_pin = digital::Mock::new(&expectations); +//!# let busy_in = digital::Mock::new(&expectations); +//!# let dc = digital::Mock::new(&expectations); +//!# let rst = digital::Mock::new(&expectations); //!# let mut delay = delay::NoopDelay::new(); //! //!// Setup EPD diff --git a/src/epd2in9_v2/mod.rs b/src/epd2in9_v2/mod.rs index 3a36fdf7..86997be9 100644 --- a/src/epd2in9_v2/mod.rs +++ b/src/epd2in9_v2/mod.rs @@ -15,10 +15,10 @@ //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); //!# let expectations = []; -//!# let cs_pin = pin::Mock::new(&expectations); -//!# let busy_in = pin::Mock::new(&expectations); -//!# let dc = pin::Mock::new(&expectations); -//!# let rst = pin::Mock::new(&expectations); +//!# let cs_pin = digital::Mock::new(&expectations); +//!# let busy_in = digital::Mock::new(&expectations); +//!# let dc = digital::Mock::new(&expectations); +//!# let rst = digital::Mock::new(&expectations); //!# let mut delay = delay::NoopDelay::new(); //! //!// Setup EPD diff --git a/src/epd2in9bc/mod.rs b/src/epd2in9bc/mod.rs index 0f6d52b2..7a4ba92c 100644 --- a/src/epd2in9bc/mod.rs +++ b/src/epd2in9bc/mod.rs @@ -13,10 +13,10 @@ //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); //!# let expectations = []; -//!# let cs_pin = pin::Mock::new(&expectations); -//!# let busy_in = pin::Mock::new(&expectations); -//!# let dc = pin::Mock::new(&expectations); -//!# let rst = pin::Mock::new(&expectations); +//!# let cs_pin = digital::Mock::new(&expectations); +//!# let busy_in = digital::Mock::new(&expectations); +//!# let dc = digital::Mock::new(&expectations); +//!# let rst = digital::Mock::new(&expectations); //!# let mut delay = delay::NoopDelay::new(); //! //!// Setup EPD diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index a1c2a0d4..6de676e6 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -18,10 +18,10 @@ //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); //!# let expectations = []; -//!# let cs_pin = pin::Mock::new(&expectations); -//!# let busy_in = pin::Mock::new(&expectations); -//!# let dc = pin::Mock::new(&expectations); -//!# let rst = pin::Mock::new(&expectations); +//!# let cs_pin = digital::Mock::new(&expectations); +//!# let busy_in = digital::Mock::new(&expectations); +//!# let dc = digital::Mock::new(&expectations); +//!# let rst = digital::Mock::new(&expectations); //!# let mut delay = delay::NoopDelay::new(); //! //!// Setup EPD diff --git a/src/lib.rs b/src/lib.rs index 9b393528..2f64bef3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,10 +21,10 @@ //!# let expectations = []; //!# let mut spi = spi::Mock::new(&expectations); //!# let expectations = []; -//!# let cs_pin = pin::Mock::new(&expectations); -//!# let busy_in = pin::Mock::new(&expectations); -//!# let dc = pin::Mock::new(&expectations); -//!# let rst = pin::Mock::new(&expectations); +//!# let cs_pin = digital::Mock::new(&expectations); +//!# let busy_in = digital::Mock::new(&expectations); +//!# let dc = digital::Mock::new(&expectations); +//!# let rst = digital::Mock::new(&expectations); //!# let mut delay = delay::NoopDelay::new(); //! //!// Setup EPD diff --git a/src/traits.rs b/src/traits.rs index b1f3f731..487cfaa0 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -99,10 +99,10 @@ where ///# let expectations = []; ///# let mut spi = spi::Mock::new(&expectations); ///# let expectations = []; -///# let cs_pin = pin::Mock::new(&expectations); -///# let busy_in = pin::Mock::new(&expectations); -///# let dc = pin::Mock::new(&expectations); -///# let rst = pin::Mock::new(&expectations); +///# let cs_pin = digital::Mock::new(&expectations); +///# let busy_in = digital::Mock::new(&expectations); +///# let dc = digital::Mock::new(&expectations); +///# let rst = digital::Mock::new(&expectations); ///# let mut delay = delay::NoopDelay::new(); /// ///// Setup EPD @@ -261,10 +261,10 @@ where ///# let expectations = []; ///# let mut spi = spi::Mock::new(&expectations); ///# let expectations = []; -///# let cs_pin = pin::Mock::new(&expectations); -///# let busy_in = pin::Mock::new(&expectations); -///# let dc = pin::Mock::new(&expectations); -///# let rst = pin::Mock::new(&expectations); +///# let cs_pin = digital::Mock::new(&expectations); +///# let busy_in = digital::Mock::new(&expectations); +///# let dc = digital::Mock::new(&expectations); +///# let rst = digital::Mock::new(&expectations); ///# let mut delay = delay::NoopDelay::new(); ///# ///# // Setup EPD From b7963764ae57006dc799b70f51716673994a4a84 Mon Sep 17 00:00:00 2001 From: Caemor <11088935+caemor@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:19:06 +0100 Subject: [PATCH 2/4] Remove empty doc comments and other clippy improvements --- examples/epd4in2_variable_size.rs | 1 - src/color.rs | 4 ++-- src/epd3in7/command.rs | 12 ------------ src/epd7in5b_v2/mod.rs | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/examples/epd4in2_variable_size.rs b/examples/epd4in2_variable_size.rs index 8ff8259d..978b21d6 100644 --- a/examples/epd4in2_variable_size.rs +++ b/examples/epd4in2_variable_size.rs @@ -1,5 +1,4 @@ #![deny(warnings)] -#![deny(warnings)] use embedded_graphics::{ mono_font::MonoTextStyleBuilder, diff --git a/src/color.rs b/src/color.rs index 74823d3c..c768b2d0 100644 --- a/src/color.rs +++ b/src/color.rs @@ -78,7 +78,7 @@ pub trait ColorType { /// Return the data used to set a pixel color /// /// * bwrbit is used to tell the value of the unused bit when a chromatic - /// color is set (TriColor only as for now) + /// color is set (TriColor only as for now) /// * pos is the pixel position in the line, used to know which pixels must be set /// /// Return values are : @@ -405,7 +405,7 @@ mod tests { // test all values aside from 0 and 1 which all should panic #[test] fn from_u8_panic() { - for val in 2..=u8::max_value() { + for val in 2..=u8::MAX { extern crate std; let result = std::panic::catch_unwind(|| Color::from(val)); assert!(result.is_err()); diff --git a/src/epd3in7/command.rs b/src/epd3in7/command.rs index 5aba926a..13d44a65 100644 --- a/src/epd3in7/command.rs +++ b/src/epd3in7/command.rs @@ -12,24 +12,17 @@ use crate::traits; #[allow(dead_code)] #[derive(Copy, Clone)] pub(crate) enum Command { - /// GateSetting = 0x01, - /// PowerOff = 0x02, - /// Sleep2 = 0x07, - /// GateVoltage = 0x03, - /// GateVoltageSource = 0x04, - /// BoosterSoftStartControl = 0x0C, /// After this command initiated, the chip will enter Deep Sleep Mode, /// BUSY pad will keep output high. /// /// Note: To exit Deep Sleep Mode, User required to send HWRESET to the driver. DeepSleep = 0x10, - /// DataEntrySequence = 0x11, /// This command resets commands and parameters to their S/W Reset default values, /// except Deep Sleep Mode. @@ -58,9 +51,7 @@ pub(crate) enum Command { /// This command writes LUT register from MCU interface (105 bytes), /// which contains the content of VS [nx-LUT], TP #[nX], RP #[n] WriteLutRegister = 0x32, - /// DisplayOption = 0x37, - /// BorderWaveformControl = 0x3C, /// This command specifies the start/end positions of the window address in the X direction, /// by an address unit of RAM. @@ -68,15 +59,12 @@ pub(crate) enum Command { /// This command specifies the start/end positions of the window address in the Y direction, /// by an address unit of RAM. SetRamYAddressStartEndPosition = 0x45, - /// AutoWriteRedRamRegularPattern = 0x46, - /// AutoWriteBwRamRegularPattern = 0x47, /// This command makes the initial settings for the RAM X address in the address counter (AC) SetRamXAddressCounter = 0x4E, /// This command makes the initial settings for the RAM Y address in the address counter (AC) SetRamYAddressCounter = 0x4F, - /// Sleep = 0x50, } diff --git a/src/epd7in5b_v2/mod.rs b/src/epd7in5b_v2/mod.rs index 708dd452..69963c57 100644 --- a/src/epd7in5b_v2/mod.rs +++ b/src/epd7in5b_v2/mod.rs @@ -1,4 +1,4 @@ -//! A simple Driver for the Waveshare 7.5" (B) E-Ink Display (V2) via SPI +//! A simple Driver for the Waveshare 7.5" (B) E-Ink Display (V2 and V3) via SPI //! //! # References //! From 22f726f968e07f555600e4a3813b4399d5938999 Mon Sep 17 00:00:00 2001 From: Caemor <11088935+caemor@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:22:51 +0100 Subject: [PATCH 3/4] Release v0.6 To hopefully allow for faster updates, v0.6 is released as an intermediate release. --- CHANGELOG.md | 59 +++++++++++++++++++++++++++++++++++++++------------- Cargo.toml | 5 +---- 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 210397ee..f0517fbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,55 @@ -# Change Log +# Changelog All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](http://keepachangelog.com/) -and this project adheres to [Semantic Versioning](http://semver.org/). +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [v0.6.0] - 2024-10-28 ### Added -- Added support for positive and negatives modes of rendering in TriColor display in #92 (thanks to @akashihi) -- Added Epd 5in83 V2 (B) support in #92 (thanks to @akashihi) -- Added Epd 7in5 (B) V2 and V3 support +- Add support for positive and negatives modes of rendering in TriColor display in #92 (thanks to @akashihi) +- Add Epd 5in83 V2 (B) support in #92 (thanks to @akashihi) +- Add Epd 7in5 (B) V2 and V3 support in #118 (should also work on v3), thanks to @peckpeck +- Add 7.3 Inch HAT (F) support in #191 (thanks to @jetjinser) +- Add support for EPD 2in9 D in #171 (thanks to @wsndshx) +- Add Epd 5in83 V2 support in #159 (thanks to @Carbonhell) +- Add support for Pi hat Pico Epd2in66B (B/W/R) in #147 (thanks to @ReinoutHeeck and @Lite5h4dow) +- Add support for EPD 2in13 v3 in #126 and #138 (thanks to @fmeef) +- Add embedded-graphics traits for color in #132 (thanks to @peckpeck) +- Add support for EPD 3in7 in #129 (thanks to @mangelajo) +- Add convert traits for TriColor +- Add support for GDEH0154D67 (aka epd1in54_v2) in #106 (thanks to @jcard0na) +- Add option to switch between single byte and blockwise data writen to the spi device +- Added tests and fixed sized method when rotated ### Changed - Made Examples and Linux embedded hal optional (linux only) and therefore allowed building on other hosts (#101, #94) +- Update to eh-1.0, eh-mock 0.10 , leh 0.4.0 +- Documentation tweaks +- Updated and improved Examples and Readme multiple times (thanks to @shymega and many others) +- Updated refresh rate for 2.9in v2 display to make it much faster thanks to @andber1 in #150 (and #185) +- Removed epd7in5_v3 in favour of edp7in5b_v2 since they work the same way in #177 +- Migrated to Rust 2021 in #133 (thanks to @peckpeck) +- Migrate `DelayMs` to `DelayUs` to allow shorter and longer sleeps in #131 (thanks to @peckpeck) +- Improved delay handling by allowing busy or sleep loops in wait_for_idle in #125 thanks to @peckpeck +- Make Display more generic in #123 and #121 (thanks to @peckpeck) ### Fixed +- Overflow error for all displays thanks to @tippfehlr in @186 +- Fix build when feature graphics is not enabled in #176 (thanks to @vhdirk) +- Optimize overflow in the calculation of `NUM_DISPLAY_BYTES` on small architectures in #173 (thanks to @Idicarlo) +- Fixed init code for epd1in54 thanks to @fakusb in #156 +- Fix off-by-one bug for `set_pixel` in #148 thanks to @ReinoutHeeck +- Fix 7in5(HD) by allowing blockwise data to be written in #141 (see issues and discussions in #70, #83, #142) +- Fix enter deep sleep for epd1in54 v2 in #139 (thanks to @jcard0na) +- Fixed buffer length in display struct in #128 (thanks to @peckpeck) +- LUT Fixes for EPD 2in9 v2 in #103 (thanks to @mike-kfed) +- Fix pins for epd2in13_v2 example in #91 Universal e-Paper Raw Panel Driver HAT (thanks to @ole-treichel) + ## [v0.5.0] - 2021-11-28 ### Added @@ -31,7 +62,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added Color conversion methods in #87 & #88 (thanks to @crzysdrs) - Provide full QuickRefresh interface for 4.2 inch display in #81 (thanks to @sirhcel) - ### Changed - Updated embedded-graphics to 0.7 and switch to e-g-core #78 (@Irbalt) & #85 (@jamwaffles) @@ -42,7 +72,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Write data over SPI 1 byte at a time due to #82 (thanks to @belak) - Enable drawing in three colors for epd2in13bc in #76 (thanks to @Irbalt) - ## [v0.4.0] - 2020-04-06 ### Added @@ -130,12 +159,14 @@ Initial release with Changelog - Lots of internal changes - Renamed to `epd-waveshare` -[Unreleased]: https://github.com/Caemor/eink-waveshare-rs/compare/v0.4.0...HEAD +[v0.6.0]: https://github.com/Caemor/epd-waveshare/compare/v0.5.0...v0.6.0 + +[v0.5.0]: https://github.com/Caemor/epd-waveshare/compare/v0.4.0...v0.5.0 -[v0.4.0]: https://github.com/Caemor/eink-waveshare-rs/compare/v0.3.2...v0.4.0 +[v0.4.0]: https://github.com/Caemor/epd-waveshare/compare/v0.3.2...v0.4.0 -[v0.3.2]: https://github.com/Caemor/eink-waveshare-rs/compare/v0.3.1...v0.3.2 +[v0.3.2]: https://github.com/Caemor/epd-waveshare/compare/v0.3.1...v0.3.2 -[v0.3.1]: https://github.com/Caemor/eink-waveshare-rs/compare/v0.3.0...v0.3.1 +[v0.3.1]: https://github.com/Caemor/epd-waveshare/compare/v0.3.0...v0.3.1 -[v0.3.0]: https://github.com/Caemor/eink-waveshare-rs/compare/v0.2.0...v0.3.0 +[v0.3.0]: https://github.com/Caemor/epd-waveshare/compare/v0.2.0...v0.3.0 diff --git a/Cargo.toml b/Cargo.toml index 8c2f029d..763e25ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,12 +9,9 @@ license = "ISC" name = "epd-waveshare" readme = "README.md" repository = "https://github.com/Caemor/epd-waveshare.git" -version = "0.5.0" +version = "0.6.0" edition = "2021" -[badges] -# travis-ci = { repository = "caemor/epd-waveshare" } - [dependencies] embedded-graphics-core = { version = "0.4", optional = true } embedded-hal = "1.0.0" From 5633d506bea60bd4d047dd028df45982f44b6d80 Mon Sep 17 00:00:00 2001 From: Caemor <11088935+caemor@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:13:42 +0100 Subject: [PATCH 4/4] OctColor Bitmask fix to Changelog for 0.6 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0517fbe..71bd6e9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed buffer length in display struct in #128 (thanks to @peckpeck) - LUT Fixes for EPD 2in9 v2 in #103 (thanks to @mike-kfed) - Fix pins for epd2in13_v2 example in #91 Universal e-Paper Raw Panel Driver HAT (thanks to @ole-treichel) +- Fix Color Bitmask calculation for OctColor in #190 (thanks to @jetjinser) ## [v0.5.0] - 2021-11-28