From 12649e377a390414c781cfb8568a987be920c366 Mon Sep 17 00:00:00 2001 From: James Waples Date: Thu, 25 Oct 2018 19:16:12 +0100 Subject: [PATCH 1/4] Bump embedded_graphics dependency to 0.4.4 --- Cargo.toml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c1d920d..31b4417 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,20 +1,18 @@ [package] -name = "ili9341" -version = "0.1.7" -description = "A platform agnostic driver to interface with the ILI9341 (ald ILI9340C) TFT LCD display" authors = ["Yuri Iozzelli "] categories = ["embedded", "hardware-support", "no-std"] +description = "A platform agnostic driver to interface with the ILI9341 (ald ILI9340C) TFT LCD display" keywords = ["embedded-hal-driver", "display", "LCD"] license = "MIT OR Apache-2.0" +name = "ili9341" repository = "https://github.com/yuri91/ili9341-rs" - - +version = "0.1.7" [dependencies] embedded-hal = "0.2.1" [dependencies.embedded-graphics] -version = "0.1.1" optional = true +version = "0.4.4" [features] default = ["graphics"] From 303b1da7699b1abd08a72108679b2f7e8f45c9e4 Mon Sep 17 00:00:00 2001 From: James Waples Date: Thu, 25 Oct 2018 19:38:22 +0100 Subject: [PATCH 2/4] Support black and white drawing using e_g 0.4.4 --- src/lib.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d7d9ca8..4277436 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -276,13 +276,13 @@ where } } -#[cfg(feature = "graphics")] -use embedded_graphics::Drawing; #[cfg(feature = "graphics")] use embedded_graphics::drawable; +#[cfg(feature = "graphics")] +use embedded_graphics::{drawable::Pixel, pixelcolor::PixelColorU16, Drawing}; #[cfg(feature = "graphics")] -impl Drawing for Ili9341 +impl Drawing for Ili9341 where SPI: spi::Transfer + spi::Write, CS: OutputPin, @@ -292,16 +292,21 @@ where { fn draw(&mut self, item_pixels: T) where - T: Iterator, + T: Iterator>, { - for (pos, color) in item_pixels { + for Pixel(pos, color) in item_pixels { self.draw_raw( pos.0 as u16, pos.1 as u16, pos.0 as u16, pos.1 as u16, - if color == 0 { &[0xff,0xff] } else { &[0,0] }, - ).expect("Failed to communicate with device"); + if color == PixelColorU16(0) { + &[0xff, 0xff] + } else { + &[0, 0] + }, + ) + .expect("Failed to communicate with device"); } } } From 69bcfdfbfed4864a6f8cd6f64a1f39c2a4ee498e Mon Sep 17 00:00:00 2001 From: James Waples Date: Sat, 27 Oct 2018 21:47:50 +0100 Subject: [PATCH 3/4] Undo some auto formatting --- Cargo.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 31b4417..da49944 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,14 @@ [package] +name = "ili9341" +version = "0.1.7" +description = "A platform agnostic driver to interface with the ILI9341 (ald ILI9340C) TFT LCD display" authors = ["Yuri Iozzelli "] categories = ["embedded", "hardware-support", "no-std"] -description = "A platform agnostic driver to interface with the ILI9341 (ald ILI9340C) TFT LCD display" keywords = ["embedded-hal-driver", "display", "LCD"] license = "MIT OR Apache-2.0" -name = "ili9341" repository = "https://github.com/yuri91/ili9341-rs" -version = "0.1.7" + + [dependencies] embedded-hal = "0.2.1" From 159b77ba90b3fcacd479b564ef0ab459b87cd636 Mon Sep 17 00:00:00 2001 From: James Waples Date: Thu, 2 May 2019 12:51:45 +0100 Subject: [PATCH 4/4] Bump e_g to 0.4.7 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index da49944..6a2e42f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ embedded-hal = "0.2.1" [dependencies.embedded-graphics] optional = true -version = "0.4.4" +version = "0.4.7" [features] default = ["graphics"]