pub trait Channel: Channel {
Show 16 methods // Required methods fn is_event_triggered(&self, event: Event) -> bool; fn clear_event(&mut self, event: Event); // Provided methods fn clear_events(&mut self) { ... } fn reset(&mut self) { ... } unsafe fn set_peripheral_address(&mut self, address: u32, inc: Increment) { ... } unsafe fn set_memory_address(&mut self, address: u32, inc: Increment) { ... } fn set_transfer_length(&mut self, len: u16) { ... } fn set_word_size<W>(&mut self) { ... } fn set_priority_level(&mut self, priority: Priority) { ... } fn set_direction(&mut self, direction: Direction) { ... } fn configure_intterupt(&mut self, event: Event, enable: bool) { ... } fn enable_interrupt(&mut self, event: Event) { ... } fn disable_interrupt(&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§

source

fn is_event_triggered(&self, event: Event) -> bool

Is the interrupt flag for the given event set?

source

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§

source

fn clear_events(&mut self)

Clear all interrupt event flags

source

fn reset(&mut self)

Reset the control registers of this channel. This stops any ongoing transfers.

source

unsafe fn set_peripheral_address(&mut self, address: u32, inc: Increment)

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.

Safety

Callers must ensure the given address is the address of a peripheral register that supports DMA.

source

unsafe fn set_memory_address(&mut self, address: u32, inc: Increment)

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.

Safety

Callers must ensure the given address is a valid memory address that will remain valid as long as at is used by DMA.

source

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.

source

fn set_word_size<W>(&mut self)

Set the word size.

Panics

Panics if the word size is not one of 8, 16, or 32 bits.

source

fn set_priority_level(&mut self, priority: Priority)

Set the priority level of this channel

source

fn set_direction(&mut self, direction: Direction)

Set the transfer direction

source

fn configure_intterupt(&mut self, event: Event, enable: bool)

Enable or disable the interrupt for the specified Event.

source

fn enable_interrupt(&mut self, event: Event)

Enable the interrupt for the given Event.

source

fn disable_interrupt(&mut self, event: Event)

Disable the interrupt for the given Event.

source

fn enable(&mut self)

Start a transfer

source

fn disable(&mut self)

Stop the current transfer

source

fn is_enabled(&self) -> bool

Is there a transfer in progress on this channel?

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Channel for stm32f3xx_hal::dma::dma1::C1

source§

impl Channel for stm32f3xx_hal::dma::dma1::C2

source§

impl Channel for stm32f3xx_hal::dma::dma1::C3

source§

impl Channel for stm32f3xx_hal::dma::dma1::C4

source§

impl Channel for stm32f3xx_hal::dma::dma1::C5

source§

impl Channel for C6

source§

impl Channel for C7

source§

impl Channel for stm32f3xx_hal::dma::dma2::C1

source§

impl Channel for stm32f3xx_hal::dma::dma2::C2

source§

impl Channel for stm32f3xx_hal::dma::dma2::C3

source§

impl Channel for stm32f3xx_hal::dma::dma2::C4

source§

impl Channel for stm32f3xx_hal::dma::dma2::C5