pub struct SpiFuture<C, A, R = NoneT, T = NoneT>where
    C: ValidConfig,
    A: Capability,{ /* private fields */ }Expand description
async version of Spi.
Create this struct by calling Spi::into_future.
Implementations§
Source§impl<C, D, T> SpiFuture<C, D, NoneT, T>where
    C: ValidConfig<Sercom: Sercom, OpMode = Slave, Word: PrimInt + AsPrimitive<DataWidth>>,
    D: Receive,
    DataWidth: AsPrimitive<C::Word>,
 
impl<C, D, T> SpiFuture<C, D, NoneT, T>where
    C: ValidConfig<Sercom: Sercom, OpMode = Slave, Word: PrimInt + AsPrimitive<DataWidth>>,
    D: Receive,
    DataWidth: AsPrimitive<C::Word>,
Sourcepub fn with_rx_dma_channel<Chan: AnyChannel<Status = ReadyFuture>>(
    self,
    rx_channel: Chan,
) -> SpiFuture<C, D, Chan, T>
 
pub fn with_rx_dma_channel<Chan: AnyChannel<Status = ReadyFuture>>( self, rx_channel: Chan, ) -> SpiFuture<C, D, Chan, T>
Source§impl<C, D, R> SpiFuture<C, D, R, NoneT>where
    C: ValidConfig<Sercom: Sercom, Word: PrimInt + AsPrimitive<DataWidth>>,
    D: Transmit,
    DataWidth: AsPrimitive<C::Word>,
 
impl<C, D, R> SpiFuture<C, D, R, NoneT>where
    C: ValidConfig<Sercom: Sercom, Word: PrimInt + AsPrimitive<DataWidth>>,
    D: Transmit,
    DataWidth: AsPrimitive<C::Word>,
Sourcepub fn with_tx_dma_channel<Chan: AnyChannel<Status = ReadyFuture>>(
    self,
    tx_channel: Chan,
) -> SpiFuture<C, D, R, Chan>
 
pub fn with_tx_dma_channel<Chan: AnyChannel<Status = ReadyFuture>>( self, tx_channel: Chan, ) -> SpiFuture<C, D, R, Chan>
Source§impl<C, D> SpiFuture<C, D, NoneT, NoneT>where
    C: ValidConfig<Sercom: Sercom, OpMode: MasterMode, Word: PrimInt + AsPrimitive<DataWidth>>,
    D: Receive,
    DataWidth: AsPrimitive<C::Word>,
 
impl<C, D> SpiFuture<C, D, NoneT, NoneT>where
    C: ValidConfig<Sercom: Sercom, OpMode: MasterMode, Word: PrimInt + AsPrimitive<DataWidth>>,
    D: Receive,
    DataWidth: AsPrimitive<C::Word>,
Sourcepub fn with_dma_channels<R, T>(
    self,
    rx_channel: R,
    tx_channel: T,
) -> SpiFuture<C, D, R, T>
 
pub fn with_dma_channels<R, T>( self, rx_channel: R, tx_channel: T, ) -> SpiFuture<C, D, R, T>
Source§impl<C> SpiFuture<C, Duplex>where
    C: ValidConfig<OpMode = Slave>,
 
impl<C> SpiFuture<C, Duplex>where
    C: ValidConfig<OpMode = Slave>,
Sourcepub fn with_dma_channels_slave<R, T>(
    self,
    rx: R,
    tx: T,
) -> SpiFuture<C, Duplex, R, T>
 
pub fn with_dma_channels_slave<R, T>( self, rx: R, tx: T, ) -> SpiFuture<C, Duplex, R, T>
Source§impl<C, D, R, T> SpiFuture<C, D, R, T>where
    C: ValidConfig,
    D: Capability,
 
impl<C, D, R, T> SpiFuture<C, D, R, T>where
    C: ValidConfig,
    D: Capability,
Sourcepub fn take_dma_channels(self) -> (SpiFuture<C, D, NoneT, NoneT>, R, T)
 
pub fn take_dma_channels(self) -> (SpiFuture<C, D, NoneT, NoneT>, R, T)
Reclaim both RX and TX DMA channels. Any subsequent SPI transaction will not use DMA.
Sourcepub fn take_rx_channel(self) -> (SpiFuture<C, D, NoneT, T>, R)where
    R: AnyChannel<Status = ReadyFuture>,
 
pub fn take_rx_channel(self) -> (SpiFuture<C, D, NoneT, T>, R)where
    R: AnyChannel<Status = ReadyFuture>,
Reclaim the RX DMA channel. Any subsequent SPI RX transaction will not use DMA.
Sourcepub fn take_tx_channel(self) -> (SpiFuture<C, D, R, NoneT>, T)where
    T: AnyChannel<Status = ReadyFuture>,
 
pub fn take_tx_channel(self) -> (SpiFuture<C, D, R, NoneT>, T)where
    T: AnyChannel<Status = ReadyFuture>,
Reclaim the TX DMA channel. Any subsequent SPI TX transaction will not use DMA.
Source§impl<P, M, Z, D, R, T, S> SpiFuture<Config<P, M, Z>, D, R, T>where
    P: ValidPads,
    M: OpMode,
    Z: Size + 'static,
    Config<P, M, Z>: ValidConfig<Sercom = S>,
    D: Transmit,
    S: Sercom,
    Z::Word: PrimInt + AsPrimitive<DataWidth> + Beat,
    DataWidth: AsPrimitive<Z::Word>,
    T: AnyChannel<Status = ReadyFuture>,
 
impl<P, M, Z, D, R, T, S> SpiFuture<Config<P, M, Z>, D, R, T>where
    P: ValidPads,
    M: OpMode,
    Z: Size + 'static,
    Config<P, M, Z>: ValidConfig<Sercom = S>,
    D: Transmit,
    S: Sercom,
    Z::Word: PrimInt + AsPrimitive<DataWidth> + Beat,
    DataWidth: AsPrimitive<Z::Word>,
    T: AnyChannel<Status = ReadyFuture>,
Source§impl<P, M, S, C, D, R, T> SpiFuture<Config<P, M, C>, D, R, T>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    S: Sercom,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth> + Beat,
    D: Capability,
    DataWidth: AsPrimitive<C::Word>,
    R: AnyChannel<Status = ReadyFuture>,
    T: AnyChannel<Status = ReadyFuture>,
 
impl<P, M, S, C, D, R, T> SpiFuture<Config<P, M, C>, D, R, T>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    S: Sercom,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth> + Beat,
    D: Capability,
    DataWidth: AsPrimitive<C::Word>,
    R: AnyChannel<Status = ReadyFuture>,
    T: AnyChannel<Status = ReadyFuture>,
Source§impl<C, D> SpiFuture<C, D, NoneT, NoneT>where
    C: ValidConfig,
    D: Capability,
 
impl<C, D> SpiFuture<C, D, NoneT, NoneT>where
    C: ValidConfig,
    D: Capability,
Source§impl<P, M, C, D, R, S> SpiFuture<Config<P, M, C>, D, R, NoneT>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: OpMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    D: Transmit,
    DataWidth: AsPrimitive<C::Word>,
    S: Sercom,
 
impl<P, M, C, D, R, S> SpiFuture<Config<P, M, C>, D, R, NoneT>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: OpMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    D: Transmit,
    DataWidth: AsPrimitive<C::Word>,
    S: Sercom,
Source§impl<P, M, C, D, T, S> SpiFuture<Config<P, M, C>, D, NoneT, T>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    D: Receive,
    DataWidth: AsPrimitive<C::Word>,
    S: Sercom,
 
impl<P, M, C, D, T, S> SpiFuture<Config<P, M, C>, D, NoneT, T>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    D: Receive,
    DataWidth: AsPrimitive<C::Word>,
    S: Sercom,
Source§impl<P, M, C, S, D, R, T> SpiFuture<Config<P, M, C>, D, R, T>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: OpMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    DataWidth: AsPrimitive<C::Word>,
    D: Capability,
    S: Sercom,
 
impl<P, M, C, S, D, R, T> SpiFuture<Config<P, M, C>, D, R, T>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: OpMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    DataWidth: AsPrimitive<C::Word>,
    D: Capability,
    S: Sercom,
Trait Implementations§
Source§impl<C, A, R, T> AsMut<Spi<C, A, R, T>> for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
 
impl<C, A, R, T> AsMut<Spi<C, A, R, T>> for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
Source§impl<C, A, R, T> AsRef<Spi<C, A, R, T>> for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
 
impl<C, A, R, T> AsRef<Spi<C, A, R, T>> for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
Source§impl<C, A, R, T> ErrorType for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
 
impl<C, A, R, T> ErrorType for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
Source§impl<C, A, R, T> ErrorType for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
 
impl<C, A, R, T> ErrorType for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
Source§impl<C, A, R, T> Format for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
 
impl<C, A, R, T> Format for SpiFuture<C, A, R, T>where
    C: ValidConfig,
    A: Capability,
Source§impl<P, M, Z, D, T, S> Read for SpiFuture<Config<P, M, Z>, D, NoneT, T>where
    P: ValidPads,
    M: MasterMode,
    Z: Size<Word = u8> + 'static,
    Config<P, M, Z>: ValidConfig<Sercom = S>,
    D: Receive,
    S: Sercom,
embedded_io::Read implementation for Receive SpiFutures in
MasterMode.
 
impl<P, M, Z, D, T, S> Read for SpiFuture<Config<P, M, Z>, D, NoneT, T>where
    P: ValidPads,
    M: MasterMode,
    Z: Size<Word = u8> + 'static,
    Config<P, M, Z>: ValidConfig<Sercom = S>,
    D: Receive,
    S: Sercom,
embedded_io::Read implementation for Receive SpiFutures in
MasterMode.
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
 
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§async fn read_exact(
    &mut self,
    buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
 
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl<P, M, Z, D, R, T> Read for SpiFuture<Config<P, M, Z>, D, R, T>where
    P: ValidPads,
    M: MasterMode,
    Z: Size<Word = u8> + 'static,
    Config<P, M, Z>: ValidConfig<Sercom: Sercom>,
    D: Receive,
    R: AnyChannel<Status = ReadyFuture>,
    T: AnyChannel<Status = ReadyFuture>,
embedded_io::Read implementation for Receive SpiFutures in
MasterMode, using DMA transfers.
 
impl<P, M, Z, D, R, T> Read for SpiFuture<Config<P, M, Z>, D, R, T>where
    P: ValidPads,
    M: MasterMode,
    Z: Size<Word = u8> + 'static,
    Config<P, M, Z>: ValidConfig<Sercom: Sercom>,
    D: Receive,
    R: AnyChannel<Status = ReadyFuture>,
    T: AnyChannel<Status = ReadyFuture>,
embedded_io::Read implementation for Receive SpiFutures in
MasterMode, using DMA transfers.
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
 
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§async fn read_exact(
    &mut self,
    buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
 
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl<P, Z, D, T, S> Read for SpiFuture<Config<P, Slave, Z>, D, NoneT, T>
embedded_io::Read implementation for Receive SpiFutures in
Slave mode.
 
impl<P, Z, D, T, S> Read for SpiFuture<Config<P, Slave, Z>, D, NoneT, T>
embedded_io::Read implementation for Receive SpiFutures in
Slave mode.
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
 
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§async fn read_exact(
    &mut self,
    buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
 
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl<P, Z, D, R, T, S> Read for SpiFuture<Config<P, Slave, Z>, D, R, T>where
    P: ValidPads,
    Z: Size<Word = u8> + 'static,
    Config<P, Slave, Z>: ValidConfig<Sercom = S>,
    D: Receive,
    S: Sercom,
    R: AnyChannel<Status = ReadyFuture>,
embedded_io::Read implementation for Receive SpiFutures in
Slave mode, using DMA transfers.
 
impl<P, Z, D, R, T, S> Read for SpiFuture<Config<P, Slave, Z>, D, R, T>where
    P: ValidPads,
    Z: Size<Word = u8> + 'static,
    Config<P, Slave, Z>: ValidConfig<Sercom = S>,
    D: Receive,
    S: Sercom,
    R: AnyChannel<Status = ReadyFuture>,
embedded_io::Read implementation for Receive SpiFutures in
Slave mode, using DMA transfers.
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
 
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§async fn read_exact(
    &mut self,
    buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
 
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§impl<P, M, C, S> SpiBus<<C as CharSize>::Word> for SpiFuture<Config<P, M, C>, Duplex>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    DataWidth: AsPrimitive<C::Word>,
    S: Sercom,
 
impl<P, M, C, S> SpiBus<<C as CharSize>::Word> for SpiFuture<Config<P, M, C>, Duplex>where
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth>,
    DataWidth: AsPrimitive<C::Word>,
    S: Sercom,
Source§async fn read(&mut self, words: &mut [C::Word]) -> Result<(), Self::Error>
 
async fn read(&mut self, words: &mut [C::Word]) -> Result<(), Self::Error>
words from the slave. Read moreSource§async fn write(&mut self, words: &[C::Word]) -> Result<(), Self::Error>
 
async fn write(&mut self, words: &[C::Word]) -> Result<(), Self::Error>
words to the slave, ignoring all the incoming words. Read moreSource§async fn transfer(
    &mut self,
    read: &mut [C::Word],
    write: &[C::Word],
) -> Result<(), Self::Error>
 
async fn transfer( &mut self, read: &mut [C::Word], write: &[C::Word], ) -> Result<(), Self::Error>
write is written to the slave on MOSI and
words received on MISO are stored in read. Read moreSource§impl<P, M, C, S, R, T> SpiBus<<C as CharSize>::Word> for SpiFuture<Config<P, M, C>, Duplex, R, T>where
    S: Sercom,
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth> + Beat,
    DataWidth: AsPrimitive<C::Word>,
    R: AnyChannel<Status = ReadyFuture>,
    T: AnyChannel<Status = ReadyFuture>,
 
impl<P, M, C, S, R, T> SpiBus<<C as CharSize>::Word> for SpiFuture<Config<P, M, C>, Duplex, R, T>where
    S: Sercom,
    Config<P, M, C>: ValidConfig<Sercom = S>,
    P: ValidPads,
    M: MasterMode,
    C: Size + 'static,
    C::Word: PrimInt + AsPrimitive<DataWidth> + Beat,
    DataWidth: AsPrimitive<C::Word>,
    R: AnyChannel<Status = ReadyFuture>,
    T: AnyChannel<Status = ReadyFuture>,
Source§async fn read(&mut self, words: &mut [C::Word]) -> Result<(), Self::Error>
 
async fn read(&mut self, words: &mut [C::Word]) -> Result<(), Self::Error>
words from the slave. Read moreSource§async fn write(&mut self, words: &[C::Word]) -> Result<(), Self::Error>
 
async fn write(&mut self, words: &[C::Word]) -> Result<(), Self::Error>
words to the slave, ignoring all the incoming words. Read moreSource§async fn transfer(
    &mut self,
    read: &mut [C::Word],
    write: &[C::Word],
) -> Result<(), Self::Error>
 
async fn transfer( &mut self, read: &mut [C::Word], write: &[C::Word], ) -> Result<(), Self::Error>
write is written to the slave on MOSI and
words received on MISO are stored in read. Read moreSource§impl<P, M, Z, D, R, S> Write for SpiFuture<Config<P, M, Z>, D, R, NoneT>
embedded_io::Write implementation for Transmit SpiFutures in
either Slave or MasterMode.
 
impl<P, M, Z, D, R, S> Write for SpiFuture<Config<P, M, Z>, D, R, NoneT>
embedded_io::Write implementation for Transmit SpiFutures in
either Slave or MasterMode.
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
 
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Source§impl<P, M, Z, D, R, T> Write for SpiFuture<Config<P, M, Z>, D, R, T>where
    P: ValidPads,
    M: OpMode,
    Z: Size<Word = u8> + 'static,
    Config<P, M, Z>: ValidConfig<Sercom: Sercom>,
    D: Transmit,
    T: AnyChannel<Status = ReadyFuture>,
embedded_io::Write implementation for Transmit SpiFutures in
either Slave or MasterMode, using DMA transfers.
 
impl<P, M, Z, D, R, T> Write for SpiFuture<Config<P, M, Z>, D, R, T>where
    P: ValidPads,
    M: OpMode,
    Z: Size<Word = u8> + 'static,
    Config<P, M, Z>: ValidConfig<Sercom: Sercom>,
    D: Transmit,
    T: AnyChannel<Status = ReadyFuture>,
embedded_io::Write implementation for Transmit SpiFutures in
either Slave or MasterMode, using DMA transfers.