pub struct Transfer<'a> { /* private fields */ }
Expand description
DMA transfer.
Implementations§
source§impl<'a> Transfer<'a>
impl<'a> Transfer<'a>
sourcepub unsafe fn new_read<W: Word>(
channel: impl Peripheral<P = impl Channel> + 'a,
request: Request,
peri_addr: *mut W,
buf: &'a mut [W],
options: TransferOptions,
) -> Self
pub unsafe fn new_read<W: Word>( channel: impl Peripheral<P = impl Channel> + 'a, request: Request, peri_addr: *mut W, buf: &'a mut [W], options: TransferOptions, ) -> Self
Create a new read DMA transfer (peripheral to memory).
sourcepub unsafe fn new_read_raw<W: Word>(
channel: impl Peripheral<P = impl Channel> + 'a,
request: Request,
peri_addr: *mut W,
buf: *mut [W],
options: TransferOptions,
) -> Self
pub unsafe fn new_read_raw<W: Word>( channel: impl Peripheral<P = impl Channel> + 'a, request: Request, peri_addr: *mut W, buf: *mut [W], options: TransferOptions, ) -> Self
Create a new read DMA transfer (peripheral to memory), using raw pointers.
sourcepub unsafe fn new_write<W: Word>(
channel: impl Peripheral<P = impl Channel> + 'a,
request: Request,
buf: &'a [W],
peri_addr: *mut W,
options: TransferOptions,
) -> Self
pub unsafe fn new_write<W: Word>( channel: impl Peripheral<P = impl Channel> + 'a, request: Request, buf: &'a [W], peri_addr: *mut W, options: TransferOptions, ) -> Self
Create a new write DMA transfer (memory to peripheral).
sourcepub unsafe fn new_write_raw<W: Word>(
channel: impl Peripheral<P = impl Channel> + 'a,
request: Request,
buf: *const [W],
peri_addr: *mut W,
options: TransferOptions,
) -> Self
pub unsafe fn new_write_raw<W: Word>( channel: impl Peripheral<P = impl Channel> + 'a, request: Request, buf: *const [W], peri_addr: *mut W, options: TransferOptions, ) -> Self
Create a new write DMA transfer (memory to peripheral), using raw pointers.
sourcepub unsafe fn new_write_repeated<W: Word>(
channel: impl Peripheral<P = impl Channel> + 'a,
request: Request,
repeated: &'a W,
count: usize,
peri_addr: *mut W,
options: TransferOptions,
) -> Self
pub unsafe fn new_write_repeated<W: Word>( channel: impl Peripheral<P = impl Channel> + 'a, request: Request, repeated: &'a W, count: usize, peri_addr: *mut W, options: TransferOptions, ) -> Self
Create a new write DMA transfer (memory to peripheral), writing the same value repeatedly.
sourcepub fn request_stop(&mut self)
pub fn request_stop(&mut self)
Request the transfer to stop.
The configuration for this channel will not be preserved. If you need to restart the transfer
at a later point with the same configuration, see request_pause
instead.
This doesn’t immediately stop the transfer, you have to wait until is_running
returns false.
sourcepub fn request_pause(&mut self)
pub fn request_pause(&mut self)
Request the transfer to pause, keeping the existing configuration for this channel.
To restart the transfer, call start
again.
This doesn’t immediately stop the transfer, you have to wait until is_running
returns false.
sourcepub fn is_running(&mut self) -> bool
pub fn is_running(&mut self) -> bool
Return whether this transfer is still running.
If this returns false
, it can be because either the transfer finished, or
it was requested to stop early with request_stop
.
sourcepub fn get_remaining_transfers(&self) -> u16
pub fn get_remaining_transfers(&self) -> u16
Gets the total remaining transfers for the channel Note: this will be zero for transfers that completed without cancellation.
sourcepub fn blocking_wait(self)
pub fn blocking_wait(self)
Blocking wait until the transfer finishes.
Trait Implementations§
impl<'a> Unpin for Transfer<'a>
Auto Trait Implementations§
impl<'a> Freeze for Transfer<'a>
impl<'a> RefUnwindSafe for Transfer<'a>
impl<'a> Send for Transfer<'a>
impl<'a> Sync for Transfer<'a>
impl<'a> !UnwindSafe for Transfer<'a>
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
source§fn map_into<U>(self) -> MapInto<Self, U>
fn map_into<U>(self) -> MapInto<Self, U>
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
f
. Read moresource§fn left_future<B>(self) -> Either<Self, B>
fn left_future<B>(self) -> Either<Self, B>
source§fn right_future<A>(self) -> Either<A, Self>
fn right_future<A>(self) -> Either<A, Self>
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moresource§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
source§fn unit_error(self) -> UnitError<Self>where
Self: Sized,
fn unit_error(self) -> UnitError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.source§fn never_error(self) -> NeverError<Self>where
Self: Sized,
fn never_error(self) -> NeverError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.