Skip to main content

DmaSource

Struct DmaSource 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.
Source§

fn source_signal(&self) -> u32

Peripheral source request signal Read more
Source§

fn source_address(&self) -> *const u16

Returns a pointer to the register from which the DMA channel reads data Read more
Source§

fn enable_source(&mut self)

Perform any actions necessary to enable DMA transfers Read more
Source§

fn disable_source(&mut self)

Perform any actions necessary to disable or cancel DMA transfers Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.