Skip to main content

Channel

Struct Channel 

Source
pub struct Channel<'d> { /* private fields */ }
Expand description

DMAC channel.

Implementations§

Source§

impl<'d> Channel<'d>

Source

pub fn new<C: Instance, Int: InterruptType>( channel: Peri<'d, C>, irq: impl Binding<Int, DmacInterruptHandler<C>> + 'd, ) -> Self

Creates a new DMAC driver for a specific channel.

Source

pub fn reborrow(&mut self) -> Channel<'_>

Reborrow the DMA Channel with a shorter lifetime.

Source

pub fn write<W: Word>( &mut self, src: &[W], dest: *mut W, event: InterruptEvent, ) -> Transfer<'_> ⓘ

Configures a DMAC transfer that reads from an address incremented by the specified InterruptEvent and writes to a fixed address. e.g. memory-to-peripheral.

§Arguments
  • src
  • dest
  • event
§Returns

A future that will finish upon completion of the transfer.

Source

pub fn read<W: Word>( &mut self, src: *const W, dest: &mut [W], event: InterruptEvent, ) -> Transfer<'_> ⓘ

Configures a DMAC transfer that reads from a fixed address and writes to an address incremented by the specified InterruptEvent. e.g. peripheral-to-memory.

§Arguments
  • src
  • dest
  • event
§Returns

A future that will finish upon completion of the transfer.

Trait Implementations§

Source§

impl<'d> Drop for Channel<'d>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'d> !UnwindSafe for Channel<'d>

§

impl<'d> Forget for Channel<'d>

§

impl<'d> Freeze for Channel<'d>

§

impl<'d> Move for Channel<'d>

§

impl<'d> RefUnwindSafe for Channel<'d>

§

impl<'d> Send for Channel<'d>

§

impl<'d> Sync for Channel<'d>

§

impl<'d> Unpin for Channel<'d>

§

impl<'d> UnsafeUnpin for Channel<'d>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.