pub struct Channel<'d, M: Mode> { /* private fields */ }Expand description
DMA channel driver.
Implementations§
Source§impl<'d> Channel<'d, Blocking>
impl<'d> Channel<'d, Blocking>
Sourcepub unsafe fn new_blocking<T: ChannelInstance>(_ch: Peri<'d, T>) -> Self
pub unsafe fn new_blocking<T: ChannelInstance>(_ch: Peri<'d, T>) -> Self
Create a new DMA channel driver, in blocking mode.
SAFETY: You are responsible for polling/irq setup.
Sourcepub fn new_no_interrupt<T: ChannelInstance>(_ch: Peri<'d, T>) -> Self
pub fn new_no_interrupt<T: ChannelInstance>(_ch: Peri<'d, T>) -> Self
Create a new DMA channel driver, without an interrupt.
Source§impl<'d> Channel<'d, Async>
impl<'d> Channel<'d, Async>
Sourcepub fn new<T: ChannelInstance>(
_ch: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
) -> Self
pub fn new<T: ChannelInstance>( _ch: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self
Create a new DMA channel driver.
Sourcepub unsafe fn read<'a, W: Word>(
&'a mut self,
from: *const W,
to: *mut [W],
dreq: TreqSel,
bswap: bool,
) -> Transfer<'a> ⓘ
pub unsafe fn read<'a, W: Word>( &'a mut self, from: *const W, to: *mut [W], dreq: TreqSel, bswap: bool, ) -> Transfer<'a> ⓘ
DMA read from a peripheral to memory.
SAFETY: Slice must point to a valid location reachable by DMA.
Sourcepub unsafe fn read_discard<'a, W: Word>(
&'a mut self,
from: *mut W,
len: usize,
dreq: TreqSel,
) -> Transfer<'a> ⓘ
pub unsafe fn read_discard<'a, W: Word>( &'a mut self, from: *mut W, len: usize, dreq: TreqSel, ) -> Transfer<'a> ⓘ
Repeatedly read from a peripheral to discard data.
SAFETY: from must point to a valid location reachable by DMA.
Sourcepub unsafe fn write<'a, W: Word>(
&'a mut self,
from: *const [W],
to: *mut W,
dreq: TreqSel,
bswap: bool,
) -> Transfer<'a> ⓘ
pub unsafe fn write<'a, W: Word>( &'a mut self, from: *const [W], to: *mut W, dreq: TreqSel, bswap: bool, ) -> Transfer<'a> ⓘ
DMA write from memory to a peripheral.
SAFETY: Slice must point to a valid location reachable by DMA.
Auto Trait Implementations§
impl<'d, M> Freeze for Channel<'d, M>
impl<'d, M> RefUnwindSafe for Channel<'d, M>
impl<'d, M> Send for Channel<'d, M>
impl<'d, M> Sync for Channel<'d, M>
impl<'d, M> Unpin for Channel<'d, M>
impl<'d, M> UnsafeUnpin for Channel<'d, M>
impl<'d, M> UnwindSafe for Channel<'d, M>
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