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,
) -> Result<()>
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, ) -> Result<()>
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) -> Result<()>
pub fn stop(&mut self, channel: DmaChannel) -> Result<()>
Stop a DMA transfer, if in progress.
Sourcepub fn clear_interrupt(
&mut self,
channel: DmaChannel,
interrupt: DmaInterrupt,
) -> Result<()>
pub fn clear_interrupt( &mut self, channel: DmaChannel, interrupt: DmaInterrupt, ) -> Result<()>
Clear an interrupt flag.
pub fn transfer_is_complete(&mut self, channel: DmaChannel) -> bool
Sourcepub fn enable_interrupt(
&mut self,
channel: DmaChannel,
interrupt: DmaInterrupt,
) -> Result<()>
pub fn enable_interrupt( &mut self, channel: DmaChannel, interrupt: DmaInterrupt, ) -> Result<()>
Enable a specific type of interrupt.
Sourcepub fn disable_interrupt(
&mut self,
channel: DmaChannel,
interrupt: DmaInterrupt,
) -> Result<()>
pub fn disable_interrupt( &mut self, channel: DmaChannel, interrupt: DmaInterrupt, ) -> Result<()>
Disable a specific type of interrupt. todo: Non-H7 version too!
Methods from Deref<Target = RegisterBlock>§
Sourcepub fn ch(&self, n: usize) -> &CH
pub fn ch(&self, n: usize) -> &CH
0x08..0xa8 - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers
Sourcepub fn ch_iter(&self) -> impl Iterator<Item = &CH>
pub fn ch_iter(&self) -> impl Iterator<Item = &CH>
Iterator for array of: 0x08..0xa8 - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers
Sourcepub fn ch1(&self) -> &CH
pub fn ch1(&self) -> &CH
0x08..0x1c - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers
Sourcepub fn ch2(&self) -> &CH
pub fn ch2(&self) -> &CH
0x1c..0x30 - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers
Sourcepub fn ch3(&self) -> &CH
pub fn ch3(&self) -> &CH
0x30..0x44 - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers
Sourcepub fn ch4(&self) -> &CH
pub fn ch4(&self) -> &CH
0x44..0x58 - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers
Sourcepub fn ch5(&self) -> &CH
pub fn ch5(&self) -> &CH
0x58..0x6c - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers
Sourcepub fn ch6(&self) -> &CH
pub fn ch6(&self) -> &CH
0x6c..0x80 - Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers