aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-07-04 19:53:06 +0200
committerDario Nieuwenhuis <[email protected]>2023-07-04 19:59:36 +0200
commita101d9078deb3ad576a40b6d5f4d6e81dcfd528e (patch)
tree98deed296973aa29dc1701f69ecbe342d2a2c7c5 /embassy-stm32
parentb2f843a4ce2dc9114a135f612e1a408a8fe02fab (diff)
update embedded-hal crates.
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/Cargo.toml6
-rw-r--r--embassy-stm32/src/spi/mod.rs23
2 files changed, 8 insertions, 21 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index b3fe9c1f5..045149636 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -40,9 +40,9 @@ embassy-net-driver = { version = "0.1.0", path = "../embassy-net-driver" }
40embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional = true } 40embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional = true }
41 41
42embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } 42embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] }
43embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.10", optional = true} 43embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.11", optional = true}
44embedded-hal-async = { version = "=0.2.0-alpha.1", optional = true} 44embedded-hal-async = { version = "=0.2.0-alpha.2", optional = true}
45embedded-hal-nb = { version = "=1.0.0-alpha.2", optional = true} 45embedded-hal-nb = { version = "=1.0.0-alpha.3", optional = true}
46 46
47embedded-storage = "0.3.0" 47embedded-storage = "0.3.0"
48embedded-storage-async = { version = "0.4.0", optional = true } 48embedded-storage-async = { version = "0.4.0", optional = true }
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs
index c3224073d..d5f63f84e 100644
--- a/embassy-stm32/src/spi/mod.rs
+++ b/embassy-stm32/src/spi/mod.rs
@@ -852,25 +852,19 @@ mod eh1 {
852 type Error = Error; 852 type Error = Error;
853 } 853 }
854 854
855 impl<'d, T: Instance, Tx, Rx> embedded_hal_1::spi::SpiBusFlush for Spi<'d, T, Tx, Rx> { 855 impl<'d, T: Instance, W: Word, Tx, Rx> embedded_hal_1::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> {
856 fn flush(&mut self) -> Result<(), Self::Error> { 856 fn flush(&mut self) -> Result<(), Self::Error> {
857 Ok(()) 857 Ok(())
858 } 858 }
859 }
860 859
861 impl<'d, T: Instance, W: Word, Tx, Rx> embedded_hal_1::spi::SpiBusRead<W> for Spi<'d, T, Tx, Rx> {
862 fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { 860 fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> {
863 self.blocking_read(words) 861 self.blocking_read(words)
864 } 862 }
865 }
866 863
867 impl<'d, T: Instance, W: Word, Tx, Rx> embedded_hal_1::spi::SpiBusWrite<W> for Spi<'d, T, Tx, Rx> {
868 fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { 864 fn write(&mut self, words: &[W]) -> Result<(), Self::Error> {
869 self.blocking_write(words) 865 self.blocking_write(words)
870 } 866 }
871 }
872 867
873 impl<'d, T: Instance, W: Word, Tx, Rx> embedded_hal_1::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> {
874 fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> { 868 fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> {
875 self.blocking_transfer(read, write) 869 self.blocking_transfer(read, write)
876 } 870 }
@@ -895,32 +889,25 @@ mod eh1 {
895#[cfg(all(feature = "unstable-traits", feature = "nightly"))] 889#[cfg(all(feature = "unstable-traits", feature = "nightly"))]
896mod eha { 890mod eha {
897 use super::*; 891 use super::*;
898 impl<'d, T: Instance, Tx, Rx> embedded_hal_async::spi::SpiBusFlush for Spi<'d, T, Tx, Rx> { 892
893 impl<'d, T: Instance, Tx: TxDma<T>, Rx: RxDma<T>, W: Word> embedded_hal_async::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> {
899 async fn flush(&mut self) -> Result<(), Self::Error> { 894 async fn flush(&mut self) -> Result<(), Self::Error> {
900 Ok(()) 895 Ok(())
901 } 896 }
902 }
903 897
904 impl<'d, T: Instance, Tx: TxDma<T>, Rx, W: Word> embedded_hal_async::spi::SpiBusWrite<W> for Spi<'d, T, Tx, Rx> {
905 async fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { 898 async fn write(&mut self, words: &[W]) -> Result<(), Self::Error> {
906 self.write(words).await 899 self.write(words).await
907 } 900 }
908 }
909 901
910 impl<'d, T: Instance, Tx: TxDma<T>, Rx: RxDma<T>, W: Word> embedded_hal_async::spi::SpiBusRead<W>
911 for Spi<'d, T, Tx, Rx>
912 {
913 async fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { 902 async fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> {
914 self.read(words).await 903 self.read(words).await
915 } 904 }
916 }
917 905
918 impl<'d, T: Instance, Tx: TxDma<T>, Rx: RxDma<T>, W: Word> embedded_hal_async::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> { 906 async fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> {
919 async fn transfer<'a>(&'a mut self, read: &'a mut [W], write: &'a [W]) -> Result<(), Self::Error> {
920 self.transfer(read, write).await 907 self.transfer(read, write).await
921 } 908 }
922 909
923 async fn transfer_in_place<'a>(&'a mut self, words: &'a mut [W]) -> Result<(), Self::Error> { 910 async fn transfer_in_place(&mut self, words: &mut [W]) -> Result<(), Self::Error> {
924 self.transfer_in_place(words).await 911 self.transfer_in_place(words).await
925 } 912 }
926 } 913 }