Trait imxrt_hal::dma::peripheral::Source
source · 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§
sourcefn source_signal(&self) -> u32
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.
sourcefn source_address(&self) -> *const E
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.
sourcefn enable_source(&mut self)
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.
sourcefn disable_source(&mut self)
fn disable_source(&mut self)
Perform any actions necessary to disable or cancel DMA transfers
This may include undoing the actions in enable_source
.