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.
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
>.