esp_hal::dma

Struct Channel

Source
pub struct Channel<'d, M, CH>
where M: Mode, CH: DmaChannel,
{ pub rx: ChannelRx<'d, M, CH>, pub tx: ChannelTx<'d, M, CH>, }
Expand description

DMA Channel

Fields§

§rx: ChannelRx<'d, M, CH>

RX half of the channel

§tx: ChannelTx<'d, M, CH>

TX half of the channel

Implementations§

Source§

impl<CH: DmaChannel, M: Mode> Channel<'_, M, CH>

Source

pub fn runtime_ensure_compatible<P: DmaEligible>( &self, _peripheral: &PeripheralRef<'_, P>, )

Asserts that the channel is compatible with the given peripheral.

Source§

impl<'d, CH> Channel<'d, Blocking, CH>
where CH: DmaChannel,

Source

pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
where CH: DmaChannel,

Sets the interrupt handler for RX and TX interrupts.

Interrupts are not enabled at the peripheral level here.

Source

pub fn listen(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)

Listen for the given interrupts

Source

pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)

Unlisten the given interrupts

Source

pub fn interrupts(&mut self) -> EnumSet<DmaInterrupt>

Gets asserted interrupts

Source

pub fn clear_interrupts(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)

Resets asserted interrupts

Source

pub fn configure(&mut self, burst_mode: bool, priority: DmaPriority)

Configure the channel.

Source

pub fn into_async(self) -> Channel<'d, Async, CH>

Converts a blocking channel to an async channel.

Source§

impl<'d, CH> Channel<'d, Async, CH>
where CH: DmaChannel,

Source

pub fn into_blocking(self) -> Channel<'d, Blocking, CH>

Converts an async channel to a blocking channel.

Trait Implementations§

Source§

impl<'d, CH: DmaChannel> From<Channel<'d, Async, CH>> for Channel<'d, Blocking, CH>

Source§

fn from(channel: Channel<'d, Async, CH>) -> Self

Converts to this type from the input type.
Source§

impl<'d, CH: DmaChannel> From<Channel<'d, Blocking, CH>> for Channel<'d, Async, CH>

Source§

fn from(channel: Channel<'d, Blocking, CH>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'d, M, CH> Freeze for Channel<'d, M, CH>
where <CH as DmaChannel>::Rx: Freeze, <CH as DmaChannel>::Tx: Freeze,

§

impl<'d, M, CH> RefUnwindSafe for Channel<'d, M, CH>

§

impl<'d, M, CH> Send for Channel<'d, M, CH>
where <CH as DmaChannel>::Rx: Send, <CH as DmaChannel>::Tx: Send, CH: Send, M: Send,

§

impl<'d, M, CH> Sync for Channel<'d, M, CH>
where <CH as DmaChannel>::Rx: Sync, <CH as DmaChannel>::Tx: Sync, CH: Sync, M: Sync,

§

impl<'d, M, CH> Unpin for Channel<'d, M, CH>
where <CH as DmaChannel>::Rx: Unpin, <CH as DmaChannel>::Tx: Unpin, CH: Unpin, M: Unpin,

§

impl<'d, M, CH> UnwindSafe for Channel<'d, M, CH>
where <CH as DmaChannel>::Rx: UnwindSafe, <CH as DmaChannel>::Tx: UnwindSafe, CH: UnwindSafe, M: UnwindSafe,

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.