Struct embassy_stm32::dma::Transfer
source · pub struct Transfer<'a, C: Channel> { /* private fields */ }
Expand description
DMA transfer.
Implementations§
source§impl<'a, C: Channel> Transfer<'a, C>
impl<'a, C: Channel> Transfer<'a, C>
sourcepub unsafe fn new_read<W: Word>(
channel: impl Peripheral<P = C> + '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 = C> + '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 = C> + '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 = C> + '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 = C> + 'a,
request: Request,
buf: &'a [W],
peri_addr: *mut W,
options: TransferOptions
) -> Self
pub unsafe fn new_write<W: Word>( channel: impl Peripheral<P = C> + '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 = C> + '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 = C> + '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 = C> + '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 = C> + '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
Get the total remaining transfers for the channel.
This will be zero for transfers that completed instead of being canceled with request_stop
.
sourcepub fn blocking_wait(self)
pub fn blocking_wait(self)
Blocking wait until the transfer finishes.
Trait Implementations§
impl<'a, C: Channel> Unpin for Transfer<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for Transfer<'a, C>where
C: Freeze,
impl<'a, C> RefUnwindSafe for Transfer<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for Transfer<'a, C>where
C: Send,
impl<'a, C> Sync for Transfer<'a, C>where
C: Sync,
impl<'a, C> !UnwindSafe for Transfer<'a, C>
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
>.