pub unsafe trait Source<E>
where E: Element,
{ // Required methods fn source_signal(&self) -> u32; fn source_address(&self) -> *const E; fn enable_source(&mut self); fn disable_source(&mut self); }
Expand description

A peripheral that can be the source of DMA data

By ‘source,’ we mean that it provides data for a DMA transfer. A source would be a hardware device writing data into memory, like a UART receiver.

Safety

Source should only be implemented on peripherals that are DMA capable. This trait should be implemented by HAL authors who are exposing DMA capable peripherals.

Required Methods§

source

fn source_signal(&self) -> u32

Peripheral source request signal

See Table 4-3 of the reference manual. A source may has a qualifier like ‘receive’ in the name.

source

fn source_address(&self) -> *const E

Returns a pointer to the register from which the DMA channel reads data

This is the register that software reads to acquire data from a device. The type of the pointer describes the type of reads the DMA channel performs when transferring data.

This memory is assumed to be static. Repeated source calls should always return the same address.

source

fn enable_source(&mut self)

Perform any actions necessary to enable DMA transfers

Callers use this method to put the peripheral in a state where it can supply the DMA channel with data.

source

fn disable_source(&mut self)

Perform any actions necessary to disable or cancel DMA transfers

This may include undoing the actions in enable_source.

Implementors§

source§

impl<P, const N: u8> Source<u8> for Lpuart<P, N>

source§

impl<P, const N: u8> Source<u16> for DmaSource<P, N>

source§

impl<P, const N: u8> Source<u32> for Lpspi<P, N>