This commit is contained in:
Ragarnoy 2024-05-01 00:05:22 +02:00 committed by Dario Nieuwenhuis
parent 4dbec3402e
commit 44cb4159a6

View File

@ -33,17 +33,14 @@ pub struct SpiDevice<'a, M: RawMutex, BUS, 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`.
pub fn new(bus: &'a Mutex<M, RefCell<BUS>>, cs: CS) -> Self {
Self {
bus,
cs,
}
Self { 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
BUS: spi::ErrorType,
CS: OutputPin,
@ -51,7 +48,7 @@ where
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
M: RawMutex,
BUS: SpiBus<Word>,
@ -94,7 +91,6 @@ where
}
}
/// SPI device on a shared bus, with its own configuration.
///
/// This is like [`SpiDevice`], with an additional bus configuration that's applied