pub struct DmaSource { /* private fields */ }Expand description
Adapter for using an ADC input as a DMA source.
This adapter exposes the lower-level DMA interface. However, you may
find it easier to use the interface available in dma.
Implementations§
Source§impl DmaSource
impl DmaSource
Sourcepub fn new(adc: Adc, input: AnalogInput) -> Self
pub fn new(adc: Adc, input: AnalogInput) -> Self
Create a new DMA source object for a DMA transfer.
The analog input is consumed to extract its channel, but is not stored in the driver.
Sourcepub fn without_pin(adc: Adc, channel: u32) -> Self
pub fn without_pin(adc: Adc, channel: u32) -> Self
Create an ADC DMA source without a configured ADC input.
You’re responsible for configuring the pin as an ADC input.
Sourcepub fn r0(&self) -> *const RORegister<u32>
pub fn r0(&self) -> *const RORegister<u32>
Returns a pointer to the ADC’s R0 register.
You should use this pointer when coordinating a DMA transfer. You’re not expected to explicitly read from this pointer in software.
Sourcepub fn enable_dma(&mut self)
pub fn enable_dma(&mut self)
Enable the ADC’s DMA support.
This is necessary to start a transfer. However, this in itself does not start a DMA transfer.
Sourcepub fn disable_dma(&mut self)
pub fn disable_dma(&mut self)
Disable the ADC’s DMA support.
See the DMA chapter in the reference manual to understand when this should be called in the DMA transfer lifecycle.
Trait Implementations§
Source§impl Source<u16> for DmaSource
Available on chip=imxrt1010 or chip=imxrt1020 or chip=imxrt1060 only.
impl Source<u16> for DmaSource
chip=imxrt1010 or chip=imxrt1020 or chip=imxrt1060 only.