mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
rustmft
This commit is contained in:
parent
4dbec3402e
commit
44cb4159a6
@ -33,17 +33,14 @@ pub struct SpiDevice<'a, M: RawMutex, BUS, CS> {
|
|||||||
cs: CS,
|
cs: CS,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, M: RawMutex, BUS, CS> SpiDevice<'a, M, BUS, CS, > {
|
impl<'a, M: RawMutex, BUS, CS> SpiDevice<'a, M, BUS, CS> {
|
||||||
/// Create a new `SpiDevice`.
|
/// Create a new `SpiDevice`.
|
||||||
pub fn new(bus: &'a Mutex<M, RefCell<BUS>>, cs: CS) -> Self {
|
pub fn new(bus: &'a Mutex<M, RefCell<BUS>>, cs: CS) -> Self {
|
||||||
Self {
|
Self { bus, cs }
|
||||||
bus,
|
|
||||||
cs,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, M: RawMutex, BUS, CS> spi::ErrorType for SpiDevice<'a, M, BUS, CS, >
|
impl<'a, M: RawMutex, BUS, CS> spi::ErrorType for SpiDevice<'a, M, BUS, CS>
|
||||||
where
|
where
|
||||||
BUS: spi::ErrorType,
|
BUS: spi::ErrorType,
|
||||||
CS: OutputPin,
|
CS: OutputPin,
|
||||||
@ -51,7 +48,7 @@ where
|
|||||||
type Error = SpiDeviceError<BUS::Error, CS::Error>;
|
type Error = SpiDeviceError<BUS::Error, CS::Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<BUS, M, CS, Word> embedded_hal_1::spi::SpiDevice<Word> for SpiDevice<'_, M, BUS, CS, >
|
impl<BUS, M, CS, Word> embedded_hal_1::spi::SpiDevice<Word> for SpiDevice<'_, M, BUS, CS>
|
||||||
where
|
where
|
||||||
M: RawMutex,
|
M: RawMutex,
|
||||||
BUS: SpiBus<Word>,
|
BUS: SpiBus<Word>,
|
||||||
@ -94,7 +91,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// SPI device on a shared bus, with its own configuration.
|
/// SPI device on a shared bus, with its own configuration.
|
||||||
///
|
///
|
||||||
/// This is like [`SpiDevice`], with an additional bus configuration that's applied
|
/// This is like [`SpiDevice`], with an additional bus configuration that's applied
|
||||||
|
Loading…
Reference in New Issue
Block a user