Update to e.h 1.0a6 & linux e.h
parent
e3779d458e
commit
9c1bfa3663
|
|
@ -22,7 +22,7 @@ bit_field = "0.10.1"
|
|||
|
||||
[dev-dependencies]
|
||||
embedded-graphics = "0.7.1"
|
||||
linux-embedded-hal = "0.4.0-alpha.1"
|
||||
linux-embedded-hal = {path = "../linux-embedded-hal"}# "0.4.0-alpha.1"
|
||||
embedded-hal-mock = "0.8"
|
||||
|
||||
[features]
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
#![deny(warnings)]
|
||||
|
||||
use embedded_hal::delay::blocking::DelayUs;
|
||||
use epd_waveshare::{epd1in54::Epd1in54, prelude::*};
|
||||
use linux_embedded_hal::{
|
||||
spidev::{self, SpidevOptions},
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Pin, Spidev,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// 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() -> Result<(), std::io::Error> {
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
// Configure SPI
|
||||
// SPI settings are from eink-waveshare-rs documenation
|
||||
let mut spi = Spidev::open("/dev/spidev0.0")?;
|
||||
|
|
@ -89,7 +90,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
|
||||
// Display updated frame
|
||||
epd.display_frame(&mut spi, &mut delay)?;
|
||||
delay.delay_ms(5000u16);
|
||||
delay.delay_ms(5000).expect("delay");
|
||||
|
||||
// Set the EPD to sleep
|
||||
epd.sleep(&mut spi, &mut delay)?;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use embedded_graphics::{
|
|||
primitives::{Circle, Line, PrimitiveStyle},
|
||||
text::{Baseline, Text, TextStyleBuilder},
|
||||
};
|
||||
use embedded_hal::prelude::*;
|
||||
use embedded_hal::delay::blocking::DelayUs;
|
||||
use epd_waveshare::{
|
||||
color::*,
|
||||
epd2in13_v2::{Display2in13, Epd2in13},
|
||||
|
|
@ -16,14 +16,14 @@ use epd_waveshare::{
|
|||
use linux_embedded_hal::{
|
||||
spidev::{self, SpidevOptions},
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Pin, Spidev,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// 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() -> Result<(), std::io::Error> {
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
// Configure SPI
|
||||
// Settings are taken from
|
||||
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
|
||||
|
|
@ -83,7 +83,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
epd2in13
|
||||
.display_frame(&mut spi, &mut delay)
|
||||
.expect("display frame new graphics");
|
||||
delay.delay_ms(5000u16);
|
||||
delay.delay_ms(5000).expect("delay");
|
||||
|
||||
//println!("Now test new graphics with default rotation and some special stuff:");
|
||||
display.clear_buffer(Color::White);
|
||||
|
|
@ -135,7 +135,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
epd2in13
|
||||
.update_and_display_frame(&mut spi, display.buffer(), &mut delay)
|
||||
.expect("display frame new graphics");
|
||||
delay.delay_ms(1_000u16);
|
||||
delay.delay_ms(1_000).expect("delay");
|
||||
}
|
||||
|
||||
// Show a spinning bar without any delay between frames. Shows how «fast»
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use embedded_graphics::{
|
|||
primitives::{Circle, Line, PrimitiveStyle},
|
||||
text::{Baseline, Text, TextStyleBuilder},
|
||||
};
|
||||
use embedded_hal::prelude::*;
|
||||
use embedded_hal::delay::blocking::DelayUs;
|
||||
use epd_waveshare::{
|
||||
color::*,
|
||||
epd2in13bc::{Display2in13bc, Epd2in13bc},
|
||||
|
|
@ -16,7 +16,7 @@ use epd_waveshare::{
|
|||
use linux_embedded_hal::{
|
||||
spidev::{self, SpidevOptions},
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Pin, Spidev,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
|
|
@ -34,7 +34,7 @@ use linux_embedded_hal::{
|
|||
//
|
||||
// after finishing, put the display to sleep
|
||||
|
||||
fn main() -> Result<(), std::io::Error> {
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
let busy = Pin::new(24); // GPIO 24, board J-18
|
||||
busy.export().expect("busy export");
|
||||
while !busy.is_exported() {}
|
||||
|
|
@ -98,7 +98,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
.expect("display frame new graphics");
|
||||
|
||||
println!("First frame done. Waiting 5s");
|
||||
delay.delay_ms(5000u16);
|
||||
delay.delay_ms(5000).expect("delay");
|
||||
|
||||
println!("Now test new graphics with default rotation and three colors:");
|
||||
display.clear_buffer(TriColor::White);
|
||||
|
|
@ -143,7 +143,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
.expect("display frame new graphics");
|
||||
|
||||
println!("Second frame done. Waiting 5s");
|
||||
delay.delay_ms(5000u16);
|
||||
delay.delay_ms(5000).expect("delay");
|
||||
|
||||
// clear both bw buffer and chromatic buffer
|
||||
display.clear_buffer(TriColor::White);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use embedded_graphics::{
|
|||
primitives::{Circle, Line, PrimitiveStyleBuilder},
|
||||
text::{Baseline, Text, TextStyleBuilder},
|
||||
};
|
||||
use embedded_hal::prelude::*;
|
||||
use embedded_hal::delay::blocking::DelayUs;
|
||||
use epd_waveshare::{
|
||||
color::*,
|
||||
epd4in2::{Display4in2, Epd4in2},
|
||||
|
|
@ -16,14 +16,14 @@ use epd_waveshare::{
|
|||
use linux_embedded_hal::{
|
||||
spidev::{self, SpidevOptions},
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Pin, Spidev,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// 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() -> Result<(), std::io::Error> {
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
// Configure SPI
|
||||
// Settings are taken from
|
||||
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
|
||||
|
|
@ -83,7 +83,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
epd4in2
|
||||
.display_frame(&mut spi, &mut delay)
|
||||
.expect("display frame new graphics");
|
||||
delay.delay_ms(5000u16);
|
||||
delay.delay_ms(5000).expect("delay");
|
||||
|
||||
println!("Now test new graphics with default rotation and some special stuff");
|
||||
display.clear_buffer(Color::White);
|
||||
|
|
@ -141,7 +141,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
.display_frame(&mut spi, &mut delay)
|
||||
.expect("display frame new graphics");
|
||||
|
||||
delay.delay_ms(1_000u16);
|
||||
delay.delay_ms(1_000).expect("delay");
|
||||
}
|
||||
|
||||
println!("Finished tests - going to sleep");
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use embedded_graphics::{
|
|||
primitives::{Circle, Line, PrimitiveStyleBuilder},
|
||||
text::{Baseline, Text, TextStyleBuilder},
|
||||
};
|
||||
use embedded_hal::prelude::*;
|
||||
use embedded_hal::delay::blocking::DelayUs;
|
||||
use epd_waveshare::{
|
||||
color::*,
|
||||
epd4in2::{self, Epd4in2},
|
||||
|
|
@ -17,14 +17,14 @@ use epd_waveshare::{
|
|||
use linux_embedded_hal::{
|
||||
spidev::{self, SpidevOptions},
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Pin, Spidev,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// 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() -> Result<(), std::io::Error> {
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
// Configure SPI
|
||||
// Settings are taken from
|
||||
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
|
||||
|
|
@ -89,7 +89,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
epd4in2
|
||||
.display_frame(&mut spi, &mut delay)
|
||||
.expect("display frame new graphics");
|
||||
delay.delay_ms(5000u16);
|
||||
delay.delay_ms(5000).expect("delay");
|
||||
|
||||
println!("Now test new graphics with default rotation and some special stuff:");
|
||||
display.set_rotation(DisplayRotation::Rotate0);
|
||||
|
|
@ -146,7 +146,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||
.display_frame(&mut spi, &mut delay)
|
||||
.expect("display frame new graphics");
|
||||
|
||||
delay.delay_ms(1_000u16);
|
||||
delay.delay_ms(1_000).expect("delay");
|
||||
}
|
||||
|
||||
println!("Finished tests - going to sleep");
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ const IS_BUSY_LOW: bool = false;
|
|||
use crate::eh_prelude::*;
|
||||
use crate::type_a::{
|
||||
command::Command,
|
||||
constants::{LUT_FULL_UPDATE, LUT_PARTIAL_UPDATE}
|
||||
constants::{LUT_FULL_UPDATE, LUT_PARTIAL_UPDATE},
|
||||
};
|
||||
|
||||
use crate::color::Color;
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
//! - [Controller Datasheet SS1780](http://www.e-paper-display.com/download_detail/downloadsId=682.html)
|
||||
//!
|
||||
|
||||
use crate::eh_prelude::*;
|
||||
use crate::buffer_len;
|
||||
use crate::color::Color;
|
||||
use crate::eh_prelude::*;
|
||||
use crate::interface::DisplayInterface;
|
||||
use crate::traits::{InternalWiAdditions, RefreshLut, WaveshareDisplay};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
//! - [Waveshare C driver](https://github.com/waveshare/e-Paper/blob/master/RaspberryPi%26JetsonNano/c/lib/e-Paper/EPD_5in65f.c)
|
||||
//! - [Waveshare Python driver](https://github.com/waveshare/e-Paper/blob/master/RaspberryPi%26JetsonNano/python/lib/waveshare_epd/epd5in65f.py)
|
||||
|
||||
use crate::eh_prelude::*;
|
||||
use crate::color::OctColor;
|
||||
use crate::eh_prelude::*;
|
||||
use crate::interface::DisplayInterface;
|
||||
use crate::traits::{InternalWiAdditions, RefreshLut, WaveshareDisplay};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
//! - [Waveshare C driver](https://github.com/waveshare/e-Paper/blob/702def06bcb75983c98b0f9d25d43c552c248eb0/RaspberryPi%26JetsonNano/c/lib/e-Paper/EPD_7in5.c)
|
||||
//! - [Waveshare Python driver](https://github.com/waveshare/e-Paper/blob/702def06bcb75983c98b0f9d25d43c552c248eb0/RaspberryPi%26JetsonNano/python/lib/waveshare_epd/epd7in5.py)
|
||||
|
||||
use crate::eh_prelude::*;
|
||||
use crate::color::Color;
|
||||
use crate::eh_prelude::*;
|
||||
use crate::interface::DisplayInterface;
|
||||
use crate::traits::{InternalWiAdditions, RefreshLut, WaveshareDisplay};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
//! - [Datasheet](https://www.waveshare.com/w/upload/2/27/7inch_HD_e-Paper_Specification.pdf)
|
||||
//! - [Waveshare Python driver](https://github.com/waveshare/e-Paper/blob/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd7in5_HD.py)
|
||||
//!
|
||||
use crate::eh_prelude::*;
|
||||
use crate::color::Color;
|
||||
use crate::eh_prelude::*;
|
||||
use crate::interface::DisplayInterface;
|
||||
use crate::traits::{InternalWiAdditions, RefreshLut, WaveshareDisplay};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
//! Revision V2 has been released on 2019.11, the resolution is upgraded to 800×480, from 640×384 of V1.
|
||||
//! The hardware and interface of V2 are compatible with V1, however, the related software should be updated.
|
||||
|
||||
use crate::eh_prelude::*;
|
||||
use crate::color::Color;
|
||||
use crate::eh_prelude::*;
|
||||
use crate::interface::DisplayInterface;
|
||||
use crate::traits::{InternalWiAdditions, RefreshLut, WaveshareDisplay};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::eh_prelude::*;
|
||||
use crate::traits::Command;
|
||||
use core::marker::PhantomData;
|
||||
use crate::eh_prelude::*;
|
||||
|
||||
/// The Connection Interface of all (?) Waveshare EPD-Devices
|
||||
///
|
||||
|
|
|
|||
|
|
@ -104,7 +104,11 @@ pub mod prelude {
|
|||
}
|
||||
|
||||
pub(crate) mod eh_prelude {
|
||||
pub(crate) use embedded_hal::{delay::blocking::DelayUs, spi::blocking::Write, digital::blocking::{InputPin, OutputPin}};
|
||||
pub(crate) use embedded_hal::{
|
||||
delay::blocking::DelayUs,
|
||||
digital::blocking::{InputPin, OutputPin},
|
||||
spi::blocking::Write,
|
||||
};
|
||||
}
|
||||
|
||||
/// Computes the needed buffer length. Takes care of rounding up in case width
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use core::marker::Sized;
|
||||
use crate::eh_prelude::*;
|
||||
use core::marker::Sized;
|
||||
|
||||
/// All commands need to have this trait which gives the address of the command
|
||||
/// which needs to be send via SPI with activated CommandsPin (Data/Command Pin in CommandMode)
|
||||
|
|
|
|||
Loading…
Reference in New Issue