Struct embedded_hal_async::spi::ExclusiveDevice
source · [−]pub struct ExclusiveDevice<BUS, CS> { /* private fields */ }
Expand description
Implementations
sourceimpl<BUS, CS> ExclusiveDevice<BUS, CS>
impl<BUS, CS> ExclusiveDevice<BUS, CS>
Trait Implementations
sourceimpl<BUS, CS> ErrorType for ExclusiveDevice<BUS, CS> where
BUS: ErrorType,
CS: OutputPin,
impl<BUS, CS> ErrorType for ExclusiveDevice<BUS, CS> where
BUS: ErrorType,
CS: OutputPin,
sourceimpl<BUS, CS> SpiDevice for ExclusiveDevice<BUS, CS> where
BUS: SpiBusFlush,
CS: OutputPin,
impl<BUS, CS> SpiDevice for ExclusiveDevice<BUS, CS> where
BUS: SpiBusFlush,
CS: OutputPin,
type Bus = BUS
type Bus = BUS
SPI Bus type for this device.
sourcefn transaction<R>(
&mut self,
f: impl FnOnce(&mut Self::Bus) -> Result<R, <Self::Bus as ErrorType>::Error>
) -> Result<R, Self::Error>
fn transaction<R>(
&mut self,
f: impl FnOnce(&mut Self::Bus) -> Result<R, <Self::Bus as ErrorType>::Error>
) -> Result<R, Self::Error>
Perform a transaction against the device. Read more
sourcefn write<Word>(&mut self, buf: &[Word]) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBusWrite<Word>,
fn write<Word>(&mut self, buf: &[Word]) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBusWrite<Word>,
Do a write within a transaction. Read more
sourcefn read<Word>(&mut self, buf: &mut [Word]) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBusRead<Word>,
fn read<Word>(&mut self, buf: &mut [Word]) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBusRead<Word>,
Do a read within a transaction. Read more
sourcefn transfer<Word>(
&mut self,
read: &mut [Word],
write: &[Word]
) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBus<Word>,
fn transfer<Word>(
&mut self,
read: &mut [Word],
write: &[Word]
) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBus<Word>,
Do a transfer within a transaction. Read more
sourcefn transfer_in_place<Word>(
&mut self,
buf: &mut [Word]
) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBus<Word>,
fn transfer_in_place<Word>(
&mut self,
buf: &mut [Word]
) -> Result<(), Self::Error> where
Word: Copy,
Self::Bus: SpiBus<Word>,
Do an in-place transfer within a transaction. Read more
sourceimpl<BUS, CS> SpiDevice for ExclusiveDevice<BUS, CS> where
BUS: SpiBusFlush,
CS: OutputPin,
impl<BUS, CS> SpiDevice for ExclusiveDevice<BUS, CS> where
BUS: SpiBusFlush,
CS: OutputPin,
type Bus = BUS
type Bus = BUS
SPI Bus type for this device.
type TransactionFuture<'a, R, F, Fut>
where
Self: 'a,
R: 'a,
F: FnOnce(*mut Self::Bus) -> Fut + 'a,
Fut: Future<Output = Result<R, <Self::Bus as ErrorType>::Error>> + 'a = impl Future<Output = Result<R, <ExclusiveDevice<BUS, CS> as ErrorType>::Error>>
type TransactionFuture<'a, R, F, Fut>
where
Self: 'a,
R: 'a,
F: FnOnce(*mut Self::Bus) -> Fut + 'a,
Fut: Future<Output = Result<R, <Self::Bus as ErrorType>::Error>> + 'a = impl Future<Output = Result<R, <ExclusiveDevice<BUS, CS> as ErrorType>::Error>>
Future returned by the transaction
method.
sourcefn transaction<'a, R, F, Fut>(
&'a mut self,
f: F
) -> Self::TransactionFuture<'a, R, F, Fut> where
R: 'a,
F: FnOnce(*mut Self::Bus) -> Fut + 'a,
Fut: Future<Output = Result<R, <Self::Bus as ErrorType>::Error>> + 'a,
fn transaction<'a, R, F, Fut>(
&'a mut self,
f: F
) -> Self::TransactionFuture<'a, R, F, Fut> where
R: 'a,
F: FnOnce(*mut Self::Bus) -> Fut + 'a,
Fut: Future<Output = Result<R, <Self::Bus as ErrorType>::Error>> + 'a,
Perform a transaction against the device. Read more
sourcefn read<'a, Word>(
&'a mut self,
buf: &'a mut [Word]
) -> impl Future<Output = Result<(), Self::Error>> where
Self::Bus: SpiBusRead<Word>,
Word: Copy + 'static,
fn read<'a, Word>(
&'a mut self,
buf: &'a mut [Word]
) -> impl Future<Output = Result<(), Self::Error>> where
Self::Bus: SpiBusRead<Word>,
Word: Copy + 'static,
Do a read within a transaction. Read more
sourcefn write<'a, Word>(
&'a mut self,
buf: &'a [Word]
) -> impl Future<Output = Result<(), Self::Error>> where
Self::Bus: SpiBusWrite<Word>,
Word: Copy + 'static,
fn write<'a, Word>(
&'a mut self,
buf: &'a [Word]
) -> impl Future<Output = Result<(), Self::Error>> where
Self::Bus: SpiBusWrite<Word>,
Word: Copy + 'static,
Do a write within a transaction. Read more
Auto Trait Implementations
impl<BUS, CS> RefUnwindSafe for ExclusiveDevice<BUS, CS> where
BUS: RefUnwindSafe,
CS: RefUnwindSafe,
impl<BUS, CS> Send for ExclusiveDevice<BUS, CS> where
BUS: Send,
CS: Send,
impl<BUS, CS> Sync for ExclusiveDevice<BUS, CS> where
BUS: Sync,
CS: Sync,
impl<BUS, CS> Unpin for ExclusiveDevice<BUS, CS> where
BUS: Unpin,
CS: Unpin,
impl<BUS, CS> UnwindSafe for ExclusiveDevice<BUS, CS> where
BUS: UnwindSafe,
CS: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more