Struct AnyPin

Source
pub struct AnyPin(/* private fields */);
Expand description

Type-erased GPIO pin

Implementations§

Source§

impl AnyPin

Source

pub fn split(self) -> (InputSignal, OutputSignal)

Available on crate feature unstable only.

Split the pin into an input and output signal.

Peripheral signals allow connecting peripherals together without using external hardware.

let pin1 = peripherals.GPIO1.degrade();
let (input, output) = pin1.split();
§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.

Source§

impl AnyPin

Source

pub unsafe fn steal(pin: u8) -> Self

Conjure a new GPIO pin out of thin air.

§Safety

The caller must ensure that only one instance of a pin is in use at one time.

§Panics

Panics if the pin with the given number does not exist.

Trait Implementations§

Source§

impl Debug for AnyPin

Source§

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

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

impl Format for AnyPin

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl From<GpioPin<0>> for AnyPin

Source§

fn from(pin: GpioPin<0>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<1>> for AnyPin

Source§

fn from(pin: GpioPin<1>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<10>> for AnyPin

Source§

fn from(pin: GpioPin<10>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<11>> for AnyPin

Source§

fn from(pin: GpioPin<11>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<12>> for AnyPin

Source§

fn from(pin: GpioPin<12>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<13>> for AnyPin

Source§

fn from(pin: GpioPin<13>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<14>> for AnyPin

Source§

fn from(pin: GpioPin<14>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<15>> for AnyPin

Source§

fn from(pin: GpioPin<15>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<16>> for AnyPin

Source§

fn from(pin: GpioPin<16>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<17>> for AnyPin

Source§

fn from(pin: GpioPin<17>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<18>> for AnyPin

Source§

fn from(pin: GpioPin<18>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<19>> for AnyPin

Source§

fn from(pin: GpioPin<19>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<2>> for AnyPin

Source§

fn from(pin: GpioPin<2>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<20>> for AnyPin

Source§

fn from(pin: GpioPin<20>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<21>> for AnyPin

Source§

fn from(pin: GpioPin<21>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<22>> for AnyPin

Source§

fn from(pin: GpioPin<22>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<23>> for AnyPin

Source§

fn from(pin: GpioPin<23>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<24>> for AnyPin

Source§

fn from(pin: GpioPin<24>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<25>> for AnyPin

Source§

fn from(pin: GpioPin<25>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<26>> for AnyPin

Source§

fn from(pin: GpioPin<26>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<27>> for AnyPin

Source§

fn from(pin: GpioPin<27>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<3>> for AnyPin

Source§

fn from(pin: GpioPin<3>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<4>> for AnyPin

Source§

fn from(pin: GpioPin<4>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<5>> for AnyPin

Source§

fn from(pin: GpioPin<5>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<6>> for AnyPin

Source§

fn from(pin: GpioPin<6>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<7>> for AnyPin

Source§

fn from(pin: GpioPin<7>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<8>> for AnyPin

Source§

fn from(pin: GpioPin<8>) -> Self

Converts to this type from the input type.
Source§

impl From<GpioPin<9>> for AnyPin

Source§

fn from(pin: GpioPin<9>) -> Self

Converts to this type from the input type.
Source§

impl Peripheral for AnyPin

Source§

type P = AnyPin

Peripheral singleton type
Source§

unsafe fn clone_unchecked(&self) -> Self

Unsafely clone (duplicate) a peripheral singleton. Read more
Source§

fn into_ref<'a>(self) -> PeripheralRef<'a, Self::P>
where Self: 'a,

Convert a value into a PeripheralRef. Read more
Source§

fn map_into<U>(self) -> U
where Self::P: Into<U>, U: Peripheral<P = U>,

Map the peripheral using Into. Read more
Source§

fn map<U>(self, transform: impl FnOnce(Self::P) -> U) -> U
where U: Peripheral<P = U>,

Map the peripheral using Into. Read more
Source§

impl Pin for AnyPin

Source§

fn number(&self) -> u8

GPIO number
Source§

fn degrade(self) -> AnyPin
where Self: Sized,

Type-erase (degrade) this pin into an AnyPin. Read more
Source§

impl InputPin for AnyPin

Source§

impl OutputPin for AnyPin

Auto Trait Implementations§

§

impl Freeze for AnyPin

§

impl RefUnwindSafe for AnyPin

§

impl Send for AnyPin

§

impl Sync for AnyPin

§

impl Unpin for AnyPin

§

impl UnwindSafe for AnyPin

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.

§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<P> PeripheralInput for P
where P: InputPin,

Source§

impl<P> PeripheralOutput for P
where P: OutputPin,