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
sourceimpl<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.
sourcepub fn stop(&mut self, channel: DmaChannel)
pub fn stop(&mut self, channel: DmaChannel)
Stop DMA.
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. Note that the TransferComplete
interrupt
is enabled automatically, by the cfg_channel
method.
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. Note that the TransferComplete
interrupt
is enabled automatically, by the cfg_channel
method.
todo: Non-H7 version too!
pub fn clear_interrupt(&mut self, channel: DmaChannel, interrupt: DmaInterrupt)
Auto Trait Implementations
impl<D> RefUnwindSafe for Dma<D>where
D: RefUnwindSafe,
impl<D> Send for Dma<D>where
D: Send,
impl<D> Sync for Dma<D>where
D: Sync,
impl<D> Unpin for Dma<D>where
D: Unpin,
impl<D> UnwindSafe for Dma<D>where
D: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more