aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRagarnoy <[email protected]>2024-05-01 00:05:22 +0200
committerDario Nieuwenhuis <[email protected]>2024-05-20 10:56:43 +0200
commit44cb4159a67bcb0eeb9b0fa1e2e5fac2c2c2c2e3 (patch)
tree9ee4b3c93ced448a0b4cb9046f4e8e1eb19326cc
parent4dbec3402e1158975b462aa290b780f8a54b2eb8 (diff)
rustmft
-rw-r--r--embassy-embedded-hal/src/shared_bus/blocking/spi.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs
index 8f1cce4ad..2979d4ace 100644
--- a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs
+++ b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs
@@ -33,17 +33,14 @@ pub struct SpiDevice<'a, M: RawMutex, BUS, CS> {
33 cs: CS, 33 cs: CS,
34} 34}
35 35
36impl<'a, M: RawMutex, BUS, CS> SpiDevice<'a, M, BUS, CS, > { 36impl<'a, M: RawMutex, BUS, CS> SpiDevice<'a, M, BUS, CS> {
37 /// Create a new `SpiDevice`. 37 /// Create a new `SpiDevice`.
38 pub fn new(bus: &'a Mutex<M, RefCell<BUS>>, cs: CS) -> Self { 38 pub fn new(bus: &'a Mutex<M, RefCell<BUS>>, cs: CS) -> Self {
39 Self { 39 Self { bus, cs }
40 bus,
41 cs,
42 }
43 } 40 }
44} 41}
45 42
46impl<'a, M: RawMutex, BUS, CS> spi::ErrorType for SpiDevice<'a, M, BUS, CS, > 43impl<'a, M: RawMutex, BUS, CS> spi::ErrorType for SpiDevice<'a, M, BUS, CS>
47where 44where
48 BUS: spi::ErrorType, 45 BUS: spi::ErrorType,
49 CS: OutputPin, 46 CS: OutputPin,
@@ -51,7 +48,7 @@ where
51 type Error = SpiDeviceError<BUS::Error, CS::Error>; 48 type Error = SpiDeviceError<BUS::Error, CS::Error>;
52} 49}
53 50
54impl<BUS, M, CS, Word> embedded_hal_1::spi::SpiDevice<Word> for SpiDevice<'_, M, BUS, CS, > 51impl<BUS, M, CS, Word> embedded_hal_1::spi::SpiDevice<Word> for SpiDevice<'_, M, BUS, CS>
55where 52where
56 M: RawMutex, 53 M: RawMutex,
57 BUS: SpiBus<Word>, 54 BUS: SpiBus<Word>,
@@ -94,7 +91,6 @@ where
94 } 91 }
95} 92}
96 93
97
98/// SPI device on a shared bus, with its own configuration. 94/// SPI device on a shared bus, with its own configuration.
99/// 95///
100/// This is like [`SpiDevice`], with an additional bus configuration that's applied 96/// This is like [`SpiDevice`], with an additional bus configuration that's applied