pub struct Transfer<'a> { /* private fields */ }
Expand description
DMA transfer.
Implementations§
Source§impl<'a> Transfer<'a>
impl<'a> Transfer<'a>
Sourcepub const SOFTWARE_TRIGGER: u8 = 0u8
pub const SOFTWARE_TRIGGER: u8 = 0u8
Software trigger source.
Using this trigger source means that a transfer will start immediately rather than waiting for a hardware event. This can be useful if you want to do a DMA accelerated memcpy.
Sourcepub unsafe fn new_read<SW: Word, DW: Word>(
channel: Peri<'a, impl Channel>,
trigger_source: u8,
src: *mut SW,
dst: &'a mut [DW],
options: TransferOptions,
) -> Result<Self, Error>
pub unsafe fn new_read<SW: Word, DW: Word>( channel: Peri<'a, impl Channel>, trigger_source: u8, src: *mut SW, dst: &'a mut [DW], options: TransferOptions, ) -> Result<Self, Error>
Create a new read DMA transfer.
Sourcepub unsafe fn new_read_raw<SW: Word, DW: Word>(
channel: Peri<'a, impl Channel>,
trigger_source: u8,
src: *mut SW,
dst: *mut [DW],
options: TransferOptions,
) -> Result<Self, Error>
pub unsafe fn new_read_raw<SW: Word, DW: Word>( channel: Peri<'a, impl Channel>, trigger_source: u8, src: *mut SW, dst: *mut [DW], options: TransferOptions, ) -> Result<Self, Error>
Create a new read DMA transfer, using raw pointers.
Sourcepub unsafe fn new_write<SW: Word, DW: Word>(
channel: Peri<'a, impl Channel>,
trigger_source: u8,
src: &'a [SW],
dst: *mut DW,
options: TransferOptions,
) -> Result<Self, Error>
pub unsafe fn new_write<SW: Word, DW: Word>( channel: Peri<'a, impl Channel>, trigger_source: u8, src: &'a [SW], dst: *mut DW, options: TransferOptions, ) -> Result<Self, Error>
Create a new write DMA transfer.
Sourcepub unsafe fn new_write_raw<SW: Word, DW: Word>(
channel: Peri<'a, impl Channel>,
trigger_source: u8,
src: *const [SW],
dst: *mut DW,
options: TransferOptions,
) -> Result<Self, Error>
pub unsafe fn new_write_raw<SW: Word, DW: Word>( channel: Peri<'a, impl Channel>, trigger_source: u8, src: *const [SW], dst: *mut DW, options: TransferOptions, ) -> Result<Self, Error>
Create a new write DMA transfer, using raw pointers.
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 blocking_wait(self)
pub fn blocking_wait(self)
Blocking wait until the transfer finishes.