[][src]Struct samd_dma::Channel

pub struct Channel { /* fields omitted */ }

DMA channel.

This structure represents a DMA channel. Using the start_transfer method, you can setup a DMA transfer transaction. You can also configure the DMA channel properties.

Methods

impl Channel[src]

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

Return the channel ID.

pub fn set_run_standby(&mut self, run_standby: bool)[src]

Configure whether the channel continues to run in standby.

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

Return true if the channel continues to run in standby.

pub fn set_burst_length(&mut self, burst_len: BurstLength)[src]

Configure how many beats are in a burst.

pub fn get_burst_length(&self) -> BurstLength[src]

Get the length of a burst in beats.

pub fn set_trigger_action(&mut self, trig_act: TriggerAction)[src]

Set the trigger action for the channel.

pub fn get_trigger_action(&self) -> TriggerAction[src]

Get the trigger action for the channel.

pub fn set_fifo_threshold(&mut self, fifo_threshold: FifoThreshold)[src]

Set threshold for when destination writes occur.

pub fn get_fifi_threshold(&self) -> FifoThreshold[src]

Get the threshold for when destination writes will occur.

pub fn set_source(&mut self, source: TriggerSource)[src]

Set the source trigger for the DMA Channel.

pub fn get_source(&self) -> TriggerSource[src]

Get the trigger source for the channel.

pub fn set_priority(&mut self, priority: Priority)[src]

Set the priority level of the channel.

pub fn get_priority(&self) -> Priority[src]

Get channel priority level.

pub fn get_first_descriptor(&self) -> &mut TransferDescriptor[src]

Get a mutable reference to the first descriptor for the channel.

pub fn get_interrupt_flags(&self) -> Interrupts[src]

Get the channel's interrupt flags.

pub fn clear_interrupt_flags(&mut self)[src]

Reset the channel's interrupt flags.

pub fn enable_interrupts(&mut self, interrupts: Interrupts)[src]

Enable interrupts for the channel. Any interrupts that are not set will be disabled.

pub fn get_enabled_interrupts(&self) -> Interrupts[src]

Get the set of enabled channel interrupts.

pub fn get_writeback_descriptor(&mut self) -> *mut TransferDescriptor[src]

Read descriptor from the Write-back Address of this channel.

Safety

The write-back address of a DMA channel is volatile, as the DMA engine can change it at any time. As such, reading and writing to this descriptor is unsafe. Act cautiously.

pub fn enable(&mut self)[src]

Enable the DMA channel.

After this call, this channel will be a part of the DMA arbitration scheme (if its corresponding priority level is active), and trigger events will cause the transaction to start from the first descriptor.

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

Return whether the channel is enabled or not.

pub fn reset(&mut self)[src]

Reset the DMA channel. This will set all channel registers to their reset values.

If the channel is still enabled (or is in the process of being disabled), this command will be ignored.

pub fn trigger(&mut self)[src]

Manually trigger the channel.

Interrupt Safety

This method is not interrupt-safe, and could lead to lost updates.

It is the responsibility of the caller to ensure that the call-site is in an interrupt-free section.

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

Suspend the ongoing transaction. Returns true if the command was successfully written, false if another command is ongoing.

This call returns immediately, but the suspend operation won't complete until the ongoing burst transfer completes.

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

Resume the ongoing transaction. Returns true if command was successfully written, false if another command is ongoing.

pub fn disable(&mut self)[src]

Disable the channel. This aborts any ongoing transaction.

This call returns immediately, but the transaction will not be aborted until the ongoing burst transfer completes.

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

Returns true if a transfer is pending on the channel. Returns false if a channel trigger action is completed, a bus error is detected, or the channel is disabled.

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

Returns true if the channel has started a transfer. Returns false if a channel trigger action is started, a bus error is detected, or the channel is disabled.

pub fn poll_status(&mut self) -> Result<WaitResult, TransactionError>[src]

Poll the channel to determine the status of the transaction.

This will read and reset the interrupt flag registers of the channel to determine the status of the channel. Therefore it is expected to be called in the appropriate interrupt vector.

Any non-error state will return Ok(WaitResult). Any errors will be returned as Err(TransactionError).

Auto Trait Implementations

impl !Send for Channel

impl !Sync for Channel

impl Unpin for Channel

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.