Skip to content

Commit

Permalink
Merge pull request #181 from newAM/update-embedded-hal
Browse files Browse the repository at this point in the history
embedded-hal: 1.0.0-rc.1 -> 1.0.0-rc.3
  • Loading branch information
caemor authored Jan 10, 2024
2 parents cff9130 + 378918f commit d77a57a
Show file tree
Hide file tree
Showing 27 changed files with 98 additions and 100 deletions.
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@ edition = "2021"

[dependencies]
embedded-graphics-core = { version = "0.4", optional = true }
embedded-hal = { version = "1.0.0-rc.1" }
embedded-hal = "1.0.0-rc.3"
bit_field = "0.10.1"

[dev-dependencies]
embedded-graphics = "0.8"

embedded-hal-mock = { git = "https://github.com/newAM/embedded-hal-mock", branch = "eh1-rc.1", default-features = false, features = [
embedded-hal-mock = { version = "=0.10.0-rc.4", default-features = false, features = [
"eh1",
] }
# embedded-hal-mock = "0.9"

[target.'cfg(unix)'.dev-dependencies]
# linux-embedded-hal = "0.3"
linux-embedded-hal = { git = "https://github.com/rust-embedded/linux-embedded-hal" }
linux-embedded-hal = { git = "https://github.com/rust-embedded/linux-embedded-hal", rev = "a1fb24103e575615a29c6748cdeff1f0e7a3dae3" }

[[example]]
name = "epd1in54_no_graphics"
Expand Down
6 changes: 3 additions & 3 deletions examples/epd1in54_no_graphics.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![deny(warnings)]

use embedded_hal::delay::DelayUs;
use embedded_hal::delay::DelayNs;
use epd_waveshare::{epd1in54::Epd1in54, prelude::*};
use linux_embedded_hal::{
spidev::{self, SpidevOptions},
sysfs_gpio::Direction,
Delay, SPIError, Spidev, SysfsPin,
Delay, SPIError, SpidevDevice, SysfsPin,
};

// activate spi, gpio in raspi-config
Expand All @@ -15,7 +15,7 @@ use linux_embedded_hal::{
fn main() -> Result<(), SPIError> {
// Configure SPI
// SPI settings are from eink-waveshare-rs documenation
let mut spi = Spidev::open("/dev/spidev0.0")?;
let mut spi = SpidevDevice::open("/dev/spidev0.0")?;
let options = SpidevOptions::new()
.bits_per_word(8)
.max_speed_hz(4_000_000)
Expand Down
6 changes: 3 additions & 3 deletions examples/epd2in13_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use embedded_graphics::{
primitives::{Circle, Line, PrimitiveStyle},
text::{Baseline, Text, TextStyleBuilder},
};
use embedded_hal::delay::DelayUs;
use embedded_hal::delay::DelayNs;
use epd_waveshare::{
color::*,
epd2in13_v2::{Display2in13, Epd2in13},
Expand All @@ -16,7 +16,7 @@ use epd_waveshare::{
use linux_embedded_hal::{
spidev::{self, SpidevOptions},
sysfs_gpio::Direction,
Delay, SPIError, Spidev, SysfsPin,
Delay, SPIError, SpidevDevice, SysfsPin,
};

// The pins in this example are for the Universal e-Paper Raw Panel Driver HAT
Expand All @@ -27,7 +27,7 @@ use linux_embedded_hal::{
fn main() -> Result<(), SPIError> {
// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory");
let options = SpidevOptions::new()
.bits_per_word(8)
.max_speed_hz(4_000_000)
Expand Down
6 changes: 3 additions & 3 deletions examples/epd2in13bc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use embedded_graphics::{
primitives::{Circle, Line, PrimitiveStyle},
text::{Baseline, Text, TextStyleBuilder},
};
use embedded_hal::delay::DelayUs;
use embedded_hal::delay::DelayNs;
use epd_waveshare::{
color::*,
epd2in13bc::{Display2in13bc, Epd2in13bc},
Expand All @@ -16,7 +16,7 @@ use epd_waveshare::{
use linux_embedded_hal::{
spidev::{self, SpidevOptions},
sysfs_gpio::Direction,
Delay, SPIError, Spidev, SysfsPin,
Delay, SPIError, SpidevDevice, SysfsPin,
};

// activate spi, gpio in raspi-config
Expand Down Expand Up @@ -61,7 +61,7 @@ fn main() -> Result<(), SPIError> {

// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory");
let options = SpidevOptions::new()
.bits_per_word(8)
.max_speed_hz(10_000_000)
Expand Down
6 changes: 3 additions & 3 deletions examples/epd4in2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use embedded_graphics::{
primitives::{Circle, Line, PrimitiveStyleBuilder},
text::{Baseline, Text, TextStyleBuilder},
};
use embedded_hal::delay::DelayUs;
use embedded_hal::delay::DelayNs;
use epd_waveshare::{
color::*,
epd4in2::{Display4in2, Epd4in2},
Expand All @@ -16,7 +16,7 @@ use epd_waveshare::{
use linux_embedded_hal::{
spidev::{self, SpidevOptions},
sysfs_gpio::Direction,
Delay, SPIError, Spidev, SysfsPin,
Delay, SPIError, SpidevDevice, SysfsPin,
};

// activate spi, gpio in raspi-config
Expand All @@ -26,7 +26,7 @@ use linux_embedded_hal::{
fn main() -> Result<(), SPIError> {
// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory");
let options = SpidevOptions::new()
.bits_per_word(8)
.max_speed_hz(4_000_000)
Expand Down
6 changes: 3 additions & 3 deletions examples/epd4in2_variable_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use embedded_graphics::{
primitives::{Circle, Line, PrimitiveStyleBuilder},
text::{Baseline, Text, TextStyleBuilder},
};
use embedded_hal::delay::DelayUs;
use embedded_hal::delay::DelayNs;
use epd_waveshare::{
color::*,
epd4in2::{self, Epd4in2},
Expand All @@ -17,7 +17,7 @@ use epd_waveshare::{
use linux_embedded_hal::{
spidev::{self, SpidevOptions},
sysfs_gpio::Direction,
Delay, SPIError, Spidev, SysfsPin,
Delay, SPIError, SpidevDevice, SysfsPin,
};

// activate spi, gpio in raspi-config
Expand All @@ -27,7 +27,7 @@ use linux_embedded_hal::{
fn main() -> Result<(), SPIError> {
// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
let mut spi = SpidevDevice::open("/dev/spidev0.0").expect("spidev directory");
let options = SpidevOptions::new()
.bits_per_word(8)
.max_speed_hz(4_000_000)
Expand Down
6 changes: 3 additions & 3 deletions src/epd1in54/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
self.interface.reset(delay, 10_000, 10_000);
Expand Down Expand Up @@ -149,7 +149,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
type DisplayColor = Color;
fn width(&self) -> u32 {
Expand Down Expand Up @@ -300,7 +300,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
pub(crate) fn use_full_frame(
&mut self,
Expand Down
6 changes: 3 additions & 3 deletions src/epd1in54_v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
self.interface.reset(delay, 10_000, 10_000);
Expand Down Expand Up @@ -94,7 +94,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
type DisplayColor = Color;
fn width(&self) -> u32 {
Expand Down Expand Up @@ -267,7 +267,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
pub(crate) fn use_full_frame(
&mut self,
Expand Down
8 changes: 4 additions & 4 deletions src/epd1in54b/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
self.interface.reset(delay, 10_000, 10_000);
Expand Down Expand Up @@ -96,7 +96,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn update_color_frame(
&mut self,
Expand Down Expand Up @@ -146,7 +146,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
type DisplayColor = Color;
fn new(
Expand Down Expand Up @@ -324,7 +324,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> {
self.interface.cmd(spi, command)
Expand Down
8 changes: 4 additions & 4 deletions src/epd1in54c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
// Based on Reference Program Code from:
Expand Down Expand Up @@ -83,7 +83,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn update_color_frame(
&mut self,
Expand Down Expand Up @@ -128,7 +128,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
type DisplayColor = Color;
fn new(
Expand Down Expand Up @@ -265,7 +265,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> {
self.interface.cmd(spi, command)
Expand Down
8 changes: 4 additions & 4 deletions src/epd2in13_v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//!
use embedded_hal::{
delay::DelayUs,
delay::DelayNs,
digital::{InputPin, OutputPin},
spi::SpiDevice,
};
Expand Down Expand Up @@ -87,7 +87,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
// HW reset
Expand Down Expand Up @@ -180,7 +180,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
type DisplayColor = Color;
fn new(
Expand Down Expand Up @@ -392,7 +392,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
/// When using partial refresh, the controller uses the provided buffer for
/// comparison with new buffer.
Expand Down
8 changes: 4 additions & 4 deletions src/epd2in13bc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
// Values taken from datasheet and sample code
Expand Down Expand Up @@ -147,7 +147,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn update_color_frame(
&mut self,
Expand Down Expand Up @@ -198,7 +198,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
type DisplayColor = TriColor;
fn new(
Expand Down Expand Up @@ -347,7 +347,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> {
self.interface.cmd(spi, command)
Expand Down
8 changes: 4 additions & 4 deletions src/epd2in7b/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn init(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> {
// reset the device
Expand Down Expand Up @@ -119,7 +119,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
type DisplayColor = Color;
fn new(
Expand Down Expand Up @@ -280,7 +280,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn update_color_frame(
&mut self,
Expand Down Expand Up @@ -335,7 +335,7 @@ where
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
DELAY: DelayUs,
DELAY: DelayNs,
{
fn command(&mut self, spi: &mut SPI, command: Command) -> Result<(), SPI::Error> {
self.interface.cmd(spi, command)
Expand Down
Loading

0 comments on commit d77a57a

Please sign in to comment.