diff options
| author | Ulf Lilleengen <[email protected]> | 2022-09-29 11:02:43 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2022-09-29 11:27:46 +0200 |
| commit | 72c2e985bb481fbc2e138a8e98b9dbb27878f370 (patch) | |
| tree | f573324f2449b68b7b1fef579b755a67dbb406d7 | |
| parent | 77ece3f903735b50f265ddd43520c50e0f28c1a1 (diff) | |
Update embedded-hal versions and explicitly pin
29 files changed, 94 insertions, 99 deletions
diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index 462680720..fe8fac7c8 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml | |||
| @@ -18,8 +18,8 @@ nightly = ["embedded-hal-async", "embedded-storage-async"] | |||
| 18 | [dependencies] | 18 | [dependencies] |
| 19 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } | 19 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 20 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 20 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 21 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 21 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } |
| 22 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true } | 22 | embedded-hal-async = { version = "=0.1.0-alpha.2", optional = true } |
| 23 | embedded-storage = "0.3.0" | 23 | embedded-storage = "0.3.0" |
| 24 | embedded-storage-async = { version = "0.3.0", optional = true } | 24 | embedded-storage-async = { version = "0.3.0", optional = true } |
| 25 | nb = "1.0.0" | 25 | nb = "1.0.0" |
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs index c95b59ef0..a3814d6d0 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs | |||
| @@ -29,7 +29,7 @@ use core::future::Future; | |||
| 29 | 29 | ||
| 30 | use embassy_sync::blocking_mutex::raw::RawMutex; | 30 | use embassy_sync::blocking_mutex::raw::RawMutex; |
| 31 | use embassy_sync::mutex::Mutex; | 31 | use embassy_sync::mutex::Mutex; |
| 32 | use embedded_hal_1::digital::blocking::OutputPin; | 32 | use embedded_hal_1::digital::OutputPin; |
| 33 | use embedded_hal_1::spi::ErrorType; | 33 | use embedded_hal_1::spi::ErrorType; |
| 34 | use embedded_hal_async::spi; | 34 | use embedded_hal_async::spi; |
| 35 | 35 | ||
| @@ -57,7 +57,7 @@ where | |||
| 57 | type Error = SpiDeviceError<BUS::Error, CS::Error>; | 57 | type Error = SpiDeviceError<BUS::Error, CS::Error>; |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | impl<M, BUS, CS> spi::SpiDevice for SpiDevice<'_, M, BUS, CS> | 60 | unsafe impl<M, BUS, CS> spi::SpiDevice for SpiDevice<'_, M, BUS, CS> |
| 61 | where | 61 | where |
| 62 | M: RawMutex + 'static, | 62 | M: RawMutex + 'static, |
| 63 | BUS: spi::SpiBusFlush + 'static, | 63 | BUS: spi::SpiBusFlush + 'static, |
| @@ -122,7 +122,7 @@ where | |||
| 122 | type Error = SpiDeviceError<BUS::Error, CS::Error>; | 122 | type Error = SpiDeviceError<BUS::Error, CS::Error>; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | impl<M, BUS, CS> spi::SpiDevice for SpiDeviceWithConfig<'_, M, BUS, CS> | 125 | unsafe impl<M, BUS, CS> spi::SpiDevice for SpiDeviceWithConfig<'_, M, BUS, CS> |
| 126 | where | 126 | where |
| 127 | M: RawMutex + 'static, | 127 | M: RawMutex + 'static, |
| 128 | BUS: spi::SpiBusFlush + SetConfig + 'static, | 128 | BUS: spi::SpiBusFlush + SetConfig + 'static, |
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs index a611e2d27..892000b26 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs | |||
| @@ -20,8 +20,7 @@ use core::cell::RefCell; | |||
| 20 | 20 | ||
| 21 | use embassy_sync::blocking_mutex::raw::RawMutex; | 21 | use embassy_sync::blocking_mutex::raw::RawMutex; |
| 22 | use embassy_sync::blocking_mutex::Mutex; | 22 | use embassy_sync::blocking_mutex::Mutex; |
| 23 | use embedded_hal_1::i2c::blocking::{I2c, Operation}; | 23 | use embedded_hal_1::i2c::{ErrorType, I2c, Operation}; |
| 24 | use embedded_hal_1::i2c::ErrorType; | ||
| 25 | 24 | ||
| 26 | use crate::shared_bus::I2cDeviceError; | 25 | use crate::shared_bus::I2cDeviceError; |
| 27 | use crate::SetConfig; | 26 | use crate::SetConfig; |
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs index 23845d887..4a08dc36e 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs | |||
| @@ -22,9 +22,9 @@ use core::cell::RefCell; | |||
| 22 | 22 | ||
| 23 | use embassy_sync::blocking_mutex::raw::RawMutex; | 23 | use embassy_sync::blocking_mutex::raw::RawMutex; |
| 24 | use embassy_sync::blocking_mutex::Mutex; | 24 | use embassy_sync::blocking_mutex::Mutex; |
| 25 | use embedded_hal_1::digital::blocking::OutputPin; | 25 | use embedded_hal_1::digital::OutputPin; |
| 26 | use embedded_hal_1::spi; | 26 | use embedded_hal_1::spi; |
| 27 | use embedded_hal_1::spi::blocking::SpiBusFlush; | 27 | use embedded_hal_1::spi::SpiBusFlush; |
| 28 | 28 | ||
| 29 | use crate::shared_bus::SpiDeviceError; | 29 | use crate::shared_bus::SpiDeviceError; |
| 30 | use crate::SetConfig; | 30 | use crate::SetConfig; |
| @@ -50,7 +50,7 @@ where | |||
| 50 | type Error = SpiDeviceError<BUS::Error, CS::Error>; | 50 | type Error = SpiDeviceError<BUS::Error, CS::Error>; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | impl<BUS, M, CS> embedded_hal_1::spi::blocking::SpiDevice for SpiDevice<'_, M, BUS, CS> | 53 | impl<BUS, M, CS> embedded_hal_1::spi::SpiDevice for SpiDevice<'_, M, BUS, CS> |
| 54 | where | 54 | where |
| 55 | M: RawMutex, | 55 | M: RawMutex, |
| 56 | BUS: SpiBusFlush, | 56 | BUS: SpiBusFlush, |
| @@ -146,7 +146,7 @@ where | |||
| 146 | type Error = SpiDeviceError<BUS::Error, CS::Error>; | 146 | type Error = SpiDeviceError<BUS::Error, CS::Error>; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | impl<BUS, M, CS> embedded_hal_1::spi::blocking::SpiDevice for SpiDeviceWithConfig<'_, M, BUS, CS> | 149 | impl<BUS, M, CS> embedded_hal_1::spi::SpiDevice for SpiDeviceWithConfig<'_, M, BUS, CS> |
| 150 | where | 150 | where |
| 151 | M: RawMutex, | 151 | M: RawMutex, |
| 152 | BUS: SpiBusFlush + SetConfig, | 152 | BUS: SpiBusFlush + SetConfig, |
diff --git a/embassy-lora/Cargo.toml b/embassy-lora/Cargo.toml index 1757efa8b..dcb0d8245 100644 --- a/embassy-lora/Cargo.toml +++ b/embassy-lora/Cargo.toml | |||
| @@ -28,8 +28,8 @@ log = { version = "0.4.14", optional = true } | |||
| 28 | embassy-time = { version = "0.1.0", path = "../embassy-time" } | 28 | embassy-time = { version = "0.1.0", path = "../embassy-time" } |
| 29 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } | 29 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 30 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true } | 30 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true } |
| 31 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 31 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } |
| 32 | embedded-hal-async = { version = "0.1.0-alpha.1" } | 32 | embedded-hal-async = { version = "=0.1.0-alpha.2" } |
| 33 | embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common", default-features = false } | 33 | embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common", default-features = false } |
| 34 | futures = { version = "0.3.17", default-features = false, features = [ "async-await" ] } | 34 | futures = { version = "0.3.17", default-features = false, features = [ "async-await" ] } |
| 35 | embedded-hal = { version = "0.2", features = ["unproven"] } | 35 | embedded-hal = { version = "0.2", features = ["unproven"] } |
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index d80281fa3..58b820242 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml | |||
| @@ -73,8 +73,8 @@ embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | |||
| 73 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional=true } | 73 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional=true } |
| 74 | 74 | ||
| 75 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 75 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 76 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true} | 76 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9", optional = true} |
| 77 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true} | 77 | embedded-hal-async = { version = "=0.1.0-alpha.2", optional = true} |
| 78 | embedded-io = { version = "0.3.0", features = ["async"], optional = true } | 78 | embedded-io = { version = "0.3.0", features = ["async"], optional = true } |
| 79 | 79 | ||
| 80 | defmt = { version = "0.3", optional = true } | 80 | defmt = { version = "0.3", optional = true } |
diff --git a/embassy-nrf/src/gpio.rs b/embassy-nrf/src/gpio.rs index 924629908..bb64e41e9 100644 --- a/embassy-nrf/src/gpio.rs +++ b/embassy-nrf/src/gpio.rs | |||
| @@ -574,7 +574,7 @@ mod eh1 { | |||
| 574 | type Error = Infallible; | 574 | type Error = Infallible; |
| 575 | } | 575 | } |
| 576 | 576 | ||
| 577 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::InputPin for Input<'d, T> { | 577 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Input<'d, T> { |
| 578 | fn is_high(&self) -> Result<bool, Self::Error> { | 578 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 579 | Ok(self.is_high()) | 579 | Ok(self.is_high()) |
| 580 | } | 580 | } |
| @@ -588,7 +588,7 @@ mod eh1 { | |||
| 588 | type Error = Infallible; | 588 | type Error = Infallible; |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::OutputPin for Output<'d, T> { | 591 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Output<'d, T> { |
| 592 | fn set_high(&mut self) -> Result<(), Self::Error> { | 592 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 593 | Ok(self.set_high()) | 593 | Ok(self.set_high()) |
| 594 | } | 594 | } |
| @@ -598,7 +598,7 @@ mod eh1 { | |||
| 598 | } | 598 | } |
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::StatefulOutputPin for Output<'d, T> { | 601 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Output<'d, T> { |
| 602 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 602 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 603 | Ok(self.is_set_high()) | 603 | Ok(self.is_set_high()) |
| 604 | } | 604 | } |
| @@ -615,7 +615,7 @@ mod eh1 { | |||
| 615 | /// Implement [`InputPin`] for [`Flex`]; | 615 | /// Implement [`InputPin`] for [`Flex`]; |
| 616 | /// | 616 | /// |
| 617 | /// If the pin is not in input mode the result is unspecified. | 617 | /// If the pin is not in input mode the result is unspecified. |
| 618 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::InputPin for Flex<'d, T> { | 618 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Flex<'d, T> { |
| 619 | fn is_high(&self) -> Result<bool, Self::Error> { | 619 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 620 | Ok(self.is_high()) | 620 | Ok(self.is_high()) |
| 621 | } | 621 | } |
| @@ -625,7 +625,7 @@ mod eh1 { | |||
| 625 | } | 625 | } |
| 626 | } | 626 | } |
| 627 | 627 | ||
| 628 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::OutputPin for Flex<'d, T> { | 628 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Flex<'d, T> { |
| 629 | fn set_high(&mut self) -> Result<(), Self::Error> { | 629 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 630 | Ok(self.set_high()) | 630 | Ok(self.set_high()) |
| 631 | } | 631 | } |
| @@ -635,7 +635,7 @@ mod eh1 { | |||
| 635 | } | 635 | } |
| 636 | } | 636 | } |
| 637 | 637 | ||
| 638 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::StatefulOutputPin for Flex<'d, T> { | 638 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Flex<'d, T> { |
| 639 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 639 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 640 | Ok(self.is_set_high()) | 640 | Ok(self.is_set_high()) |
| 641 | } | 641 | } |
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index b418be9d5..25ad90496 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs | |||
| @@ -457,7 +457,7 @@ mod eh1 { | |||
| 457 | type Error = Infallible; | 457 | type Error = Infallible; |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | impl<'d, C: Channel, T: GpioPin> embedded_hal_1::digital::blocking::InputPin for InputChannel<'d, C, T> { | 460 | impl<'d, C: Channel, T: GpioPin> embedded_hal_1::digital::InputPin for InputChannel<'d, C, T> { |
| 461 | fn is_high(&self) -> Result<bool, Self::Error> { | 461 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 462 | Ok(self.pin.is_high()) | 462 | Ok(self.pin.is_high()) |
| 463 | } | 463 | } |
diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs index 51cd73a47..d821d2353 100644 --- a/embassy-nrf/src/spim.rs +++ b/embassy-nrf/src/spim.rs | |||
| @@ -446,25 +446,25 @@ mod eh1 { | |||
| 446 | type Error = Error; | 446 | type Error = Error; |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | impl<'d, T: Instance> embedded_hal_1::spi::blocking::SpiBusFlush for Spim<'d, T> { | 449 | impl<'d, T: Instance> embedded_hal_1::spi::SpiBusFlush for Spim<'d, T> { |
| 450 | fn flush(&mut self) -> Result<(), Self::Error> { | 450 | fn flush(&mut self) -> Result<(), Self::Error> { |
| 451 | Ok(()) | 451 | Ok(()) |
| 452 | } | 452 | } |
| 453 | } | 453 | } |
| 454 | 454 | ||
| 455 | impl<'d, T: Instance> embedded_hal_1::spi::blocking::SpiBusRead<u8> for Spim<'d, T> { | 455 | impl<'d, T: Instance> embedded_hal_1::spi::SpiBusRead<u8> for Spim<'d, T> { |
| 456 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 456 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 457 | self.blocking_transfer(words, &[]) | 457 | self.blocking_transfer(words, &[]) |
| 458 | } | 458 | } |
| 459 | } | 459 | } |
| 460 | 460 | ||
| 461 | impl<'d, T: Instance> embedded_hal_1::spi::blocking::SpiBusWrite<u8> for Spim<'d, T> { | 461 | impl<'d, T: Instance> embedded_hal_1::spi::SpiBusWrite<u8> for Spim<'d, T> { |
| 462 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { | 462 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { |
| 463 | self.blocking_write(words) | 463 | self.blocking_write(words) |
| 464 | } | 464 | } |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | impl<'d, T: Instance> embedded_hal_1::spi::blocking::SpiBus<u8> for Spim<'d, T> { | 467 | impl<'d, T: Instance> embedded_hal_1::spi::SpiBus<u8> for Spim<'d, T> { |
| 468 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { | 468 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { |
| 469 | self.blocking_transfer(read, write) | 469 | self.blocking_transfer(read, write) |
| 470 | } | 470 | } |
diff --git a/embassy-nrf/src/twim.rs b/embassy-nrf/src/twim.rs index 7c6ca1d30..8d6171fac 100644 --- a/embassy-nrf/src/twim.rs +++ b/embassy-nrf/src/twim.rs | |||
| @@ -793,7 +793,7 @@ mod eh1 { | |||
| 793 | type Error = Error; | 793 | type Error = Error; |
| 794 | } | 794 | } |
| 795 | 795 | ||
| 796 | impl<'d, T: Instance> embedded_hal_1::i2c::blocking::I2c for Twim<'d, T> { | 796 | impl<'d, T: Instance> embedded_hal_1::i2c::I2c for Twim<'d, T> { |
| 797 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { | 797 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 798 | self.blocking_read(address, buffer) | 798 | self.blocking_read(address, buffer) |
| 799 | } | 799 | } |
| @@ -823,14 +823,14 @@ mod eh1 { | |||
| 823 | fn transaction<'a>( | 823 | fn transaction<'a>( |
| 824 | &mut self, | 824 | &mut self, |
| 825 | _address: u8, | 825 | _address: u8, |
| 826 | _operations: &mut [embedded_hal_1::i2c::blocking::Operation<'a>], | 826 | _operations: &mut [embedded_hal_1::i2c::Operation<'a>], |
| 827 | ) -> Result<(), Self::Error> { | 827 | ) -> Result<(), Self::Error> { |
| 828 | todo!(); | 828 | todo!(); |
| 829 | } | 829 | } |
| 830 | 830 | ||
| 831 | fn transaction_iter<'a, O>(&mut self, _address: u8, _operations: O) -> Result<(), Self::Error> | 831 | fn transaction_iter<'a, O>(&mut self, _address: u8, _operations: O) -> Result<(), Self::Error> |
| 832 | where | 832 | where |
| 833 | O: IntoIterator<Item = embedded_hal_1::i2c::blocking::Operation<'a>>, | 833 | O: IntoIterator<Item = embedded_hal_1::i2c::Operation<'a>>, |
| 834 | { | 834 | { |
| 835 | todo!(); | 835 | todo!(); |
| 836 | } | 836 | } |
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs index 5f9c4f17d..d99599112 100644 --- a/embassy-nrf/src/uarte.rs +++ b/embassy-nrf/src/uarte.rs | |||
| @@ -1040,7 +1040,7 @@ mod eh1 { | |||
| 1040 | type Error = Error; | 1040 | type Error = Error; |
| 1041 | } | 1041 | } |
| 1042 | 1042 | ||
| 1043 | impl<'d, T: Instance> embedded_hal_1::serial::blocking::Write for Uarte<'d, T> { | 1043 | impl<'d, T: Instance> embedded_hal_1::serial::Write for Uarte<'d, T> { |
| 1044 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 1044 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 1045 | self.blocking_write(buffer) | 1045 | self.blocking_write(buffer) |
| 1046 | } | 1046 | } |
| @@ -1054,7 +1054,7 @@ mod eh1 { | |||
| 1054 | type Error = Error; | 1054 | type Error = Error; |
| 1055 | } | 1055 | } |
| 1056 | 1056 | ||
| 1057 | impl<'d, T: Instance> embedded_hal_1::serial::blocking::Write for UarteTx<'d, T> { | 1057 | impl<'d, T: Instance> embedded_hal_1::serial::Write for UarteTx<'d, T> { |
| 1058 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 1058 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 1059 | self.blocking_write(buffer) | 1059 | self.blocking_write(buffer) |
| 1060 | } | 1060 | } |
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 337a84f4a..3aca5dbb4 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -31,7 +31,7 @@ nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", " | |||
| 31 | 31 | ||
| 32 | # Implement embedded-hal 1.0 alpha traits. | 32 | # Implement embedded-hal 1.0 alpha traits. |
| 33 | # Implement embedded-hal-async traits if `nightly` is set as well. | 33 | # Implement embedded-hal-async traits if `nightly` is set as well. |
| 34 | unstable-traits = ["embedded-hal-1"] | 34 | unstable-traits = ["embedded-hal-1", "embedded-hal-nb"] |
| 35 | 35 | ||
| 36 | [dependencies] | 36 | [dependencies] |
| 37 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } | 37 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| @@ -58,5 +58,6 @@ rp2040-pac2 = { git = "https://github.com/embassy-rs/rp2040-pac2", rev="017e3c90 | |||
| 58 | #rp2040-pac2 = { path = "../../rp2040-pac2", features = ["rt"] } | 58 | #rp2040-pac2 = { path = "../../rp2040-pac2", features = ["rt"] } |
| 59 | 59 | ||
| 60 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 60 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 61 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true} | 61 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9", optional = true} |
| 62 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true} | 62 | embedded-hal-async = { version = "=0.1.0-alpha.2", optional = true} |
| 63 | embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true} | ||
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index 9b9a08110..a28bae96b 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs | |||
| @@ -867,7 +867,7 @@ mod eh1 { | |||
| 867 | type Error = Infallible; | 867 | type Error = Infallible; |
| 868 | } | 868 | } |
| 869 | 869 | ||
| 870 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::InputPin for Input<'d, T> { | 870 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Input<'d, T> { |
| 871 | fn is_high(&self) -> Result<bool, Self::Error> { | 871 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 872 | Ok(self.is_high()) | 872 | Ok(self.is_high()) |
| 873 | } | 873 | } |
| @@ -881,7 +881,7 @@ mod eh1 { | |||
| 881 | type Error = Infallible; | 881 | type Error = Infallible; |
| 882 | } | 882 | } |
| 883 | 883 | ||
| 884 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::OutputPin for Output<'d, T> { | 884 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Output<'d, T> { |
| 885 | fn set_high(&mut self) -> Result<(), Self::Error> { | 885 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 886 | Ok(self.set_high()) | 886 | Ok(self.set_high()) |
| 887 | } | 887 | } |
| @@ -891,7 +891,7 @@ mod eh1 { | |||
| 891 | } | 891 | } |
| 892 | } | 892 | } |
| 893 | 893 | ||
| 894 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::StatefulOutputPin for Output<'d, T> { | 894 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Output<'d, T> { |
| 895 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 895 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 896 | Ok(self.is_set_high()) | 896 | Ok(self.is_set_high()) |
| 897 | } | 897 | } |
| @@ -901,7 +901,7 @@ mod eh1 { | |||
| 901 | } | 901 | } |
| 902 | } | 902 | } |
| 903 | 903 | ||
| 904 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::ToggleableOutputPin for Output<'d, T> { | 904 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Output<'d, T> { |
| 905 | fn toggle(&mut self) -> Result<(), Self::Error> { | 905 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 906 | Ok(self.toggle()) | 906 | Ok(self.toggle()) |
| 907 | } | 907 | } |
| @@ -911,7 +911,7 @@ mod eh1 { | |||
| 911 | type Error = Infallible; | 911 | type Error = Infallible; |
| 912 | } | 912 | } |
| 913 | 913 | ||
| 914 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::OutputPin for OutputOpenDrain<'d, T> { | 914 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for OutputOpenDrain<'d, T> { |
| 915 | fn set_high(&mut self) -> Result<(), Self::Error> { | 915 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 916 | Ok(self.set_high()) | 916 | Ok(self.set_high()) |
| 917 | } | 917 | } |
| @@ -921,7 +921,7 @@ mod eh1 { | |||
| 921 | } | 921 | } |
| 922 | } | 922 | } |
| 923 | 923 | ||
| 924 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::StatefulOutputPin for OutputOpenDrain<'d, T> { | 924 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for OutputOpenDrain<'d, T> { |
| 925 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 925 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 926 | Ok(self.is_set_high()) | 926 | Ok(self.is_set_high()) |
| 927 | } | 927 | } |
| @@ -931,7 +931,7 @@ mod eh1 { | |||
| 931 | } | 931 | } |
| 932 | } | 932 | } |
| 933 | 933 | ||
| 934 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::ToggleableOutputPin for OutputOpenDrain<'d, T> { | 934 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for OutputOpenDrain<'d, T> { |
| 935 | fn toggle(&mut self) -> Result<(), Self::Error> { | 935 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 936 | Ok(self.toggle()) | 936 | Ok(self.toggle()) |
| 937 | } | 937 | } |
| @@ -941,7 +941,7 @@ mod eh1 { | |||
| 941 | type Error = Infallible; | 941 | type Error = Infallible; |
| 942 | } | 942 | } |
| 943 | 943 | ||
| 944 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::InputPin for Flex<'d, T> { | 944 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Flex<'d, T> { |
| 945 | fn is_high(&self) -> Result<bool, Self::Error> { | 945 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 946 | Ok(self.is_high()) | 946 | Ok(self.is_high()) |
| 947 | } | 947 | } |
| @@ -951,7 +951,7 @@ mod eh1 { | |||
| 951 | } | 951 | } |
| 952 | } | 952 | } |
| 953 | 953 | ||
| 954 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::OutputPin for Flex<'d, T> { | 954 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Flex<'d, T> { |
| 955 | fn set_high(&mut self) -> Result<(), Self::Error> { | 955 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 956 | Ok(self.set_high()) | 956 | Ok(self.set_high()) |
| 957 | } | 957 | } |
| @@ -961,7 +961,7 @@ mod eh1 { | |||
| 961 | } | 961 | } |
| 962 | } | 962 | } |
| 963 | 963 | ||
| 964 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::StatefulOutputPin for Flex<'d, T> { | 964 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Flex<'d, T> { |
| 965 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 965 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 966 | Ok(self.is_set_high()) | 966 | Ok(self.is_set_high()) |
| 967 | } | 967 | } |
| @@ -971,7 +971,7 @@ mod eh1 { | |||
| 971 | } | 971 | } |
| 972 | } | 972 | } |
| 973 | 973 | ||
| 974 | impl<'d, T: Pin> embedded_hal_1::digital::blocking::ToggleableOutputPin for Flex<'d, T> { | 974 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Flex<'d, T> { |
| 975 | fn toggle(&mut self) -> Result<(), Self::Error> { | 975 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 976 | Ok(self.toggle()) | 976 | Ok(self.toggle()) |
| 977 | } | 977 | } |
diff --git a/embassy-rp/src/i2c.rs b/embassy-rp/src/i2c.rs index 9596d661d..52f910cef 100644 --- a/embassy-rp/src/i2c.rs +++ b/embassy-rp/src/i2c.rs | |||
| @@ -379,7 +379,7 @@ mod eh1 { | |||
| 379 | type Error = Error; | 379 | type Error = Error; |
| 380 | } | 380 | } |
| 381 | 381 | ||
| 382 | impl<'d, T: Instance, M: Mode> embedded_hal_1::i2c::blocking::I2c for I2c<'d, T, M> { | 382 | impl<'d, T: Instance, M: Mode> embedded_hal_1::i2c::I2c for I2c<'d, T, M> { |
| 383 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { | 383 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 384 | self.blocking_read(address, buffer) | 384 | self.blocking_read(address, buffer) |
| 385 | } | 385 | } |
| @@ -421,16 +421,14 @@ mod eh1 { | |||
| 421 | fn transaction<'a>( | 421 | fn transaction<'a>( |
| 422 | &mut self, | 422 | &mut self, |
| 423 | address: u8, | 423 | address: u8, |
| 424 | operations: &mut [embedded_hal_1::i2c::blocking::Operation<'a>], | 424 | operations: &mut [embedded_hal_1::i2c::Operation<'a>], |
| 425 | ) -> Result<(), Self::Error> { | 425 | ) -> Result<(), Self::Error> { |
| 426 | Self::setup(address.into())?; | 426 | Self::setup(address.into())?; |
| 427 | for i in 0..operations.len() { | 427 | for i in 0..operations.len() { |
| 428 | let last = i == operations.len() - 1; | 428 | let last = i == operations.len() - 1; |
| 429 | match &mut operations[i] { | 429 | match &mut operations[i] { |
| 430 | embedded_hal_1::i2c::blocking::Operation::Read(buf) => { | 430 | embedded_hal_1::i2c::Operation::Read(buf) => self.read_blocking_internal(buf, false, last)?, |
| 431 | self.read_blocking_internal(buf, false, last)? | 431 | embedded_hal_1::i2c::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, |
| 432 | } | ||
| 433 | embedded_hal_1::i2c::blocking::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, | ||
| 434 | } | 432 | } |
| 435 | } | 433 | } |
| 436 | Ok(()) | 434 | Ok(()) |
| @@ -438,17 +436,15 @@ mod eh1 { | |||
| 438 | 436 | ||
| 439 | fn transaction_iter<'a, O>(&mut self, address: u8, operations: O) -> Result<(), Self::Error> | 437 | fn transaction_iter<'a, O>(&mut self, address: u8, operations: O) -> Result<(), Self::Error> |
| 440 | where | 438 | where |
| 441 | O: IntoIterator<Item = embedded_hal_1::i2c::blocking::Operation<'a>>, | 439 | O: IntoIterator<Item = embedded_hal_1::i2c::Operation<'a>>, |
| 442 | { | 440 | { |
| 443 | Self::setup(address.into())?; | 441 | Self::setup(address.into())?; |
| 444 | let mut peekable = operations.into_iter().peekable(); | 442 | let mut peekable = operations.into_iter().peekable(); |
| 445 | while let Some(operation) = peekable.next() { | 443 | while let Some(operation) = peekable.next() { |
| 446 | let last = peekable.peek().is_none(); | 444 | let last = peekable.peek().is_none(); |
| 447 | match operation { | 445 | match operation { |
| 448 | embedded_hal_1::i2c::blocking::Operation::Read(buf) => { | 446 | embedded_hal_1::i2c::Operation::Read(buf) => self.read_blocking_internal(buf, false, last)?, |
| 449 | self.read_blocking_internal(buf, false, last)? | 447 | embedded_hal_1::i2c::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, |
| 450 | } | ||
| 451 | embedded_hal_1::i2c::blocking::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, | ||
| 452 | } | 448 | } |
| 453 | } | 449 | } |
| 454 | Ok(()) | 450 | Ok(()) |
diff --git a/embassy-rp/src/spi.rs b/embassy-rp/src/spi.rs index 03293e064..754e2dd30 100644 --- a/embassy-rp/src/spi.rs +++ b/embassy-rp/src/spi.rs | |||
| @@ -523,25 +523,25 @@ mod eh1 { | |||
| 523 | type Error = Error; | 523 | type Error = Error; |
| 524 | } | 524 | } |
| 525 | 525 | ||
| 526 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::blocking::SpiBusFlush for Spi<'d, T, M> { | 526 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::SpiBusFlush for Spi<'d, T, M> { |
| 527 | fn flush(&mut self) -> Result<(), Self::Error> { | 527 | fn flush(&mut self) -> Result<(), Self::Error> { |
| 528 | Ok(()) | 528 | Ok(()) |
| 529 | } | 529 | } |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::blocking::SpiBusRead<u8> for Spi<'d, T, M> { | 532 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::SpiBusRead<u8> for Spi<'d, T, M> { |
| 533 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 533 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 534 | self.blocking_transfer(words, &[]) | 534 | self.blocking_transfer(words, &[]) |
| 535 | } | 535 | } |
| 536 | } | 536 | } |
| 537 | 537 | ||
| 538 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::blocking::SpiBusWrite<u8> for Spi<'d, T, M> { | 538 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::SpiBusWrite<u8> for Spi<'d, T, M> { |
| 539 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { | 539 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { |
| 540 | self.blocking_write(words) | 540 | self.blocking_write(words) |
| 541 | } | 541 | } |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::blocking::SpiBus<u8> for Spi<'d, T, M> { | 544 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::SpiBus<u8> for Spi<'d, T, M> { |
| 545 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { | 545 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { |
| 546 | self.blocking_transfer(read, write) | 546 | self.blocking_transfer(read, write) |
| 547 | } | 547 | } |
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index 567c79db3..56c25e189 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs | |||
| @@ -486,7 +486,7 @@ mod eh1 { | |||
| 486 | type Error = Error; | 486 | type Error = Error; |
| 487 | } | 487 | } |
| 488 | 488 | ||
| 489 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::nb::Read for UartRx<'d, T, M> { | 489 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Read for UartRx<'d, T, M> { |
| 490 | fn read(&mut self) -> nb::Result<u8, Self::Error> { | 490 | fn read(&mut self) -> nb::Result<u8, Self::Error> { |
| 491 | let r = T::regs(); | 491 | let r = T::regs(); |
| 492 | unsafe { | 492 | unsafe { |
| @@ -509,7 +509,7 @@ mod eh1 { | |||
| 509 | } | 509 | } |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::blocking::Write for UartTx<'d, T, M> { | 512 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::Write for UartTx<'d, T, M> { |
| 513 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 513 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 514 | self.blocking_write(buffer) | 514 | self.blocking_write(buffer) |
| 515 | } | 515 | } |
| @@ -519,7 +519,7 @@ mod eh1 { | |||
| 519 | } | 519 | } |
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::nb::Write for UartTx<'d, T, M> { | 522 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for UartTx<'d, T, M> { |
| 523 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 523 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 524 | self.blocking_write(&[char]).map_err(nb::Error::Other) | 524 | self.blocking_write(&[char]).map_err(nb::Error::Other) |
| 525 | } | 525 | } |
| @@ -529,13 +529,13 @@ mod eh1 { | |||
| 529 | } | 529 | } |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::nb::Read for Uart<'d, T, M> { | 532 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Read for Uart<'d, T, M> { |
| 533 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 533 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 534 | embedded_hal_02::serial::Read::read(&mut self.rx) | 534 | embedded_hal_02::serial::Read::read(&mut self.rx) |
| 535 | } | 535 | } |
| 536 | } | 536 | } |
| 537 | 537 | ||
| 538 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::blocking::Write for Uart<'d, T, M> { | 538 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::Write for Uart<'d, T, M> { |
| 539 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 539 | fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 540 | self.blocking_write(buffer) | 540 | self.blocking_write(buffer) |
| 541 | } | 541 | } |
| @@ -545,7 +545,7 @@ mod eh1 { | |||
| 545 | } | 545 | } |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::nb::Write for Uart<'d, T, M> { | 548 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for Uart<'d, T, M> { |
| 549 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 549 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 550 | self.blocking_write(&[char]).map_err(nb::Error::Other) | 550 | self.blocking_write(&[char]).map_err(nb::Error::Other) |
| 551 | } | 551 | } |
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index a4a232f51..9566dbcaf 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -42,8 +42,8 @@ embassy-net = { version = "0.1.0", path = "../embassy-net", optional = true } | |||
| 42 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional = true } | 42 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional = true } |
| 43 | 43 | ||
| 44 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 44 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 45 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true} | 45 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9", optional = true} |
| 46 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true} | 46 | embedded-hal-async = { version = "=0.1.0-alpha.2", optional = true} |
| 47 | 47 | ||
| 48 | embedded-storage = "0.3.0" | 48 | embedded-storage = "0.3.0" |
| 49 | embedded-storage-async = { version = "0.3.0", optional = true } | 49 | embedded-storage-async = { version = "0.3.0", optional = true } |
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs index 07c96ead0..dca991859 100644 --- a/embassy-stm32/src/exti.rs +++ b/embassy-stm32/src/exti.rs | |||
| @@ -155,7 +155,7 @@ mod eh1 { | |||
| 155 | type Error = Infallible; | 155 | type Error = Infallible; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | impl<'d, T: GpioPin> embedded_hal_1::digital::blocking::InputPin for ExtiInput<'d, T> { | 158 | impl<'d, T: GpioPin> embedded_hal_1::digital::InputPin for ExtiInput<'d, T> { |
| 159 | fn is_high(&self) -> Result<bool, Self::Error> { | 159 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 160 | Ok(self.is_high()) | 160 | Ok(self.is_high()) |
| 161 | } | 161 | } |
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs index d794e3989..5e3346754 100644 --- a/embassy-stm32/src/gpio.rs +++ b/embassy-stm32/src/gpio.rs | |||
| @@ -848,8 +848,7 @@ mod eh02 { | |||
| 848 | 848 | ||
| 849 | #[cfg(feature = "unstable-traits")] | 849 | #[cfg(feature = "unstable-traits")] |
| 850 | mod eh1 { | 850 | mod eh1 { |
| 851 | use embedded_hal_1::digital::blocking::{InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin}; | 851 | use embedded_hal_1::digital::{ErrorType, InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin}; |
| 852 | use embedded_hal_1::digital::ErrorType; | ||
| 853 | 852 | ||
| 854 | use super::*; | 853 | use super::*; |
| 855 | 854 | ||
diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index 9dc75789a..f39a37df6 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs | |||
| @@ -334,7 +334,7 @@ mod eh1 { | |||
| 334 | type Error = Error; | 334 | type Error = Error; |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | impl<'d, T: Instance> embedded_hal_1::i2c::blocking::I2c for I2c<'d, T> { | 337 | impl<'d, T: Instance> embedded_hal_1::i2c::I2c for I2c<'d, T> { |
| 338 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { | 338 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 339 | self.blocking_read(address, buffer) | 339 | self.blocking_read(address, buffer) |
| 340 | } | 340 | } |
| @@ -364,14 +364,14 @@ mod eh1 { | |||
| 364 | fn transaction<'a>( | 364 | fn transaction<'a>( |
| 365 | &mut self, | 365 | &mut self, |
| 366 | _address: u8, | 366 | _address: u8, |
| 367 | _operations: &mut [embedded_hal_1::i2c::blocking::Operation<'a>], | 367 | _operations: &mut [embedded_hal_1::i2c::Operation<'a>], |
| 368 | ) -> Result<(), Self::Error> { | 368 | ) -> Result<(), Self::Error> { |
| 369 | todo!(); | 369 | todo!(); |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | fn transaction_iter<'a, O>(&mut self, _address: u8, _operations: O) -> Result<(), Self::Error> | 372 | fn transaction_iter<'a, O>(&mut self, _address: u8, _operations: O) -> Result<(), Self::Error> |
| 373 | where | 373 | where |
| 374 | O: IntoIterator<Item = embedded_hal_1::i2c::blocking::Operation<'a>>, | 374 | O: IntoIterator<Item = embedded_hal_1::i2c::Operation<'a>>, |
| 375 | { | 375 | { |
| 376 | todo!(); | 376 | todo!(); |
| 377 | } | 377 | } |
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index b7c89931c..89b52da98 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs | |||
| @@ -883,7 +883,7 @@ mod eh1 { | |||
| 883 | type Error = Error; | 883 | type Error = Error; |
| 884 | } | 884 | } |
| 885 | 885 | ||
| 886 | impl<'d, T: Instance> embedded_hal_1::i2c::blocking::I2c for I2c<'d, T, NoDma, NoDma> { | 886 | impl<'d, T: Instance> embedded_hal_1::i2c::I2c for I2c<'d, T, NoDma, NoDma> { |
| 887 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { | 887 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 888 | self.blocking_read(address, buffer) | 888 | self.blocking_read(address, buffer) |
| 889 | } | 889 | } |
| @@ -913,14 +913,14 @@ mod eh1 { | |||
| 913 | fn transaction<'a>( | 913 | fn transaction<'a>( |
| 914 | &mut self, | 914 | &mut self, |
| 915 | _address: u8, | 915 | _address: u8, |
| 916 | _operations: &mut [embedded_hal_1::i2c::blocking::Operation<'a>], | 916 | _operations: &mut [embedded_hal_1::i2c::Operation<'a>], |
| 917 | ) -> Result<(), Self::Error> { | 917 | ) -> Result<(), Self::Error> { |
| 918 | todo!(); | 918 | todo!(); |
| 919 | } | 919 | } |
| 920 | 920 | ||
| 921 | fn transaction_iter<'a, O>(&mut self, _address: u8, _operations: O) -> Result<(), Self::Error> | 921 | fn transaction_iter<'a, O>(&mut self, _address: u8, _operations: O) -> Result<(), Self::Error> |
| 922 | where | 922 | where |
| 923 | O: IntoIterator<Item = embedded_hal_1::i2c::blocking::Operation<'a>>, | 923 | O: IntoIterator<Item = embedded_hal_1::i2c::Operation<'a>>, |
| 924 | { | 924 | { |
| 925 | todo!(); | 925 | todo!(); |
| 926 | } | 926 | } |
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs index 556d12305..396427782 100644 --- a/embassy-stm32/src/spi/mod.rs +++ b/embassy-stm32/src/spi/mod.rs | |||
| @@ -843,25 +843,25 @@ mod eh1 { | |||
| 843 | type Error = Error; | 843 | type Error = Error; |
| 844 | } | 844 | } |
| 845 | 845 | ||
| 846 | impl<'d, T: Instance, Tx, Rx> embedded_hal_1::spi::blocking::SpiBusFlush for Spi<'d, T, Tx, Rx> { | 846 | impl<'d, T: Instance, Tx, Rx> embedded_hal_1::spi::SpiBusFlush for Spi<'d, T, Tx, Rx> { |
| 847 | fn flush(&mut self) -> Result<(), Self::Error> { | 847 | fn flush(&mut self) -> Result<(), Self::Error> { |
| 848 | Ok(()) | 848 | Ok(()) |
| 849 | } | 849 | } |
| 850 | } | 850 | } |
| 851 | 851 | ||
| 852 | impl<'d, T: Instance, W: Word> embedded_hal_1::spi::blocking::SpiBusRead<W> for Spi<'d, T, NoDma, NoDma> { | 852 | impl<'d, T: Instance, W: Word> embedded_hal_1::spi::SpiBusRead<W> for Spi<'d, T, NoDma, NoDma> { |
| 853 | fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { | 853 | fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { |
| 854 | self.blocking_read(words) | 854 | self.blocking_read(words) |
| 855 | } | 855 | } |
| 856 | } | 856 | } |
| 857 | 857 | ||
| 858 | impl<'d, T: Instance, W: Word> embedded_hal_1::spi::blocking::SpiBusWrite<W> for Spi<'d, T, NoDma, NoDma> { | 858 | impl<'d, T: Instance, W: Word> embedded_hal_1::spi::SpiBusWrite<W> for Spi<'d, T, NoDma, NoDma> { |
| 859 | fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { | 859 | fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { |
| 860 | self.blocking_write(words) | 860 | self.blocking_write(words) |
| 861 | } | 861 | } |
| 862 | } | 862 | } |
| 863 | 863 | ||
| 864 | impl<'d, T: Instance, W: Word> embedded_hal_1::spi::blocking::SpiBus<W> for Spi<'d, T, NoDma, NoDma> { | 864 | impl<'d, T: Instance, W: Word> embedded_hal_1::spi::SpiBus<W> for Spi<'d, T, NoDma, NoDma> { |
| 865 | fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> { | 865 | fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> { |
| 866 | self.blocking_transfer(read, write) | 866 | self.blocking_transfer(read, write) |
| 867 | } | 867 | } |
diff --git a/embassy-time/Cargo.toml b/embassy-time/Cargo.toml index 6d71e100f..c3b361b8a 100644 --- a/embassy-time/Cargo.toml +++ b/embassy-time/Cargo.toml | |||
| @@ -105,8 +105,8 @@ defmt = { version = "0.3", optional = true } | |||
| 105 | log = { version = "0.4.14", optional = true } | 105 | log = { version = "0.4.14", optional = true } |
| 106 | 106 | ||
| 107 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6" } | 107 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6" } |
| 108 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true} | 108 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9", optional = true} |
| 109 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true} | 109 | embedded-hal-async = { version = "=0.1.0-alpha.2", optional = true} |
| 110 | 110 | ||
| 111 | futures-util = { version = "0.3.17", default-features = false } | 111 | futures-util = { version = "0.3.17", default-features = false } |
| 112 | embassy-macros = { version = "0.1.0", path = "../embassy-macros"} | 112 | embassy-macros = { version = "0.1.0", path = "../embassy-macros"} |
| @@ -117,4 +117,4 @@ cfg-if = "1.0.0" | |||
| 117 | # WASM dependencies | 117 | # WASM dependencies |
| 118 | wasm-bindgen = { version = "0.2.81", optional = true } | 118 | wasm-bindgen = { version = "0.2.81", optional = true } |
| 119 | js-sys = { version = "0.3", optional = true } | 119 | js-sys = { version = "0.3", optional = true } |
| 120 | wasm-timer = { version = "0.2.5", optional = true } \ No newline at end of file | 120 | wasm-timer = { version = "0.2.5", optional = true } |
diff --git a/embassy-time/src/delay.rs b/embassy-time/src/delay.rs index 0a7982963..ff6b6869a 100644 --- a/embassy-time/src/delay.rs +++ b/embassy-time/src/delay.rs | |||
| @@ -18,7 +18,7 @@ pub struct Delay; | |||
| 18 | mod eh1 { | 18 | mod eh1 { |
| 19 | use super::*; | 19 | use super::*; |
| 20 | 20 | ||
| 21 | impl embedded_hal_1::delay::blocking::DelayUs for Delay { | 21 | impl embedded_hal_1::delay::DelayUs for Delay { |
| 22 | type Error = core::convert::Infallible; | 22 | type Error = core::convert::Infallible; |
| 23 | 23 | ||
| 24 | fn delay_us(&mut self, us: u32) -> Result<(), Self::Error> { | 24 | fn delay_us(&mut self, us: u32) -> Result<(), Self::Error> { |
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs index 23cd4355e..778cad3fa 100644 --- a/examples/rp/src/bin/spi_display.rs +++ b/examples/rp/src/bin/spi_display.rs | |||
| @@ -108,9 +108,9 @@ mod shared_spi { | |||
| 108 | use core::cell::RefCell; | 108 | use core::cell::RefCell; |
| 109 | use core::fmt::Debug; | 109 | use core::fmt::Debug; |
| 110 | 110 | ||
| 111 | use embedded_hal_1::digital::blocking::OutputPin; | 111 | use embedded_hal_1::digital::OutputPin; |
| 112 | use embedded_hal_1::spi; | 112 | use embedded_hal_1::spi; |
| 113 | use embedded_hal_1::spi::blocking::SpiDevice; | 113 | use embedded_hal_1::spi::SpiDevice; |
| 114 | 114 | ||
| 115 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] | 115 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] |
| 116 | pub enum SpiDeviceWithCsError<BUS, CS> { | 116 | pub enum SpiDeviceWithCsError<BUS, CS> { |
| @@ -153,7 +153,7 @@ mod shared_spi { | |||
| 153 | 153 | ||
| 154 | impl<'a, BUS, CS> SpiDevice for SpiDeviceWithCs<'a, BUS, CS> | 154 | impl<'a, BUS, CS> SpiDevice for SpiDeviceWithCs<'a, BUS, CS> |
| 155 | where | 155 | where |
| 156 | BUS: spi::blocking::SpiBusFlush, | 156 | BUS: spi::SpiBusFlush, |
| 157 | CS: OutputPin, | 157 | CS: OutputPin, |
| 158 | { | 158 | { |
| 159 | type Bus = BUS; | 159 | type Bus = BUS; |
| @@ -182,7 +182,7 @@ mod shared_spi { | |||
| 182 | 182 | ||
| 183 | /// Driver for the XPT2046 resistive touchscreen sensor | 183 | /// Driver for the XPT2046 resistive touchscreen sensor |
| 184 | mod touch { | 184 | mod touch { |
| 185 | use embedded_hal_1::spi::blocking::{SpiBus, SpiBusRead, SpiBusWrite, SpiDevice}; | 185 | use embedded_hal_1::spi::{SpiBus, SpiBusRead, SpiBusWrite, SpiDevice}; |
| 186 | 186 | ||
| 187 | struct Calibration { | 187 | struct Calibration { |
| 188 | x1: i32, | 188 | x1: i32, |
| @@ -246,8 +246,8 @@ mod touch { | |||
| 246 | 246 | ||
| 247 | mod my_display_interface { | 247 | mod my_display_interface { |
| 248 | use display_interface::{DataFormat, DisplayError, WriteOnlyDataCommand}; | 248 | use display_interface::{DataFormat, DisplayError, WriteOnlyDataCommand}; |
| 249 | use embedded_hal_1::digital::blocking::OutputPin; | 249 | use embedded_hal_1::digital::OutputPin; |
| 250 | use embedded_hal_1::spi::blocking::{SpiBusWrite, SpiDevice}; | 250 | use embedded_hal_1::spi::{SpiBusWrite, SpiDevice}; |
| 251 | 251 | ||
| 252 | /// SPI display interface. | 252 | /// SPI display interface. |
| 253 | /// | 253 | /// |
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index fc60d7a88..e725e03cb 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml | |||
| @@ -17,8 +17,8 @@ defmt-rtt = "0.3" | |||
| 17 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 17 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 18 | cortex-m-rt = "0.7.0" | 18 | cortex-m-rt = "0.7.0" |
| 19 | embedded-hal = "0.2.6" | 19 | embedded-hal = "0.2.6" |
| 20 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 20 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } |
| 21 | embedded-hal-async = { version = "0.1.0-alpha.1" } | 21 | embedded-hal-async = { version = "=0.1.0-alpha.2" } |
| 22 | embedded-nal-async = "0.2.0" | 22 | embedded-nal-async = "0.2.0" |
| 23 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 23 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
| 24 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 24 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index 35a9c20f0..2e2d07dc3 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml | |||
| @@ -18,8 +18,8 @@ defmt-rtt = "0.3" | |||
| 18 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 18 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 19 | cortex-m-rt = "0.7.0" | 19 | cortex-m-rt = "0.7.0" |
| 20 | embedded-hal = "0.2.6" | 20 | embedded-hal = "0.2.6" |
| 21 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 21 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } |
| 22 | embedded-hal-async = { version = "0.1.0-alpha.1" } | 22 | embedded-hal-async = { version = "=0.1.0-alpha.2" } |
| 23 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 23 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
| 24 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 24 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
| 25 | heapless = { version = "0.7.5", default-features = false } | 25 | heapless = { version = "0.7.5", default-features = false } |
diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml index 503373759..2745aef06 100644 --- a/tests/rp/Cargo.toml +++ b/tests/rp/Cargo.toml | |||
| @@ -16,8 +16,8 @@ defmt-rtt = "0.3.0" | |||
| 16 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 16 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 17 | cortex-m-rt = "0.7.0" | 17 | cortex-m-rt = "0.7.0" |
| 18 | embedded-hal = "0.2.6" | 18 | embedded-hal = "0.2.6" |
| 19 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 19 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } |
| 20 | embedded-hal-async = { version = "0.1.0-alpha.1" } | 20 | embedded-hal-async = { version = "=0.1.0-alpha.2" } |
| 21 | panic-probe = { version = "0.3.0", features = ["print-defmt"] } | 21 | panic-probe = { version = "0.3.0", features = ["print-defmt"] } |
| 22 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 22 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
| 23 | embedded-io = { version = "0.3.0", features = ["async"] } | 23 | embedded-io = { version = "0.3.0", features = ["async"] } |
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index d9cd3f120..daae3d464 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml | |||
| @@ -24,8 +24,8 @@ defmt-rtt = "0.3.0" | |||
| 24 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 24 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 25 | cortex-m-rt = "0.7.0" | 25 | cortex-m-rt = "0.7.0" |
| 26 | embedded-hal = "0.2.6" | 26 | embedded-hal = "0.2.6" |
| 27 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 27 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" } |
| 28 | embedded-hal-async = { version = "0.1.0-alpha.1" } | 28 | embedded-hal-async = { version = "=0.1.0-alpha.2" } |
| 29 | panic-probe = { version = "0.3.0", features = ["print-defmt"] } | 29 | panic-probe = { version = "0.3.0", features = ["print-defmt"] } |
| 30 | 30 | ||
| 31 | [profile.dev] | 31 | [profile.dev] |
