Struct embassy_stm32::dma::bdma::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> 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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
§fn map_into<U>(self) -> MapInto<Self, U>
fn map_into<U>(self) -> MapInto<Self, U>
§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
f
. Read more§fn left_future<B>(self) -> Either<Self, B>
fn left_future<B>(self) -> Either<Self, B>
§fn right_future<A>(self) -> Either<A, Self>
fn right_future<A>(self) -> Either<A, Self>
§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
§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>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
§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
>.