pub trait Stream: StreamISR + Sealed {
    const NUMBER: usize;
Show 31 methods fn set_peripheral_address(&mut self, value: u32); fn set_memory_address(&mut self, value: u32); fn get_memory_address(&self) -> u32; fn set_memory_double_buffer_address(&mut self, value: u32); fn get_memory_double_buffer_address(&self) -> u32; fn set_number_of_transfers(&mut self, value: u16); fn get_number_of_transfers() -> u16; unsafe fn enable(&mut self); fn is_enabled() -> bool; fn disable(&mut self); fn set_channel<const C: u8>(&mut self)
    where
        ChannelX<C>: Channel
; fn set_priority(&mut self, priority: Priority); unsafe fn set_memory_size(&mut self, size: u8); unsafe fn set_peripheral_size(&mut self, size: u8); fn set_memory_increment(&mut self, increment: bool); fn set_peripheral_increment(&mut self, increment: bool); fn set_direction<D: Direction>(&mut self, direction: D); fn set_interrupts_enable(
        &mut self,
        transfer_complete: bool,
        half_transfer: bool,
        transfer_error: bool,
        direct_mode_error: bool
    ); fn get_interrupts_enable() -> (bool, bool, bool, bool); fn set_transfer_complete_interrupt_enable(
        &mut self,
        transfer_complete_interrupt: bool
    ); fn set_half_transfer_interrupt_enable(
        &mut self,
        half_transfer_interrupt: bool
    ); fn set_transfer_error_interrupt_enable(
        &mut self,
        transfer_error_interrupt: bool
    ); fn set_direct_mode_error_interrupt_enable(
        &mut self,
        direct_mode_error_interrupt: bool
    ); fn set_fifo_error_interrupt_enable(&mut self, fifo_error_interrupt: bool); fn set_double_buffer(&mut self, double_buffer: bool); fn set_fifo_threshold(&mut self, fifo_threshold: FifoThreshold); fn set_fifo_enable(&mut self, fifo_enable: bool); fn set_memory_burst(&mut self, memory_burst: BurstMode); fn set_peripheral_burst(&mut self, peripheral_burst: BurstMode); fn fifo_level() -> FifoLevel; fn current_buffer() -> CurrentBuffer;
}
Expand description

Trait for DMA streams types.

Required Associated Constants

Number of the register stream.

Required Methods

Set the peripheral address (par) for the DMA stream.

Set the memory address (m0ar) for the DMA stream.

Get the memory address (m0ar) for the DMA stream.

Set the double buffer address (m1ar) for the DMA stream.

Get the double buffer address (m1ar) for the DMA stream.

Set the number of transfers (ndt) for the DMA stream.

Get the number of transfers (ndt) for the DMA stream.

Enable the DMA stream.

Safety

The user must ensure that all registers are properly configured.

Returns the state of the DMA stream.

Disable the DMA stream.

Disabling the stream during an on-going transfer needs to be performed in a certain way to prevent problems if the stream is to be re-enabled shortly after, because of that, this method will also clear all the stream’s interrupt flags if the stream is active.

Set the channel for the (chsel) the DMA stream.

Set the priority (pl) the DMA stream.

Set the memory size (msize) for the DMA stream.

Safety

This must have the same alignment of the buffer used in the transfer. Valid values: * 0 -> byte * 1 -> half word * 2 -> word

Set the peripheral memory size (psize) for the DMA stream.

Safety

This must have the same alignment of the peripheral data used in the transfer. Valid values: * 0 -> byte * 1 -> half word * 2 -> word

Enable/disable memory increment (minc) for the DMA stream.

Enable/disable peripheral increment (pinc) for the DMA stream.

Set the direction (dir) of the DMA stream.

Convenience method to configure the 4 common interrupts for the DMA stream.

Convenience method to get the value of the 4 common interrupts for the DMA stream. The order of the returns are: transfer_complete, half_transfer, transfer_error and direct_mode_error.

Enable/disable the transfer complete interrupt (tcie) of the DMA stream.

Enable/disable the half transfer interrupt (htie) of the DMA stream.

Enable/disable the transfer error interrupt (teie) of the DMA stream.

Enable/disable the direct mode error interrupt (dmeie) of the DMA stream.

Enable/disable the fifo error interrupt (feie) of the DMA stream.

Enable/disable the double buffer (dbm) of the DMA stream.

Set the fifo threshold (fcr.fth) of the DMA stream.

Enable/disable the fifo (dmdis) of the DMA stream.

Set memory burst mode (mburst) of the DMA stream.

Set peripheral burst mode (pburst) of the DMA stream.

Get the current fifo level (fs) of the DMA stream.

Get which buffer is currently in use by the DMA.

Implementors