Struct imxrt10xx::dma::DmaChannel

source ·
pub struct DmaChannel { /* private fields */ }
Expand description

A DMA channel.

DmaChannel can coordinate the transfer of data between buffers and peripherals without processor intervention.

Implementations§

source§

impl DmaChannel

source

pub fn trigger_manually(&self)

Manually start the DMA transfer.

A manual trigger is useful for memory-to-memory DMA transfers. If you’re sending or receiving data from a peripheral, use trigger_from_hardware().

source

pub fn is_hardware_signaling(&self) -> bool

Returns true is this DMA channel is actively receiving a hardware signal.

A hardware signal comes from an associated peripheral, indicating a request for transfer. It’s important to deassert the hardware before disabling a DMA channel. This gives you an opportunity to check for hardware signal.

Returns false if the DMA channel is disabled, or if there’s no associated hardware (see trigger_from_hardware()).

source

pub fn enable(&self)

Enables this DMA channel.

source

pub fn disable(&self)

Disables this DMA channel.

source

pub fn is_interrupt(&self) -> bool

Returns true if this DMA channel generated an interrupt.

source

pub fn is_complete(&self) -> bool

Returns true if this DMA channel has completed its transfer.

source

pub fn is_error(&self) -> bool

Returns true if this DMA channel is in an error state.

source

pub fn is_active(&self) -> bool

Returns true if this DMA channel is in an active transfer.

source

pub unsafe fn set_source_buffer<T: DmaElement>(&self, buffer: &[T])

Set a buffer of data as the source of a DMA transfer.

Safety: caller is responsible for ensuring the buffer’s lifetime is valid for the life of the transfer.

source

pub unsafe fn set_destination_buffer<T: DmaElement>(&self, buffer: &mut [T])

Set a buffer of data as the destination of a DMA receive.

Safety: caller is responsible for ensuring the buffer’s lifetime is valid for the life of the transfer.

source

pub unsafe fn set_source<T: DmaElement>(&self, source: *const T)

Set the source of a DMA transfer.

Use set_source if the transfer source is a peripheral register.

Safety: caller responsible for ensuring pointer’s lifetime is valid for the transfer.

source

pub unsafe fn set_destination<T: DmaElement>(&self, dest: *const T)

Set the destination of a DMA transfer.

Use set_destination if the tranfer destination is a peripheral register.

Safety: caller responsible for ensuring pointer’s lifetime is valid for the transfer.

source

pub fn set_disable_on_completion(&self, dreq: bool)

Configures the DMA channel to automatically disable when the transfer completes.

source

pub fn set_interrupt_on_completion(&self, intr: bool)

Configures the DMA channel to interrupt when complete, or when there is an error.

source

pub fn handle_interrupt(&self)

Handle an interrupt.

Assumes that the caller knows that this DMA channel was the source of the interrupt, or the cause of a DMA error. See is_interrupt() and is_error(). The implementation panics if there is neither an error, or an interrupt.

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> SizedTypeProperties for T

source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
source§

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

§

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>,

§

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.