atsamd_hal::dmac::dma_controller

Struct DmaController

Source
pub struct DmaController<I = NoneT> { /* private fields */ }
Expand description

Initialized DMA Controller

Implementations§

Source§

impl DmaController

Source

pub fn init(dmac: Dmac, _pm: &mut Pm) -> Self

Initialize the DMAC and return a DmaController object useable by Transfer’s. By default, all priority levels are enabled unless subsequently disabled using the level_x_enabled methods.

Source

pub fn free(self, _channels: Channels, _pm: &mut Pm) -> Dmac

Release the DMAC and return the register block.

Note: The Channels struct is consumed by this method. This means that any Channel obtained by split must be moved back into the Channels struct before being able to pass it into free.

Source§

impl<T> DmaController<T>

Source

pub fn enable_levels(&mut self, mask: PriorityLevelMask)

Enable multiple priority levels simultaneously

Source

pub fn disable_levels(&mut self, mask: PriorityLevelMask)

Disable multiple priority levels simultaneously

Source

pub fn round_robin_arbitration(&mut self, mask: RoundRobinMask)

Enable round-robin arbitration for multiple priority levels simultaneously

Source

pub fn static_arbitration(&mut self, mask: RoundRobinMask)

Disable round-robin arbitration (ie, enable static priorities) for multiple priority levels simultaneously

Source

pub fn into_future<I>(self, _interrupts: I) -> DmaController<I>

Use the DmaController in async mode. You are required to provide the struct created by the bind_interrupts macro to prove that the interrupt sources have been correctly configured. This function will automatically enable the relevant NVIC interrupt sources. However, you are required to configure the desired interrupt priorities prior to calling this method. Consult crate::async_hal::interrupts module-level documentation for more information. bind_interrupts.

Source§

impl<I> DmaController<I>

Source

pub fn free(self, _channels: FutureChannels, _pm: &mut Pm) -> Dmac

Release the DMAC and return the register block.

Note: The Channels struct is consumed by this method. This means that any Channel obtained by split must be moved back into the Channels struct before being able to pass it into free.

Source§

impl DmaController

Source

pub fn split(&mut self) -> Channels

Split the DMAC into individual channels

Source§

impl<I> DmaController<I>

Source

pub fn split(&mut self) -> FutureChannels

Split the DMAC into individual channels

Auto Trait Implementations§

§

impl<I> Freeze for DmaController<I>

§

impl<I> RefUnwindSafe for DmaController<I>
where I: RefUnwindSafe,

§

impl<I> Send for DmaController<I>
where I: Send,

§

impl<I = NoneT> !Sync for DmaController<I>

§

impl<I> Unpin for DmaController<I>
where I: Unpin,

§

impl<I> UnwindSafe for DmaController<I>
where I: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.