Trait embassy_stm32::gpio::Pin

source ·
pub trait Pin: Peripheral<P = Self> + Into<AnyPin> + Pin + 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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Pin for PA0

source§

impl Pin for PA1

source§

impl Pin for PA2

source§

impl Pin for PA3

source§

impl Pin for PA4

source§

impl Pin for PA5

source§

impl Pin for PA6

source§

impl Pin for PA7

source§

impl Pin for PA8

source§

impl Pin for PA9

source§

impl Pin for PA10

source§

impl Pin for PA11

source§

impl Pin for PA12

source§

impl Pin for PA13

source§

impl Pin for PA14

source§

impl Pin for PA15

source§

impl Pin for PB0

source§

impl Pin for PB1

source§

impl Pin for PB2

source§

impl Pin for PB3

source§

impl Pin for PB4

source§

impl Pin for PB5

source§

impl Pin for PB6

source§

impl Pin for PB7

source§

impl Pin for PB8

source§

impl Pin for PB9

source§

impl Pin for PB10

source§

impl Pin for PB11

source§

impl Pin for PB12

source§

impl Pin for PB13

source§

impl Pin for PB14

source§

impl Pin for PB15

source§

impl Pin for PC0

source§

impl Pin for PC1

source§

impl Pin for PC2

source§

impl Pin for PC3

source§

impl Pin for PC4

source§

impl Pin for PC5

source§

impl Pin for PC6

source§

impl Pin for PC7

source§

impl Pin for PC8

source§

impl Pin for PC9

source§

impl Pin for PC10

source§

impl Pin for PC11

source§

impl Pin for PC12

source§

impl Pin for PC13

source§

impl Pin for PC14

source§

impl Pin for PC15

source§

impl Pin for PD0

source§

impl Pin for PD1

source§

impl Pin for PD2

source§

impl Pin for PD3

source§

impl Pin for PD4

source§

impl Pin for PD5

source§

impl Pin for PD6

source§

impl Pin for PD7

source§

impl Pin for PD8

source§

impl Pin for PD9

source§

impl Pin for PD10

source§

impl Pin for PD11

source§

impl Pin for PD12

source§

impl Pin for PD13

source§

impl Pin for PD14

source§

impl Pin for PD15

source§

impl Pin for PE0

source§

impl Pin for PE1

source§

impl Pin for PE2

source§

impl Pin for PE3

source§

impl Pin for PE4

source§

impl Pin for PE5

source§

impl Pin for PE6

source§

impl Pin for PE7

source§

impl Pin for PE8

source§

impl Pin for PE9

source§

impl Pin for PE10

source§

impl Pin for PE11

source§

impl Pin for PE12

source§

impl Pin for PE13

source§

impl Pin for PE14

source§

impl Pin for PE15

source§

impl Pin for AnyPin