From 271922a8b12d486e742ac7615908e408bab050b8 Mon Sep 17 00:00:00 2001 From: Denis Chaplygin Date: Wed, 15 Dec 2021 17:14:17 +0200 Subject: [PATCH] Added documentation and changelog entries. --- CHANGELOG.md | 3 +++ src/epd5in83b_v2/graphics.rs | 2 +- src/graphics.rs | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9745f5..8e087e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### 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) + ### Changed ### Fixed diff --git a/src/epd5in83b_v2/graphics.rs b/src/epd5in83b_v2/graphics.rs index 4541ea0..e5ab2d5 100644 --- a/src/epd5in83b_v2/graphics.rs +++ b/src/epd5in83b_v2/graphics.rs @@ -82,8 +82,8 @@ mod tests { use super::*; use crate::color::TriColor::Black; use crate::color::TriColor::Color; - use crate::graphics::DisplayRotation; use crate::epd5in83b_v2; + use crate::graphics::DisplayRotation; use embedded_graphics::{ prelude::*, primitives::{Line, PrimitiveStyle}, diff --git a/src/graphics.rs b/src/graphics.rs index b966761..3273db8 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -25,6 +25,14 @@ impl Default for DisplayRotation { } /// Display specific pixel output configuration +/// +/// Different chromatic displays differently treat the bits in chromatic color planes. +/// Some of them ([crate::epd2in13bc]) will render a color pixel if bit is set for that pixel, +/// which is a [DisplayColorRendering::Positive] mode. +/// +/// Other displays, like [crate::epd5in83b_v2] in opposite, will draw color pixel if bit is +/// cleared for that pixel, which is a [DisplayColorRendering::Negative] mode. +/// #[derive(Clone, Copy)] pub enum DisplayColorRendering { /// Positive: chromatic doesn't override white, white bit cleared for black, white bit set for white, both bits set for chromatic @@ -133,6 +141,15 @@ pub trait TriDisplay: DrawTarget { /// Helperfunction for the Embedded Graphics draw trait /// /// Becomes uneccesary when const_generics become stablised + /// + /// # Arguments + /// + /// * `width` - Screen width in pixels + /// * `height` - Screen height in pixels + /// * `pixel` - Pixel to draw + /// * `rendering` - Chooses rendering mode for the color plane, + /// whether it is positive or negative. Check [DisplayColorRendering] for details. + /// This is a hardware defined setting, that needs to be checked from the datasheet. fn draw_helper_tri( &mut self, width: u32,