Struct DmaChannel

Source
pub struct DmaChannel<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> DmaChannel<'a>

Source

pub fn new(chan_nr: usize) -> DmaChannel<'a>

Source

pub fn set_client(&self, client: &'a dyn DmaClient)

Source

pub fn initialize(&self, config: &DmaConfig)

Source

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

Source

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

Source

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

Source

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

Source

pub fn provide_new_buffer(&self, buf: &'static mut [u8], len: usize)

Provide a new buffer for a ping-pong transfer

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.