pub struct AnySpiDmaChannel<'d>(/* private fields */);
Available on crate feature
unstable
only.Expand description
An SPI-compatible type-erased DMA channel.
This struct is a type-erased version of a peripheral singleton. It is useful
for creating arrays of peripherals, or avoiding generics. Peripheral singletons
can be type erased by using their From
implementation.
ⓘ
let any_peripheral = AnySpiDmaChannel::from(peripheral);
Implementations§
Source§impl AnySpiDmaChannel<'_>
impl AnySpiDmaChannel<'_>
Sourcepub unsafe fn clone_unchecked(&self) -> Self
pub unsafe fn clone_unchecked(&self) -> Self
Unsafely clone this peripheral reference.
§Safety
You must ensure that you’re only using one instance of this type at a time.
Sourcepub fn reborrow(&mut self) -> AnySpiDmaChannel<'_>
pub fn reborrow(&mut self) -> AnySpiDmaChannel<'_>
Creates a new peripheral reference with a shorter lifetime.
Use this method if you would like to keep working with the peripheral after you dropped the driver that consumes this.
Trait Implementations§
Source§impl<'d> Debug for AnySpiDmaChannel<'d>
impl<'d> Debug for AnySpiDmaChannel<'d>
Source§impl<'d> DmaChannel for AnySpiDmaChannel<'d>
impl<'d> DmaChannel for AnySpiDmaChannel<'d>
Source§type Rx = AnySpiDmaRxChannel<'d>
type Rx = AnySpiDmaRxChannel<'d>
A description of the RX half of a DMA Channel.
Source§type Tx = AnySpiDmaTxChannel<'d>
type Tx = AnySpiDmaTxChannel<'d>
A description of the TX half of a DMA Channel.