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>
impl<CH: DmaChannel, M: Mode> Channel<'_, M, 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 set_interrupt_handler(&mut self, handler: InterruptHandler)where
CH: DmaChannel,
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.
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 configure(&mut self, burst_mode: bool, priority: DmaPriority)
pub fn configure(&mut self, burst_mode: bool, priority: DmaPriority)
Configure the channel.
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.
Trait Implementations§
Auto Trait Implementations§
impl<'d, M, CH> Freeze for Channel<'d, M, CH>
impl<'d, M, CH> RefUnwindSafe for Channel<'d, M, CH>where
<CH as DmaChannel>::Rx: RefUnwindSafe,
<CH as DmaChannel>::Tx: RefUnwindSafe,
CH: RefUnwindSafe,
M: RefUnwindSafe,
impl<'d, M, CH> Send for Channel<'d, M, CH>
impl<'d, M, CH> Sync for Channel<'d, M, CH>
impl<'d, M, CH> Unpin for Channel<'d, M, CH>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more