pub struct DmaChannel<'a> { /* private fields */ }
Implementations§
Source§impl<'a> DmaChannel<'a>
impl<'a> DmaChannel<'a>
pub fn new(chan_nr: usize) -> DmaChannel<'a>
pub fn set_client(&self, client: &'a dyn DmaClient)
pub fn initialize(&self, config: &DmaConfig)
Sourcepub fn transfer_mem_to_mem(
&self,
src_buf: &'static mut [u8],
dst_buf: &'static mut [u8],
len: usize,
)
pub fn transfer_mem_to_mem( &self, src_buf: &'static mut [u8], dst_buf: &'static mut [u8], len: usize, )
Start a DMA transfer where one buffer is copied into another one
Sourcepub fn transfer_periph_to_mem(
&self,
src_reg: *const (),
buf: &'static mut [u8],
len: usize,
)
pub fn transfer_periph_to_mem( &self, src_reg: *const (), buf: &'static mut [u8], len: usize, )
Start a DMA transfer where the contents of any register will be copied into a provided buffer
Sourcepub fn transfer_mem_to_periph(
&self,
dst_reg: *const (),
buf: &'static mut [u8],
len: usize,
)
pub fn transfer_mem_to_periph( &self, dst_reg: *const (), buf: &'static mut [u8], len: usize, )
Start a DMA transfer where the contents of a buffer will be copied into a register
Sourcepub fn transfer_periph_to_mem_pingpong(
&self,
src_reg: *const (),
buf1: &'static mut [u8],
len1: usize,
buf2: &'static mut [u8],
len2: usize,
)
pub fn transfer_periph_to_mem_pingpong( &self, src_reg: *const (), buf1: &'static mut [u8], len1: usize, buf2: &'static mut [u8], len2: usize, )
Start a ping-pong transfer from a peripheral to a certain location in memory
Sourcepub fn provide_new_buffer(&self, buf: &'static mut [u8], len: usize)
pub fn provide_new_buffer(&self, buf: &'static mut [u8], len: usize)
Provide a new buffer for a ping-pong transfer
Sourcepub fn stop(
&self,
) -> (usize, Option<&'static mut [u8]>, Option<&'static mut [u8]>, Option<&'static mut [u8]>, Option<&'static mut [u8]>)
pub fn stop( &self, ) -> (usize, Option<&'static mut [u8]>, Option<&'static mut [u8]>, Option<&'static mut [u8]>, Option<&'static mut [u8]>)
Stop any ongoing DMA transfer
Returnvalues: usize: Number of transferred bytes until the transfer was stopped Option<&’static mut u8>: Option to the primary TX buffer Option<&’static mut u8>: Option to the primary RX buffer Option<&’static mut u8>: Option to the alternate TX buffer Option<&’static mut u8>: Option to the alternate RX buffer
Auto Trait Implementations§
impl<'a> !Freeze for DmaChannel<'a>
impl<'a> !RefUnwindSafe for DmaChannel<'a>
impl<'a> !Send for DmaChannel<'a>
impl<'a> !Sync for DmaChannel<'a>
impl<'a> Unpin for DmaChannel<'a>
impl<'a> !UnwindSafe for DmaChannel<'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
Mutably borrows from an owned value. Read more