Browse Source

Remove Hackinputpin completly

embedded-hal-1.0
Chris 7 years ago
parent
commit
86d1a9fa25
  1. 2
      examples/embedded_linux_epd1in54/Cargo.toml
  2. 5
      examples/embedded_linux_epd1in54/src/main.rs
  3. 13
      examples/embedded_linux_epd2in9/src/main.rs
  4. 4
      examples/embedded_linux_epd4in2/Cargo.toml
  5. 5
      examples/embedded_linux_epd4in2/src/main.rs

2
examples/embedded_linux_epd1in54/Cargo.toml

@ -5,8 +5,6 @@ authors = ["Christoph Groß <christoph-gross@mailbox.org>"]
[dependencies]
#eink_waveshare_rs = { git = "https://github.com/Caemor/eink-waveshare-rs"}
#eink_waveshare_rs = { path = "../../"}
eink_waveshare_rs = { path = "../../", default-features = false, features = ["epd1in54", "graphics"]}
linux-embedded-hal = "0.2.1"

5
examples/embedded_linux_epd1in54/src/main.rs

@ -33,9 +33,7 @@ use embedded_hal::prelude::*;
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
fn main() {
run().unwrap();
}
@ -63,7 +61,6 @@ fn run() -> Result<(), std::io::Error> {
while !busy.is_exported() {}
busy.set_direction(Direction::In).expect("busy Direction");
//busy.set_value(1).expect("busy Value set to 1");
let busy_in = HackInputPin::new(&busy);
// Configure Data/Command OutputPin
let dc = Pin::new(6); //pin 31 //bcm6
@ -85,7 +82,7 @@ fn run() -> Result<(), std::io::Error> {
// Setup of the needed pins is finished here
// Now the "real" usage of the eink-waveshare-rs crate begins
let mut epd = EPD1in54::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?;
let mut epd = EPD1in54::new(&mut spi, cs_pin, busy, dc, rst, &mut delay)?;
// Clear the full screen
epd.clear_frame(&mut spi).expect("clear frame 1");

13
examples/embedded_linux_epd2in9/src/main.rs

@ -4,7 +4,6 @@ extern crate linux_embedded_hal as lin_hal;
// the eink library
extern crate eink_waveshare_rs;
use eink_waveshare_rs::{
epd2in9::{
EPD2in9,
@ -33,17 +32,8 @@ use embedded_hal::prelude::*;
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
// DigitalIn Hack as long as it's not in the linux_embedded_hal
// from https://github.com/rudihorn/max31865/blob/extra_examples/examples/rpi.rs
// (slightly changed now as OutputPin doesn't provide is_high and is_low anymore)
use embedded_hal::digital::{InputPin};
//TODO: Test this implemenation with a new display
fn main() {
run().unwrap();
}
@ -71,7 +61,6 @@ fn run() -> Result<(), std::io::Error> {
while !busy.is_exported() {}
busy.set_direction(Direction::In).expect("busy Direction");
//busy.set_value(1).expect("busy Value set to 1");
let busy_in = HackInputPin::new(&busy);
// Configure Data/Command OutputPin
let dc = Pin::new(6); //pin 31 //bcm6
@ -93,7 +82,7 @@ fn run() -> Result<(), std::io::Error> {
// Setup of the needed pins is finished here
// Now the "real" usage of the eink-waveshare-rs crate begins
let mut epd = EPD2in9::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?;
let mut epd = EPD2in9::new(&mut spi, cs_pin, busy, dc, rst, &mut delay)?;
// Clear the full screen
epd.clear_frame(&mut spi).expect("clear frame 1");

4
examples/embedded_linux_epd4in2/Cargo.toml

@ -12,9 +12,5 @@ eink_waveshare_rs = { path = "../../", default-features = false, features = ["ep
linux-embedded-hal = "0.2.1"
embedded-graphics = "0.4.3"
# embedded-graphics = {git = "https://github.com/caemor/embedded-graphics", branch = "master"}
# embedded-graphics = {git = "https://github.com/jamwaffles/embedded-graphics", branch = "master"}
embedded-hal = { version = "0.2.1", features = ["unproven"] }

5
examples/embedded_linux_epd4in2/src/main.rs

@ -4,7 +4,6 @@ extern crate linux_embedded_hal as lin_hal;
// the eink library
extern crate eink_waveshare_rs;
use eink_waveshare_rs::{
epd4in2::{
EPD4in2,
@ -34,7 +33,6 @@ fn main() {
run().map_err(|e| println!("{}", e.to_string())).unwrap();
}
fn run() -> Result<(), std::io::Error> {
// Configure SPI
@ -59,7 +57,6 @@ fn run() -> Result<(), std::io::Error> {
while !busy.is_exported() {}
busy.set_direction(Direction::In).expect("busy Direction");
//busy.set_value(1).expect("busy Value set to 1");
let busy_in = HackInputPin::new(&busy);
let dc = Pin::new(6); //pin 31 //bcm6
dc.export().expect("dc export");
@ -81,7 +78,7 @@ fn run() -> Result<(), std::io::Error> {
//TODO: wait for Digital::InputPin
//fixed currently with the HackInputPin, see further above
let mut epd4in2 = EPD4in2::new(&mut spi, cs, busy_in, dc, rst, &mut delay).expect("eink initalize error");
let mut epd4in2 = EPD4in2::new(&mut spi, cs, busy, dc, rst, &mut delay).expect("eink initalize error");
println!("Test all the rotations");
let mut buffer = Buffer4in2::default();

Loading…
Cancel
Save