diff --git a/rp2040-hal/Cargo.toml b/rp2040-hal/Cargo.toml index c39ac50..7794cb9 100644 --- a/rp2040-hal/Cargo.toml +++ b/rp2040-hal/Cargo.toml @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0" cortex-m = "0.7.2" cortex-m-rt = ">=0.6.15,<0.8" embedded-hal = { version = "0.2.5", features = ["unproven"] } -eh1_0_alpha = { package = "embedded-hal", version = "=1.0.0-alpha.8", optional = true } +eh1_0_alpha = { package = "embedded-hal", version = "=1.0.0-alpha.9", optional = true } fugit = "0.3.6" itertools = { version = "0.10.1", default-features = false } nb = "1.0" diff --git a/rp2040-hal/src/gpio/dynpin.rs b/rp2040-hal/src/gpio/dynpin.rs index 68ceea3..974d67a 100644 --- a/rp2040-hal/src/gpio/dynpin.rs +++ b/rp2040-hal/src/gpio/dynpin.rs @@ -556,7 +556,7 @@ impl eh1::ErrorType for DynPin { } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::OutputPin for DynPin { +impl eh1::OutputPin for DynPin { #[inline] fn set_high(&mut self) -> Result<(), Self::Error> { self._set_high() @@ -568,7 +568,7 @@ impl eh1::blocking::OutputPin for DynPin { } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::InputPin for DynPin { +impl eh1::InputPin for DynPin { #[inline] fn is_high(&self) -> Result { self._is_high() @@ -580,7 +580,7 @@ impl eh1::blocking::InputPin for DynPin { } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::ToggleableOutputPin for DynPin { +impl eh1::ToggleableOutputPin for DynPin { #[inline] fn toggle(&mut self) -> Result<(), Self::Error> { self._toggle() @@ -588,7 +588,7 @@ impl eh1::blocking::ToggleableOutputPin for DynPin { } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::StatefulOutputPin for DynPin { +impl eh1::StatefulOutputPin for DynPin { #[inline] fn is_set_high(&self) -> Result { self._is_set_high() diff --git a/rp2040-hal/src/gpio/pin.rs b/rp2040-hal/src/gpio/pin.rs index fac7c73..1b6e7c8 100644 --- a/rp2040-hal/src/gpio/pin.rs +++ b/rp2040-hal/src/gpio/pin.rs @@ -881,7 +881,7 @@ where } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::OutputPin for Pin> +impl eh1::OutputPin for Pin> where I: PinId, C: OutputConfig, @@ -899,7 +899,7 @@ where } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::InputPin for Pin +impl eh1::InputPin for Pin where I: PinId, { @@ -923,7 +923,7 @@ where } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::InputPin for Pin> +impl eh1::InputPin for Pin> where I: PinId, C: InputConfig, @@ -939,7 +939,7 @@ where } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::ToggleableOutputPin for Pin> +impl eh1::ToggleableOutputPin for Pin> where I: PinId, C: OutputConfig, @@ -952,7 +952,7 @@ where } #[cfg(feature = "eh1_0_alpha")] -impl eh1::blocking::StatefulOutputPin for Pin> +impl eh1::StatefulOutputPin for Pin> where I: PinId, C: OutputConfig, diff --git a/rp2040-hal/src/i2c/controller.rs b/rp2040-hal/src/i2c/controller.rs index 862f9f2..fdcfa3e 100644 --- a/rp2040-hal/src/i2c/controller.rs +++ b/rp2040-hal/src/i2c/controller.rs @@ -279,7 +279,7 @@ impl, PINS> eh1::ErrorType for I2C } #[cfg(feature = "eh1_0_alpha")] -impl, PINS> eh1::blocking::I2c for I2C { +impl, PINS> eh1::I2c for I2C { fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error> { Write::write(self, addr, bytes) } @@ -330,15 +330,15 @@ impl, PINS> eh1::blocking::I2c for I2C( &mut self, address: u8, - operations: &mut [eh1::blocking::Operation<'a>], + operations: &mut [eh1::Operation<'a>], ) -> Result<(), Self::Error> { let addr: u16 = address.into(); self.setup(addr); for i in 0..operations.len() { let last = i == operations.len() - 1; match &mut operations[i] { - eh1::blocking::Operation::Read(buf) => self.read_internal(buf, false, last)?, - eh1::blocking::Operation::Write(buf) => self.write_internal(buf, last)?, + eh1::Operation::Read(buf) => self.read_internal(buf, false, last)?, + eh1::Operation::Write(buf) => self.write_internal(buf, last)?, } } Ok(()) @@ -346,7 +346,7 @@ impl, PINS> eh1::blocking::I2c for I2C(&mut self, address: u8, operations: O) -> Result<(), Self::Error> where - O: IntoIterator>, + O: IntoIterator>, { let addr: u16 = address.into(); self.setup(addr); @@ -354,8 +354,8 @@ impl, PINS> eh1::blocking::I2c for I2C self.read_internal(buf, false, last)?, - eh1::blocking::Operation::Write(buf) => self.write_internal(buf, last)?, + eh1::Operation::Read(buf) => self.read_internal(buf, false, last)?, + eh1::Operation::Write(buf) => self.write_internal(buf, last)?, } } Ok(()) diff --git a/rp2040-hal/src/spi.rs b/rp2040-hal/src/spi.rs index 7ecbbab..ca158fd 100644 --- a/rp2040-hal/src/spi.rs +++ b/rp2040-hal/src/spi.rs @@ -253,6 +253,7 @@ macro_rules! impl_write { type Error = SpiInfallible; } +/* disabled for now - nb was migrated to separate crate #[cfg(feature = "eh1_0_alpha")] impl eh1::nb::FullDuplex<$type> for Spi { fn read(&mut self) -> Result<$type, nb::Error> { @@ -276,6 +277,7 @@ macro_rules! impl_write { Ok(()) } } +*/ )+ diff --git a/rp2040-hal/src/uart/peripheral.rs b/rp2040-hal/src/uart/peripheral.rs index 7bdd0d2..b0e5f3b 100644 --- a/rp2040-hal/src/uart/peripheral.rs +++ b/rp2040-hal/src/uart/peripheral.rs @@ -357,6 +357,7 @@ impl> eh1::ErrorType for UartPeripheral> eh1::nb::Read for UartPeripheral { fn read(&mut self) -> nb::Result { @@ -371,6 +372,8 @@ impl> eh1::nb::Read for UartPeripheral< } } } +*/ + impl> Write for UartPeripheral { type Error = Infallible; @@ -387,6 +390,7 @@ impl> Write for UartPeripheral> eh1::nb::Write for UartPeripheral { fn write(&mut self, word: u8) -> nb::Result<(), Self::Error> { @@ -404,6 +408,7 @@ impl> eh1::nb::Write for UartPeripheral }) } } +*/ impl> fmt::Write for UartPeripheral { fn write_str(&mut self, s: &str) -> fmt::Result { diff --git a/rp2040-hal/src/uart/reader.rs b/rp2040-hal/src/uart/reader.rs index 272d5b2..0528169 100644 --- a/rp2040-hal/src/uart/reader.rs +++ b/rp2040-hal/src/uart/reader.rs @@ -239,6 +239,7 @@ impl> eh1::ErrorType for Reader { type Error = ReadErrorType; } +/* disabled for now - nb was migrated to separate crate #[cfg(feature = "eh1_0_alpha")] impl> eh1::nb::Read for Reader { fn read(&mut self) -> nb::Result { @@ -253,3 +254,4 @@ impl> eh1::nb::Read for Reader { } } } +*/ diff --git a/rp2040-hal/src/uart/writer.rs b/rp2040-hal/src/uart/writer.rs index 34a50cf..89ffe49 100644 --- a/rp2040-hal/src/uart/writer.rs +++ b/rp2040-hal/src/uart/writer.rs @@ -187,6 +187,7 @@ impl> eh1::ErrorType for Writer { type Error = super::utils::SerialInfallible; } +/* disabled for now - nb was migrated to separate crate #[cfg(feature = "eh1_0_alpha")] impl> eh1::nb::Write for Writer { fn write(&mut self, word: u8) -> nb::Result<(), Self::Error> { @@ -204,6 +205,7 @@ impl> eh1::nb::Write for Writer { }) } } +*/ impl> fmt::Write for Writer { fn write_str(&mut self, s: &str) -> fmt::Result {