Trait stm32wlxx_hal::dma::DmaCh

source ·
pub trait DmaCh: DmaOps {
    const IRQ: Interrupt;

    // Required methods
    fn flags(&self) -> u8;
    fn clear_flags(&mut self, flags: u8);

    // Provided methods
    fn clear_all_flags(&mut self) { ... }
    unsafe fn unmask_irq(&self) { ... }
    fn mask_irq(&self) { ... }
}
Expand description

DMA channel trait.

Required Associated Constants§

source

const IRQ: Interrupt

DMA IRQ number.

Required Methods§

source

fn flags(&self) -> u8

Get the interrupt flags for the DMA channel.

Note: The lower 4 bits of the return value are unused.

Example

Check if the transfer is complete.

use stm32wlxx_hal::dma::{flags, DmaCh};

let xfer_cpl: bool = dma.flags() & flags::XFER_CPL != 0;
source

fn clear_flags(&mut self, flags: u8)

Clear interrupt flags on the DMA channel.

Note: The lower 4 bits of the flags argument are used.

Example

Check and clear all set flags.

use stm32wlxx_hal::dma::{flags, DmaCh};

let flags: u8 = dma.flags();
dma.clear_flags(flags);

Provided Methods§

source

fn clear_all_flags(&mut self)

Clear all interrupt flags on the DMA channel.

source

unsafe fn unmask_irq(&self)

Unmask the DMA interrupt in the NVIC.

Safety

This can break mask-based critical sections.

Cortex-M0+

On the STM32WL5X Cortex-M0+ core the DMA interrupts are not independent (one per channel), and enabling the interrupt for a DMA channel will enable other IRQs in the same group:

  • DMA1 channel 3:1 secure and non-secure interrupt (C2IMR2[2:0])
  • DMA1 channel 7:4 secure and non-secure interrupt (C2IMR2[6:3])
  • DMA2 channel 7:1 secure and non-secure interrupt (C2IMR2[14:8]) DMAMUX1 overrun interrupt (C2IMR2[15])
source

fn mask_irq(&self)

Mask the DMA interrupt in the NVIC.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl DmaCh for Dma1Ch1

source§

const IRQ: Interrupt = irq_num::DMA1_CH1

source§

impl DmaCh for Dma1Ch2

source§

const IRQ: Interrupt = irq_num::DMA1_CH2

source§

impl DmaCh for Dma1Ch3

source§

const IRQ: Interrupt = irq_num::DMA1_CH3

source§

impl DmaCh for Dma1Ch4

source§

const IRQ: Interrupt = irq_num::DMA1_CH4

source§

impl DmaCh for Dma1Ch5

source§

const IRQ: Interrupt = irq_num::DMA1_CH5

source§

impl DmaCh for Dma1Ch6

source§

const IRQ: Interrupt = irq_num::DMA1_CH6

source§

impl DmaCh for Dma1Ch7

source§

const IRQ: Interrupt = irq_num::DMA1_CH7

source§

impl DmaCh for Dma2Ch1

source§

const IRQ: Interrupt = irq_num::DMA2_CH1

source§

impl DmaCh for Dma2Ch2

source§

const IRQ: Interrupt = irq_num::DMA2_CH2

source§

impl DmaCh for Dma2Ch3

source§

const IRQ: Interrupt = irq_num::DMA2_CH3

source§

impl DmaCh for Dma2Ch4

source§

const IRQ: Interrupt = irq_num::DMA2_CH4

source§

impl DmaCh for Dma2Ch5

source§

const IRQ: Interrupt = irq_num::DMA2_CH5

source§

impl DmaCh for Dma2Ch6

source§

const IRQ: Interrupt = irq_num::DMA2_CH6

source§

impl DmaCh for Dma2Ch7

source§

const IRQ: Interrupt = irq_num::DMA2_CH7