pub trait Channel: Channel {
Show 16 methods
// Required methods
fn select_peripheral(&mut self, index: DmaMuxIndex);
fn event_occurred(&self, event: Event) -> bool;
fn clear_event(&mut self, event: Event);
// Provided methods
fn reset(&mut self) { ... }
fn set_peripheral_address(&mut self, address: u32, inc: bool) { ... }
fn set_memory_address(&mut self, address: u32, inc: bool) { ... }
fn set_transfer_length(&mut self, len: u16) { ... }
fn set_word_size(&mut self, wsize: WordSize) { ... }
fn set_priority_level(&mut self, priority: Priority) { ... }
fn set_direction(&mut self, direction: Direction) { ... }
fn set_circular_mode(&mut self, circular: bool) { ... }
fn listen(&mut self, event: Event) { ... }
fn unlisten(&mut self, event: Event) { ... }
fn enable(&mut self) { ... }
fn disable(&mut self) { ... }
fn is_enabled(&self) -> bool { ... }
}
Expand description
Trait implemented by all DMA channels
Required Methods§
Sourcefn select_peripheral(&mut self, index: DmaMuxIndex)
fn select_peripheral(&mut self, index: DmaMuxIndex)
Connects the DMAMUX channel to the peripheral corresponding to index
Sourcefn event_occurred(&self, event: Event) -> bool
fn event_occurred(&self, event: Event) -> bool
Is the interrupt flag for the given event set?
Sourcefn clear_event(&mut self, event: Event)
fn clear_event(&mut self, event: Event)
Clear the interrupt flag for the given event.
Passing Event::Any
clears all interrupt flags.
Note that the the global interrupt flag is not automatically cleared
even when all other flags are cleared. The only way to clear it is to
call this method with Event::Any
.
Provided Methods§
Sourcefn reset(&mut self)
fn reset(&mut self)
Reset the control registers of this channel. This stops any ongoing transfers.
Sourcefn set_peripheral_address(&mut self, address: u32, inc: bool)
fn set_peripheral_address(&mut self, address: u32, inc: bool)
Set the base address of the peripheral data register from/to which the data will be read/written.
Only call this method on disabled channels.
§Panics
Panics if this channel is enabled.
Sourcefn set_memory_address(&mut self, address: u32, inc: bool)
fn set_memory_address(&mut self, address: u32, inc: bool)
Set the base address of the memory area from/to which the data will be read/written.
Only call this method on disabled channels.
§Panics
Panics if this channel is enabled.
Sourcefn set_transfer_length(&mut self, len: u16)
fn set_transfer_length(&mut self, len: u16)
Set the number of words to transfer.
Only call this method on disabled channels.
§Panics
Panics if this channel is enabled.
Sourcefn set_word_size(&mut self, wsize: WordSize)
fn set_word_size(&mut self, wsize: WordSize)
Set the word size.
Sourcefn set_priority_level(&mut self, priority: Priority)
fn set_priority_level(&mut self, priority: Priority)
Set the priority level of this channel
Sourcefn set_direction(&mut self, direction: Direction)
fn set_direction(&mut self, direction: Direction)
Set the transfer direction
Sourcefn set_circular_mode(&mut self, circular: bool)
fn set_circular_mode(&mut self, circular: bool)
Set the circular mode of this channel
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Is there a transfer in progress on this channel?