diff --git a/Cargo.toml b/Cargo.toml index ca7141c..4885224 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,8 @@ edition = "2018" rust-version = "1.59" [dependencies] -embedded-hal = { version = "0.2.6", features = ["unproven"] } +embedded-hal-0 = { package = "embedded-hal", version = "0.2.7", features = ["unproven"] } +embedded-hal-1 = { package = "embedded-hal", version = "1.0.0" } nb = "1.0.0" riscv = { version = "0.10.1", features = ["critical-section-single-hart"] } e310x = { version = "0.11.0", features = ["rt", "critical-section"] } diff --git a/src/delay.rs b/src/delay.rs index 4778bf1..1a33aa8 100644 --- a/src/delay.rs +++ b/src/delay.rs @@ -2,7 +2,7 @@ use crate::clock::Clocks; use crate::core::clint::{MTIME, MTIMECMP}; -use embedded_hal::blocking::delay::{DelayMs, DelayUs}; +use embedded_hal_0::blocking::delay::{DelayMs, DelayUs}; use riscv::register::{mie, mip}; /// Machine timer (mtime) as a busyloop delay provider diff --git a/src/gpio.rs b/src/gpio.rs index 1061884..2d73383 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -146,7 +146,7 @@ macro_rules! gpio { use core::marker::PhantomData; use core::convert::Infallible; - use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin, + use embedded_hal_0::digital::v2::{InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin}; use e310x::$GPIOX; use super::{Unknown, IOF0, IOF1, Drive, Floating, GpioExt, Input, Invert, diff --git a/src/i2c.rs b/src/i2c.rs index d969add..e53cb6c 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -16,7 +16,7 @@ use crate::time::Bps; use core::mem; use core::ops::Deref; use e310x::{i2c0, I2C0}; -use embedded_hal::blocking::i2c::{Read, Write, WriteRead}; +use embedded_hal_0::blocking::i2c::{Read, Write, WriteRead}; /// SDA pin - DO NOT IMPLEMENT THIS TRAIT pub unsafe trait SdaPin {} diff --git a/src/prelude.rs b/src/prelude.rs index c6ccd12..c7791f5 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -7,9 +7,9 @@ pub use crate::rtc::RtcExt as _e310x_hal_rtc_RtcExt; pub use crate::stdout::Write as _e310x_hal_stdout_Write; pub use crate::time::U32Ext as _e310x_hal_time_U32Ext; pub use crate::wdog::WdogExt as _e310x_hal_wdog_WdogExt; -pub use embedded_hal::digital::v2::{ +pub use embedded_hal_0::digital::v2::{ InputPin as _embedded_hal_digital_v2_InputPin, OutputPin as _embedded_hal_digital_v2_OutputPin, StatefulOutputPin as _embedded_hal_digital_v2_StatefulOutputPin, ToggleableOutputPin as _embedded_hal_digital_v2_ToggleableOutputPin, }; -pub use embedded_hal::prelude::*; +pub use embedded_hal_0::prelude::*; diff --git a/src/pwm.rs b/src/pwm.rs index 7db8bf5..8f7a15a 100644 --- a/src/pwm.rs +++ b/src/pwm.rs @@ -175,7 +175,7 @@ impl Pwm { } } -impl embedded_hal::Pwm for Pwm { +impl embedded_hal_0::Pwm for Pwm { type Channel = Channel; type Time = PWM::CmpWidth; diff --git a/src/serial.rs b/src/serial.rs index 0184679..431ec49 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -16,7 +16,7 @@ use core::convert::Infallible; use core::ops::Deref; -use embedded_hal::serial; +use embedded_hal_0::serial; use nb; use crate::clock::Clocks; diff --git a/src/spi/bus.rs b/src/spi/bus.rs index 94ea72b..7e5cec6 100644 --- a/src/spi/bus.rs +++ b/src/spi/bus.rs @@ -1,7 +1,7 @@ use core::convert::Infallible; -use embedded_hal::blocking::spi::Operation; -pub use embedded_hal::blocking::spi::{Transfer, Write, WriteIter}; -pub use embedded_hal::spi::{FullDuplex, Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; +use embedded_hal_0::blocking::spi::Operation; +pub use embedded_hal_0::blocking::spi::{Transfer, Write, WriteIter}; +pub use embedded_hal_0::spi::{FullDuplex, Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; use nb; diff --git a/src/spi/config.rs b/src/spi/config.rs index 6b30e72..3c6aacc 100644 --- a/src/spi/config.rs +++ b/src/spi/config.rs @@ -1,5 +1,5 @@ use e310x::qspi0::csmode::MODE_A; -use embedded_hal::spi::Mode; +use embedded_hal_0::spi::Mode; use crate::{clock::Clocks, time::Hertz}; diff --git a/src/spi/exclusive_device.rs b/src/spi/exclusive_device.rs index d9e808e..1776bbf 100644 --- a/src/spi/exclusive_device.rs +++ b/src/spi/exclusive_device.rs @@ -1,6 +1,6 @@ use core::convert::Infallible; -use embedded_hal::{ +use embedded_hal_0::{ blocking::spi::{Operation, Transactional, Transfer, Write, WriteIter}, spi::FullDuplex, }; diff --git a/src/spi/shared_bus.rs b/src/spi/shared_bus.rs index 67b9e06..f920f23 100644 --- a/src/spi/shared_bus.rs +++ b/src/spi/shared_bus.rs @@ -1,6 +1,6 @@ use core::cell::RefCell; use core::ops::Deref; -pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; +// pub use embedded_hal_0::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; use riscv::interrupt; use super::{PinCS, PinsNoCS, SpiBus, SpiConfig, SpiSharedDevice, SpiX}; diff --git a/src/spi/shared_device.rs b/src/spi/shared_device.rs index cbedea9..15c6dd6 100644 --- a/src/spi/shared_device.rs +++ b/src/spi/shared_device.rs @@ -1,6 +1,6 @@ use core::convert::Infallible; -use embedded_hal::{ +use embedded_hal_0::{ blocking::spi::{Operation, Transactional, Transfer, Write, WriteIter}, spi::FullDuplex, }; diff --git a/src/stdout.rs b/src/stdout.rs index 004bcc8..5123767 100644 --- a/src/stdout.rs +++ b/src/stdout.rs @@ -10,7 +10,7 @@ where impl<'p, T> Write for Stdout<'p, T> where - T: embedded_hal::serial::Write, + T: embedded_hal_0::serial::Write, { fn write_str(&mut self, s: &str) -> ::core::fmt::Result { for byte in s.as_bytes() {