Struct embassy_stm32::gpio::AnyPin

source ·
pub struct AnyPin { /* private fields */ }
Expand description

Type-erased GPIO pin

Implementations§

source§

impl AnyPin

source

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

Unsafely create an AnyPin from a pin+port number.

pin_port is port_num * 16 + pin_num, where port_num is 0 for port A, 1 for port B, etc…

source

pub fn block(&self) -> Gpio

Get the GPIO register block for this pin.

Trait Implementations§

source§

impl From<PA0> for AnyPin

source§

fn from(x: PA0) -> Self

Converts to this type from the input type.
source§

impl From<PA1> for AnyPin

source§

fn from(x: PA1) -> Self

Converts to this type from the input type.
source§

impl From<PA10> for AnyPin

source§

fn from(x: PA10) -> Self

Converts to this type from the input type.
source§

impl From<PA11> for AnyPin

source§

fn from(x: PA11) -> Self

Converts to this type from the input type.
source§

impl From<PA12> for AnyPin

source§

fn from(x: PA12) -> Self

Converts to this type from the input type.
source§

impl From<PA13> for AnyPin

source§

fn from(x: PA13) -> Self

Converts to this type from the input type.
source§

impl From<PA14> for AnyPin

source§

fn from(x: PA14) -> Self

Converts to this type from the input type.
source§

impl From<PA15> for AnyPin

source§

fn from(x: PA15) -> Self

Converts to this type from the input type.
source§

impl From<PA2> for AnyPin

source§

fn from(x: PA2) -> Self

Converts to this type from the input type.
source§

impl From<PA3> for AnyPin

source§

fn from(x: PA3) -> Self

Converts to this type from the input type.
source§

impl From<PA4> for AnyPin

source§

fn from(x: PA4) -> Self

Converts to this type from the input type.
source§

impl From<PA5> for AnyPin

source§

fn from(x: PA5) -> Self

Converts to this type from the input type.
source§

impl From<PA6> for AnyPin

source§

fn from(x: PA6) -> Self

Converts to this type from the input type.
source§

impl From<PA7> for AnyPin

source§

fn from(x: PA7) -> Self

Converts to this type from the input type.
source§

impl From<PA8> for AnyPin

source§

fn from(x: PA8) -> Self

Converts to this type from the input type.
source§

impl From<PA9> for AnyPin

source§

fn from(x: PA9) -> Self

Converts to this type from the input type.
source§

impl From<PB0> for AnyPin

source§

fn from(x: PB0) -> Self

Converts to this type from the input type.
source§

impl From<PB1> for AnyPin

source§

fn from(x: PB1) -> Self

Converts to this type from the input type.
source§

impl From<PB10> for AnyPin

source§

fn from(x: PB10) -> Self

Converts to this type from the input type.
source§

impl From<PB11> for AnyPin

source§

fn from(x: PB11) -> Self

Converts to this type from the input type.
source§

impl From<PB12> for AnyPin

source§

fn from(x: PB12) -> Self

Converts to this type from the input type.
source§

impl From<PB13> for AnyPin

source§

fn from(x: PB13) -> Self

Converts to this type from the input type.
source§

impl From<PB14> for AnyPin

source§

fn from(x: PB14) -> Self

Converts to this type from the input type.
source§

impl From<PB15> for AnyPin

source§

fn from(x: PB15) -> Self

Converts to this type from the input type.
source§

impl From<PB2> for AnyPin

source§

fn from(x: PB2) -> Self

Converts to this type from the input type.
source§

impl From<PB3> for AnyPin

source§

fn from(x: PB3) -> Self

Converts to this type from the input type.
source§

impl From<PB4> for AnyPin

source§

fn from(x: PB4) -> Self

Converts to this type from the input type.
source§

impl From<PB5> for AnyPin

source§

fn from(x: PB5) -> Self

Converts to this type from the input type.
source§

impl From<PB6> for AnyPin

source§

fn from(x: PB6) -> Self

Converts to this type from the input type.
source§

impl From<PB7> for AnyPin

source§

fn from(x: PB7) -> Self

Converts to this type from the input type.
source§

impl From<PB8> for AnyPin

source§

fn from(x: PB8) -> Self

Converts to this type from the input type.
source§

impl From<PB9> for AnyPin

source§

fn from(x: PB9) -> Self

Converts to this type from the input type.
source§

impl From<PC0> for AnyPin

source§

fn from(x: PC0) -> Self

Converts to this type from the input type.
source§

impl From<PC1> for AnyPin

source§

fn from(x: PC1) -> Self

Converts to this type from the input type.
source§

impl From<PC10> for AnyPin

source§

fn from(x: PC10) -> Self

Converts to this type from the input type.
source§

impl From<PC11> for AnyPin

source§

fn from(x: PC11) -> Self

Converts to this type from the input type.
source§

impl From<PC12> for AnyPin

source§

fn from(x: PC12) -> Self

Converts to this type from the input type.
source§

impl From<PC13> for AnyPin

source§

fn from(x: PC13) -> Self

Converts to this type from the input type.
source§

impl From<PC14> for AnyPin

source§

fn from(x: PC14) -> Self

Converts to this type from the input type.
source§

impl From<PC15> for AnyPin

source§

fn from(x: PC15) -> Self

Converts to this type from the input type.
source§

impl From<PC2> for AnyPin

source§

fn from(x: PC2) -> Self

Converts to this type from the input type.
source§

impl From<PC3> for AnyPin

source§

fn from(x: PC3) -> Self

Converts to this type from the input type.
source§

impl From<PC4> for AnyPin

source§

fn from(x: PC4) -> Self

Converts to this type from the input type.
source§

impl From<PC5> for AnyPin

source§

fn from(x: PC5) -> Self

Converts to this type from the input type.
source§

impl From<PC6> for AnyPin

source§

fn from(x: PC6) -> Self

Converts to this type from the input type.
source§

impl From<PC7> for AnyPin

source§

fn from(x: PC7) -> Self

Converts to this type from the input type.
source§

impl From<PC8> for AnyPin

source§

fn from(x: PC8) -> Self

Converts to this type from the input type.
source§

impl From<PC9> for AnyPin

source§

fn from(x: PC9) -> Self

Converts to this type from the input type.
source§

impl From<PD0> for AnyPin

source§

fn from(x: PD0) -> Self

Converts to this type from the input type.
source§

impl From<PD1> for AnyPin

source§

fn from(x: PD1) -> Self

Converts to this type from the input type.
source§

impl From<PD10> for AnyPin

source§

fn from(x: PD10) -> Self

Converts to this type from the input type.
source§

impl From<PD11> for AnyPin

source§

fn from(x: PD11) -> Self

Converts to this type from the input type.
source§

impl From<PD12> for AnyPin

source§

fn from(x: PD12) -> Self

Converts to this type from the input type.
source§

impl From<PD13> for AnyPin

source§

fn from(x: PD13) -> Self

Converts to this type from the input type.
source§

impl From<PD14> for AnyPin

source§

fn from(x: PD14) -> Self

Converts to this type from the input type.
source§

impl From<PD15> for AnyPin

source§

fn from(x: PD15) -> Self

Converts to this type from the input type.
source§

impl From<PD2> for AnyPin

source§

fn from(x: PD2) -> Self

Converts to this type from the input type.
source§

impl From<PD3> for AnyPin

source§

fn from(x: PD3) -> Self

Converts to this type from the input type.
source§

impl From<PD4> for AnyPin

source§

fn from(x: PD4) -> Self

Converts to this type from the input type.
source§

impl From<PD5> for AnyPin

source§

fn from(x: PD5) -> Self

Converts to this type from the input type.
source§

impl From<PD6> for AnyPin

source§

fn from(x: PD6) -> Self

Converts to this type from the input type.
source§

impl From<PD7> for AnyPin

source§

fn from(x: PD7) -> Self

Converts to this type from the input type.
source§

impl From<PD8> for AnyPin

source§

fn from(x: PD8) -> Self

Converts to this type from the input type.
source§

impl From<PD9> for AnyPin

source§

fn from(x: PD9) -> Self

Converts to this type from the input type.
source§

impl From<PE0> for AnyPin

source§

fn from(x: PE0) -> Self

Converts to this type from the input type.
source§

impl From<PE1> for AnyPin

source§

fn from(x: PE1) -> Self

Converts to this type from the input type.
source§

impl From<PE10> for AnyPin

source§

fn from(x: PE10) -> Self

Converts to this type from the input type.
source§

impl From<PE11> for AnyPin

source§

fn from(x: PE11) -> Self

Converts to this type from the input type.
source§

impl From<PE12> for AnyPin

source§

fn from(x: PE12) -> Self

Converts to this type from the input type.
source§

impl From<PE13> for AnyPin

source§

fn from(x: PE13) -> Self

Converts to this type from the input type.
source§

impl From<PE14> for AnyPin

source§

fn from(x: PE14) -> Self

Converts to this type from the input type.
source§

impl From<PE15> for AnyPin

source§

fn from(x: PE15) -> Self

Converts to this type from the input type.
source§

impl From<PE2> for AnyPin

source§

fn from(x: PE2) -> Self

Converts to this type from the input type.
source§

impl From<PE3> for AnyPin

source§

fn from(x: PE3) -> Self

Converts to this type from the input type.
source§

impl From<PE4> for AnyPin

source§

fn from(x: PE4) -> Self

Converts to this type from the input type.
source§

impl From<PE5> for AnyPin

source§

fn from(x: PE5) -> Self

Converts to this type from the input type.
source§

impl From<PE6> for AnyPin

source§

fn from(x: PE6) -> Self

Converts to this type from the input type.
source§

impl From<PE7> for AnyPin

source§

fn from(x: PE7) -> Self

Converts to this type from the input type.
source§

impl From<PE8> for AnyPin

source§

fn from(x: PE8) -> Self

Converts to this type from the input type.
source§

impl From<PE9> for AnyPin

source§

fn from(x: PE9) -> Self

Converts to this type from the input type.
source§

impl Peripheral for AnyPin

§

type P = AnyPin

Peripheral singleton type
source§

unsafe fn clone_unchecked(&self) -> Self::P

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§

impl Pin for AnyPin

§

type ExtiChannel = AnyChannel

EXTI channel assigned to this pin. Read more
source§

fn pin(&self) -> u8

Number of the pin within the port (0..31)
source§

fn port(&self) -> u8

Port of the pin
source§

fn degrade(self) -> AnyPin

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

impl Pin for AnyPin

source§

fn pin_port(&self) -> u8

source§

fn _pin(&self) -> u8

source§

fn _port(&self) -> u8

source§

fn block(&self) -> Gpio

source§

fn set_high(&self)

Set the output as high.
source§

fn set_low(&self)

Set the output as low.
source§

fn set_as_af(&self, af_num: u8, af_type: AFType)

source§

fn set_as_af_pull(&self, _af_num: u8, af_type: AFType, pull: Pull)

source§

fn set_as_analog(&self)

source§

fn set_as_disconnected(&self)

Set the pin as “disconnected”, ie doing nothing and consuming the lowest amount of power possible. Read more
source§

fn set_speed(&self, speed: Speed)

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

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

Performs the conversion.