embassy-stm32

Crates

git

Versions

stm32l072kz

Flavors

embassy_stm32::gpio

Trait Pin

Source
pub trait Pin:
    Peripheral<P = Self>
    + Into<AnyPin>
    + SealedPin
    + Sized
    + 'static {
    type ExtiChannel: Channel;

    // Provided methods
    fn pin(&self) -> u8 { ... }
    fn port(&self) -> u8 { ... }
    fn degrade(self) -> AnyPin { ... }
}
Expand description

GPIO pin trait.

Required Associated Types§

Source

type ExtiChannel: Channel

EXTI channel assigned to this pin.

For example, PC4 uses EXTI4.

Provided Methods§

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.

This converts pin singletons (PA5, PB6, …), which are all different types, into the same type. It is useful for creating arrays of pins, or avoiding generics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§