#[non_exhaustive]pub struct Channel<'d, Dm, CH>where
Dm: DriverMode,
CH: DmaChannel,{
pub rx: ChannelRx<'d, Dm, CH::Rx>,
pub tx: ChannelTx<'d, Dm, CH::Tx>,
}
unstable
only.Expand description
DMA Channel
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.rx: ChannelRx<'d, Dm, CH::Rx>
RX half of the channel
tx: ChannelTx<'d, Dm, CH::Tx>
TX half of the channel
Implementations§
Source§impl<CH: DmaChannel, Dm: DriverMode> Channel<'_, Dm, CH>
impl<CH: DmaChannel, Dm: DriverMode> Channel<'_, Dm, CH>
Sourcepub fn runtime_ensure_compatible<P: DmaEligible>(
&self,
_peripheral: &PeripheralRef<'_, P>,
)
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,
impl<'d, CH> Channel<'d, Blocking, CH>where
CH: DmaChannel,
Sourcepub fn new(channel: impl Peripheral<P = CH>) -> Self
pub fn new(channel: impl Peripheral<P = CH>) -> Self
Creates a new DMA channel driver.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Sets the interrupt handler for RX and TX interrupts.
Interrupts are not enabled at the peripheral level here.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn listen(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)
pub fn listen(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)
Listen for the given interrupts
Sourcepub fn unlisten(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)
pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)
Unlisten the given interrupts
Sourcepub fn interrupts(&mut self) -> EnumSet<DmaInterrupt>
pub fn interrupts(&mut self) -> EnumSet<DmaInterrupt>
Gets asserted interrupts
Sourcepub fn clear_interrupts(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)
pub fn clear_interrupts(&mut self, interrupts: impl Into<EnumSet<DmaInterrupt>>)
Resets asserted interrupts
Sourcepub fn set_priority(&mut self, priority: DmaPriority)
pub fn set_priority(&mut self, priority: DmaPriority)
Configure the channel priorities.
Sourcepub fn into_async(self) -> Channel<'d, Async, CH>
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,
impl<'d, CH> Channel<'d, Async, CH>where
CH: DmaChannel,
Sourcepub fn into_blocking(self) -> Channel<'d, Blocking, CH>
pub fn into_blocking(self) -> Channel<'d, Blocking, CH>
Converts an async channel to a blocking channel.