Trait atsamd_hal::prelude::_embedded_hal_serial_Read
source · [−]pub trait _embedded_hal_serial_Read<Word> {
type Error;
fn read(&mut self) -> Result<Word, Error<Self::Error>>;
}
Expand description
Read half of a serial interface
Some serial interfaces support different data sizes (8 bits, 9 bits, etc.);
This can be encoded in this trait via the Word
type parameter.
Required Associated Types
Required Methods
Implementors
sourceimpl<C, D> Read<<C as AnyConfig>::Word> for Uart<C, D>where
C: ValidConfig,
D: Receive,
DataReg: AsPrimitive<C::Word>,
impl<C, D> Read<<C as AnyConfig>::Word> for Uart<C, D>where
C: ValidConfig,
D: Receive,
DataReg: AsPrimitive<C::Word>,
sourceimpl<P, L> Read<<L as Length>::Word> for Spi<Config<P, Slave, L>, Rx>where
Config<P, Slave, L>: ValidConfig,
P: ValidPads,
L: Length,
L::Word: PrimInt,
u32: AsPrimitive<L::Word>,
impl<P, L> Read<<L as Length>::Word> for Spi<Config<P, Slave, L>, Rx>where
Config<P, Slave, L>: ValidConfig,
P: ValidPads,
L: Length,
L::Word: PrimInt,
u32: AsPrimitive<L::Word>,
Implement serial::Read
for Rx
Spi
structs in Slave
OpMode
serial::Read
is only implemented for Spi
structs with Rx
Capability
. In Slave
OpMode
, Read
does not have to initiate
transactions, so it does not have to store any internal state. It only has
to wait on RXC
.
sourceimpl<P, M, L> Read<<L as Length>::Word> for Spi<Config<P, M, L>, Rx>where
Config<P, M, L>: ValidConfig,
P: ValidPads,
M: MasterMode,
L: Length,
L::Word: PrimInt,
u32: AsPrimitive<L::Word>,
impl<P, M, L> Read<<L as Length>::Word> for Spi<Config<P, M, L>, Rx>where
Config<P, M, L>: ValidConfig,
P: ValidPads,
M: MasterMode,
L: Length,
L::Word: PrimInt,
u32: AsPrimitive<L::Word>,
Implement serial::Read
for Rx
Spi
structs in a MasterMode
serial::Read
is only implemented for Spi
structs with Rx
Capability
. In a MasterMode
, Read
has to initiate transactions, so
it keeps track of the transaction state. If a transaction is in progress,
it will wait on RXC
. If not, it will wait on DRE
, and then send 0
.