[][src]Struct samd_dma::DMAController

pub struct DMAController<T: 'static + DmaStorage> { /* fields omitted */ }

DMA system controller.

Used to distribute channels, as well as control higher level operations of the DMA system.

Methods

impl<T: 'static + DmaStorage> DMAController<T>[src]

pub fn init(dmac: DMAC, storage: &'static mut T) -> DMAController<T>[src]

Initialise the DMA Controller with the specified storage.

pub fn disable(&mut self)[src]

Disable all channels and the CRC module. This will abort any ongoing DMA transactions. The DMA system will not be fully disabled until any ongoing burst transfer is completed.

pub fn enable(&mut self)[src]

Enable the DMA system.

pub fn is_enabled(&self) -> bool[src]

Returns true if the DMA system is enabled.

pub fn get_run_while_debug(&self) -> bool[src]

Get the value of the "Run While Debug" setting.

pub fn set_run_while_debug(&mut self, val: bool)[src]

Set the value of the "Run While Debug" setting.

pub fn take_channel<U: Unsigned>(&mut self) -> Option<Channel> where
    U: IsLess<T::Size, Output = True>, 
[src]

Take a DMA channel. If the channel has already been taken or if the ID is not available, None is returned. If you don't call return_channel on this channel, you can never get it back.

This method uses the turbofish syntax to specify the channel ID you wish to take, like so: take_channel::<CH1>().

Safety

Taking the same channel from overlapping interrupt contexts could lead to double channels all the way. This will alias the exclusive references of the base and write-back descriptors corresponding to this channel. The same problem applies when a call to return_channel overlaps with a call to this function for the same channel.

pub fn return_channel(&mut self, channel: Channel)[src]

Return a channel to the controller. This will disable the channel and reset the channel and first transfer descriptor.

Safety

The same interrupt safety issues with take_channel apply here as well.

pub fn enable_priority_level(&mut self, level: Priority)[src]

Allow channels with the corresponding priority level to be part of arbitration.

pub fn diable_priority_level(&mut self, level: Priority)[src]

Deny channels with the corresponding priority level to be a part of arbitration.

pub fn get_priority_qos(&self, level: Priority) -> QoS[src]

Get the Quality of Service guarantee for the specified priority level.

pub fn set_piority_qos(&mut self, level: Priority, qos: QoS)[src]

Set the Quality of Service guarantee for the specified priority level.

pub fn priority_level_enabled(&self, level: Priority) -> bool[src]

Return true if the priority level is enabled.

pub fn set_priority_level_scheduling(&mut self, level: Priority, enable: bool)[src]

Enable or disable round-robin scheduling method for channels of the given priority level. Disabling round-robin scheduling will enable static scheduling.

pub fn get_channel_interrupt_status(&self) -> Channels[src]

Get the interrupt status of all channels.

pub fn get_pending_channels(&self) -> Channels[src]

Get a bitfield of all pending channels.

pub fn get_busy_channels(&self) -> Channels[src]

Get a bitfield of all busy channels.

pub fn get_active_channel(&self) -> u8[src]

Get ID of the last channel to be granted access to the DMA system.

pub fn trigger_channel(&mut self, id: u8)[src]

Send a trigger request to a channel.

If the channel is not in a pending state, the request is ignored.

pub fn get_active_block_transfer_count(&self) -> Option<u16>[src]

Get the block transfer count of the currently active channel, if there is one.

pub fn priority_level_has_request(&self, pri: Priority) -> bool[src]

Return whether the selected priority level has an active request.

pub fn get_lowest_pending_channel_interrupts(&self) -> Option<(u8, Interrupts)>[src]

Get the lowest pending interrupt channel's interrupt flags, if present.

The ID and interrupt flags are returned.

pub fn get_lowest_pending_channel_status(&self) -> Option<(u8, Option<Status>)>[src]

Get the lowest pending interrupt channel's status, if present.

The ID and status are returned.

pub fn get_channel_pending_interrupts(&mut self, id: u8) -> Interrupts[src]

Get the interrupt flags of a particular channel.

pub fn set_channel_pending_interrupts(&mut self, id: u8, int: Interrupts)[src]

Set the interrupt flags of a particular channel.

pub fn get_channel_status(&mut self, id: u8) -> Option<Status>[src]

Get the status of a particular channel.

Auto Trait Implementations

impl<T> Send for DMAController<T> where
    T: Send

impl<T> !Sync for DMAController<T>

impl<T> Unpin for DMAController<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.