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: Peri<'a, impl Channel>,
request: Request,
peri_addr: *mut W,
buf: &'a mut [W],
options: TransferOptions,
) -> Self
pub unsafe fn new_read<W: Word>( channel: Peri<'a, impl Channel>, 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: Peri<'a, impl Channel>,
request: Request,
peri_addr: *mut W,
buf: *mut [W],
options: TransferOptions,
) -> Self
pub unsafe fn new_read_raw<W: Word>( channel: Peri<'a, impl Channel>, 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: Peri<'a, impl Channel>,
request: Request,
buf: &'a [W],
peri_addr: *mut W,
options: TransferOptions,
) -> Self
pub unsafe fn new_write<W: Word>( channel: Peri<'a, impl Channel>, 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: Peri<'a, impl Channel>,
request: Request,
buf: *const [W],
peri_addr: *mut W,
options: TransferOptions,
) -> Self
pub unsafe fn new_write_raw<W: Word>( channel: Peri<'a, impl Channel>, 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: Peri<'a, impl Channel>,
request: Request,
repeated: &'a W,
count: usize,
peri_addr: *mut W,
options: TransferOptions,
) -> Self
pub unsafe fn new_write_repeated<W: Word>( channel: Peri<'a, impl Channel>, 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> !UnwindSafe for Transfer<'a>
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> UnsafeUnpin for Transfer<'a>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for Twhere
T: Future + ?Sized,
impl<T> FutureExt for Twhere
T: Future + ?Sized,
§fn map<U, F>(self, f: F) -> Map<Self, F> ⓘwhere
F: FnOnce(Self::Output) -> U,
Self: Sized,
fn map<U, F>(self, f: F) -> Map<Self, F> ⓘwhere
F: FnOnce(Self::Output) -> U,
Self: Sized,
§fn map_into<U>(self) -> MapInto<Self, U> ⓘwhere
Self::Output: Into<U>,
Self: Sized,
fn map_into<U>(self) -> MapInto<Self, U> ⓘwhere
Self::Output: Into<U>,
Self: Sized,
§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘwhere
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
Self: Sized,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘwhere
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
Self: Sized,
f. Read more§fn left_future<B>(self) -> Either<Self, B> ⓘwhere
B: Future<Output = Self::Output>,
Self: Sized,
fn left_future<B>(self) -> Either<Self, B> ⓘwhere
B: Future<Output = Self::Output>,
Self: Sized,
§fn right_future<A>(self) -> Either<A, Self> ⓘwhere
A: Future<Output = Self::Output>,
Self: Sized,
fn right_future<A>(self) -> Either<A, Self> ⓘwhere
A: Future<Output = Self::Output>,
Self: Sized,
§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
§fn flatten(self) -> Flatten<Self> ⓘwhere
Self::Output: Future,
Self: Sized,
fn flatten(self) -> Flatten<Self> ⓘwhere
Self::Output: Future,
Self: Sized,
§fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
Self: Sized,
fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
Self: Sized,
§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 more§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘwhere
F: FnOnce(&Self::Output),
Self: Sized,
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘwhere
F: FnOnce(&Self::Output),
Self: Sized,
§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 = ()>.§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>.§fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>where
Self: Unpin,
fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>where
Self: Unpin,
Future::poll on Unpin future types.§fn now_or_never(self) -> Option<Self::Output>where
Self: Sized,
fn now_or_never(self) -> Option<Self::Output>where
Self: Sized,
Future::poll. Read more