Struct stm32_hal2::dma::Dma
source · pub struct Dma<D> {
pub regs: D,
}
Expand description
Represents a Direct Memory Access (DMA) peripheral.
Fields§
§regs: D
Implementations§
source§impl<D> Dma<D>where
D: Deref<Target = RegisterBlock>,
impl<D> Dma<D>where
D: Deref<Target = RegisterBlock>,
sourcepub fn new(regs: D) -> Self
pub fn new(regs: D) -> Self
Initialize a DMA peripheral, including enabling and resetting its RCC peripheral clock.
sourcepub fn cfg_channel(
&mut self,
channel: DmaChannel,
periph_addr: u32,
mem_addr: u32,
num_data: u32,
direction: Direction,
periph_size: DataSize,
mem_size: DataSize,
cfg: ChannelCfg
)
pub fn cfg_channel(
&mut self,
channel: DmaChannel,
periph_addr: u32,
mem_addr: u32,
num_data: u32,
direction: Direction,
periph_size: DataSize,
mem_size: DataSize,
cfg: ChannelCfg
)
Configure a DMA channel. See L4 RM 0394, section 11.4.4. Sets the Transfer Complete interrupt. Note that this fn has been (perhaps) depreciated by the standalone fn.
sourcepub fn stop(&mut self, channel: DmaChannel)
pub fn stop(&mut self, channel: DmaChannel)
Stop a DMA transfer, if in progress.
sourcepub fn clear_interrupt(&mut self, channel: DmaChannel, interrupt: DmaInterrupt)
pub fn clear_interrupt(&mut self, channel: DmaChannel, interrupt: DmaInterrupt)
Clear an interrupt flag.
pub fn transfer_is_complete(&mut self, channel: DmaChannel) -> bool
sourcepub fn enable_interrupt(&mut self, channel: DmaChannel, interrupt: DmaInterrupt)
pub fn enable_interrupt(&mut self, channel: DmaChannel, interrupt: DmaInterrupt)
Enable a specific type of interrupt.
sourcepub fn disable_interrupt(&mut self, channel: DmaChannel, interrupt: DmaInterrupt)
pub fn disable_interrupt(&mut self, channel: DmaChannel, interrupt: DmaInterrupt)
Disable a specific type of interrupt. todo: Non-H7 version too!