aboutsummaryrefslogtreecommitdiff
path: root/embassy-embedded-hal
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-embedded-hal')
-rw-r--r--embassy-embedded-hal/src/shared_bus/asynch/spi.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs
index 9890f218d..30d4ecc36 100644
--- a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs
+++ b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs
@@ -55,13 +55,14 @@ where
55 type Error = SpiDeviceError<BUS::Error, CS::Error>; 55 type Error = SpiDeviceError<BUS::Error, CS::Error>;
56} 56}
57 57
58impl<M, BUS, CS> spi::SpiDevice for SpiDevice<'_, M, BUS, CS> 58impl<M, BUS, CS, Word> spi::SpiDevice<Word> for SpiDevice<'_, M, BUS, CS>
59where 59where
60 M: RawMutex, 60 M: RawMutex,
61 BUS: spi::SpiBus, 61 BUS: spi::SpiBus<Word>,
62 CS: OutputPin, 62 CS: OutputPin,
63 Word: Copy + 'static,
63{ 64{
64 async fn transaction(&mut self, operations: &mut [spi::Operation<'_, u8>]) -> Result<(), Self::Error> { 65 async fn transaction(&mut self, operations: &mut [spi::Operation<'_, Word>]) -> Result<(), Self::Error> {
65 if cfg!(not(feature = "time")) && operations.iter().any(|op| matches!(op, Operation::DelayNs(_))) { 66 if cfg!(not(feature = "time")) && operations.iter().any(|op| matches!(op, Operation::DelayNs(_))) {
66 return Err(SpiDeviceError::DelayNotSupported); 67 return Err(SpiDeviceError::DelayNotSupported);
67 } 68 }
@@ -138,13 +139,14 @@ where
138 type Error = SpiDeviceError<BUS::Error, CS::Error>; 139 type Error = SpiDeviceError<BUS::Error, CS::Error>;
139} 140}
140 141
141impl<M, BUS, CS> spi::SpiDevice for SpiDeviceWithConfig<'_, M, BUS, CS> 142impl<M, BUS, CS, Word> spi::SpiDevice<Word> for SpiDeviceWithConfig<'_, M, BUS, CS>
142where 143where
143 M: RawMutex, 144 M: RawMutex,
144 BUS: spi::SpiBus + SetConfig, 145 BUS: spi::SpiBus<Word> + SetConfig,
145 CS: OutputPin, 146 CS: OutputPin,
147 Word: Copy + 'static,
146{ 148{
147 async fn transaction(&mut self, operations: &mut [spi::Operation<'_, u8>]) -> Result<(), Self::Error> { 149 async fn transaction(&mut self, operations: &mut [spi::Operation<'_, Word>]) -> Result<(), Self::Error> {
148 if cfg!(not(feature = "time")) && operations.iter().any(|op| matches!(op, Operation::DelayNs(_))) { 150 if cfg!(not(feature = "time")) && operations.iter().any(|op| matches!(op, Operation::DelayNs(_))) {
149 return Err(SpiDeviceError::DelayNotSupported); 151 return Err(SpiDeviceError::DelayNotSupported);
150 } 152 }