Skip to main content

AnyDma2dTxChannel

Struct AnyDma2dTxChannel 

Source
pub struct AnyDma2dTxChannel<'d>(/* private fields */);
Available on crate feature unstable only.
Expand description

A DMA2D transmit channel singleton.

A type-erased version of a peripheral singleton. Useful for creating arrays of peripherals, or avoiding generics. Peripheral singletons can be type erased by using their From implementation.

ⓘ
let any_peripheral = AnyDma2dTxChannel::from(peripheral);

§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.

Implementations§

Source§

impl AnyDma2dTxChannel<'_>

Source

pub unsafe fn clone_unchecked(&self) -> Self

Unsafely clone this peripheral reference.

§Safety

The caller must ensure that only one instance of this type is used at a time.

Source

pub fn reborrow(&mut self) -> AnyDma2dTxChannel<'_>

Creates a new peripheral reference with a shorter lifetime.

Use this method to keep working with the peripheral after dropping the driver that consumes this.

See Peripheral singleton section for more information.

Source

pub fn downcast<P>(self) -> Result<P, Self>
where Self: TryInto<P, Error = Self>,

Attempts to downcast the pin into the underlying peripheral instance.

§Example
// let peri0 = peripherals.PERI0;
// let peri1 = peripherals.PERI1;
let any_peri0 = AnyPeripheral::from(peri0);
let any_peri1 = AnyPeripheral::from(peri1);

let uart0 = any_peri0
    .downcast::<PERI0>()
    .expect("This downcast succeeds because AnyPeripheral was created from Peri0");
let uart0 = any_peri1
    .downcast::<PERI0>()
    .expect_err("This AnyPeripheral was created from Peri1, it cannot be downcast to Peri0");

Trait Implementations§

Source§

impl<'d> Debug for AnyDma2dTxChannel<'d>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'d> From<DMA2D_TX_CH0<'d>> for AnyDma2dTxChannel<'d>

Source§

fn from(inner: DMA2D_TX_CH0<'d>) -> Self

Converts to this type from the input type.
Source§

impl<'d> From<DMA2D_TX_CH1<'d>> for AnyDma2dTxChannel<'d>

Source§

fn from(inner: DMA2D_TX_CH1<'d>) -> Self

Converts to this type from the input type.
Source§

impl<'d> From<DMA2D_TX_CH2<'d>> for AnyDma2dTxChannel<'d>

Source§

fn from(inner: DMA2D_TX_CH2<'d>) -> Self

Converts to this type from the input type.
Source§

impl<'d> From<DMA2D_TX_CH3<'d>> for AnyDma2dTxChannel<'d>

Source§

fn from(inner: DMA2D_TX_CH3<'d>) -> Self

Converts to this type from the input type.
Source§

impl<'d> TryFrom<AnyDma2dTxChannel<'d>> for DMA2D_TX_CH0<'d>

Source§

type Error = AnyDma2dTxChannel<'d>

The type returned in the event of a conversion error.
Source§

fn try_from(any: AnyDma2dTxChannel<'d>) -> Result<Self, AnyDma2dTxChannel<'d>>

Performs the conversion.
Source§

impl<'d> TryFrom<AnyDma2dTxChannel<'d>> for DMA2D_TX_CH1<'d>

Source§

type Error = AnyDma2dTxChannel<'d>

The type returned in the event of a conversion error.
Source§

fn try_from(any: AnyDma2dTxChannel<'d>) -> Result<Self, AnyDma2dTxChannel<'d>>

Performs the conversion.
Source§

impl<'d> TryFrom<AnyDma2dTxChannel<'d>> for DMA2D_TX_CH2<'d>

Source§

type Error = AnyDma2dTxChannel<'d>

The type returned in the event of a conversion error.
Source§

fn try_from(any: AnyDma2dTxChannel<'d>) -> Result<Self, AnyDma2dTxChannel<'d>>

Performs the conversion.
Source§

impl<'d> TryFrom<AnyDma2dTxChannel<'d>> for DMA2D_TX_CH3<'d>

Source§

type Error = AnyDma2dTxChannel<'d>

The type returned in the event of a conversion error.
Source§

fn try_from(any: AnyDma2dTxChannel<'d>) -> Result<Self, AnyDma2dTxChannel<'d>>

Performs the conversion.

Auto Trait Implementations§

§

impl<'d> !UnwindSafe for AnyDma2dTxChannel<'d>

§

impl<'d> Forget for AnyDma2dTxChannel<'d>

§

impl<'d> Freeze for AnyDma2dTxChannel<'d>
where PhantomData<&'d mut ()>: Freeze,

§

impl<'d> Move for AnyDma2dTxChannel<'d>

§

impl<'d> RefUnwindSafe for AnyDma2dTxChannel<'d>

§

impl<'d> Send for AnyDma2dTxChannel<'d>

§

impl<'d> Sync for AnyDma2dTxChannel<'d>

§

impl<'d> Unpin for AnyDma2dTxChannel<'d>
where &'d mut (): Unpin,

§

impl<'d> UnsafeUnpin for AnyDma2dTxChannel<'d>
where PhantomData<&'d mut ()>: UnsafeUnpin,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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

Source§

type Output = T

Should always be Self
§

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

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.