Struct max7301::expander::transactional::TransactionalIO [−][src]
This I/O adapter captures the Expander
and provides a factory for generating GPIO pins that
implement InputPin
and OutputPin
traits backed by a transactional write-back cache.
Each such pin will read its input state from a cached batch read at the beginning of a transaction, and will write its input state into a write-back buffer that is committed with a batch write at the end of the transaction. This reduces bus traffic due to the MAX7301’s support for reading or writing 8 consecutive ports in a single operation.
Implementations
impl<M, EI> TransactionalIO<M, EI> where
M: IOMutex<Expander<EI>>,
EI: ExpanderInterface + Send,
[src]
M: IOMutex<Expander<EI>>,
EI: ExpanderInterface + Send,
pub fn port_pin<'io>(&'io self, port: u8) -> PortPin<'io, Self>
[src]
Create a PortPin
corresponding to one of the ports on the MAX7301.
The returned PortPin
implements InputPin
and OutputPin
, and using any of the methods
from these traits on the returned PortPin
will read or write the value of the I/O port
from a local write-back cache. Refreshing or writing back the cache is controlled by
refresh
and write_back
.
pub fn refresh(&self) -> Result<(), ()>
[src]
Refresh the local cache by reading the port values from any outstanding PortPin
s issued
from this adapter, updating the values read through their InputPin
impls.
This is done using batch registers of MAX7301 to reduce bus traffic. All pending
OutputPin
operations are discarded.
pub fn write_back(&self, strategy: Strategy) -> Result<(), ()>
[src]
Write back any pending OutputPin
operations to the MAX7301.
The strategy used to do this is controlled by strategy
(see Strategy
docs for a
description of the available strategies).
Trait Implementations
impl<M, EI> ExpanderIO for TransactionalIO<M, EI> where
M: IOMutex<Expander<EI>>,
EI: ExpanderInterface + Send,
[src]
M: IOMutex<Expander<EI>>,
EI: ExpanderInterface + Send,
Auto Trait Implementations
impl<M, EI> RefUnwindSafe for TransactionalIO<M, EI> where
EI: RefUnwindSafe,
M: RefUnwindSafe,
EI: RefUnwindSafe,
M: RefUnwindSafe,
impl<M, EI> Send for TransactionalIO<M, EI> where
M: Send,
M: Send,
impl<M, EI> Sync for TransactionalIO<M, EI> where
EI: Sync,
M: Sync,
EI: Sync,
M: Sync,
impl<M, EI> Unpin for TransactionalIO<M, EI> where
EI: Unpin,
M: Unpin,
EI: Unpin,
M: Unpin,
impl<M, EI> UnwindSafe for TransactionalIO<M, EI> where
EI: UnwindSafe,
M: UnwindSafe,
EI: UnwindSafe,
M: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,