pub struct Transfer<const N: u8, P, BUF>{ /* private fields */ }Expand description
A DMA transfer in progress, started by Channel::write_to or
read_from.
Owns the channel, the peripheral and the buffer for as long as the transfer
runs; wait is the only way to get them back.
Dropping instead of waiting stops the transfer and loses all three parts.
Implementations§
Source§impl<const N: u8, P, BUF> Transfer<N, P, BUF>
impl<const N: u8, P, BUF> Transfer<N, P, BUF>
Sourcepub fn wait(self) -> (Channel<N>, P, BUF)
pub fn wait(self) -> (Channel<N>, P, BUF)
Blocks until the transfer completes, then returns the channel, the peripheral and the buffer.
Does not check ERRIF: every address this API can hand a channel comes
from a typed source, so a bus error is unreachable through safe code.
Sourcepub fn remaining(&self) -> u16
pub fn remaining(&self) -> u16
How many transfers the channel has left, without waiting for it.
Counts transfers, not bytes: at Width::Bits16 a unit is two bytes on
the wire. A snapshot only — the hardware keeps counting while the caller
looks at it, so it serves progress reporting.
Trait Implementations§
Auto Trait Implementations§
impl<const N: u8, P, BUF> Freeze for Transfer<N, P, BUF>
impl<const N: u8, P, BUF> RefUnwindSafe for Transfer<N, P, BUF>
impl<const N: u8, P, BUF> Send for Transfer<N, P, BUF>
impl<const N: u8, P, BUF> Sync for Transfer<N, P, BUF>
impl<const N: u8, P, BUF> Unpin for Transfer<N, P, BUF>
impl<const N: u8, P, BUF> UnsafeUnpin for Transfer<N, P, BUF>
impl<const N: u8, P, BUF> UnwindSafe for Transfer<N, P, BUF>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more