pub struct Pin<I, M>where
    I: PinId,
    M: PinMode,
{ /* private fields */ }
Expand description

A type-level GPIO pin, parameterized by PinId and PinMode types

Implementations

Convert the pin to the requested PinMode

Disable the pin and set it to float

Disable the pin and set it to pull down

Disable the pin and set it to pull up

Configure the pin to operate as a floating input

Configure the pin to operate as a pulled down input

Configure the pin to operate as a pulled up input

Configure the pin to operate as a floating interrupt

Configure the pin to operate as a pulled down interrupt

Configure the pin to operate as a pulled up interrupt

Configure the pin to operate as a push-pull output

Configure the pin to operate as a readable push pull output

Configure the pin to operate as the corresponding peripheral function.

The type C indicates the desired peripheral function.

Read the current drive strength of the pin.

The drive strength is reset to normal on every change in pin mode.

Set the drive strength for the pin.

The drive strength is reset to normal on every change in pin mode.

Trait Implementations

PinId of the corresponding Pin
PinMode of the corresponding Pin
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt
Configure a pin as a floating external interrupt
Configure a pin as pulled-up external interrupt
Configure a pin as pulled-down external interrupt

Convert from AlternateB to AlternateC

Convert from AlternateB to AlternateD

Convert from AlternateB to AlternateE

Convert from AlternateB to AlternateF

Convert from AlternateB to AlternateG

Convert from AlternateB to AlternateH

Convert from AlternateB to FloatingDisabled

Convert from AlternateB to FloatingInput

Convert from AlternateB to FloatingInterrupt

Convert from AlternateB to PullDownDisabled

Convert from AlternateB to PullDownInput

Convert from AlternateB to PullDownInterrupt

Convert from AlternateB to PullUpDisabled

Convert from AlternateB to PullUpInput

Convert from AlternateB to PullUpInterrupt

Convert from AlternateB to PushPullOutput

Convert from AlternateB to ReadableOutput

Convert from AlternateC to AlternateB

Convert from AlternateC to AlternateD

Convert from AlternateC to AlternateE

Convert from AlternateC to AlternateF

Convert from AlternateC to AlternateG

Convert from AlternateC to AlternateH

Convert from AlternateC to FloatingDisabled

Convert from AlternateC to FloatingInput

Convert from AlternateC to FloatingInterrupt

Convert from AlternateC to PullDownDisabled

Convert from AlternateC to PullDownInput

Convert from AlternateC to PullDownInterrupt

Convert from AlternateC to PullUpDisabled

Convert from AlternateC to PullUpInput

Convert from AlternateC to PullUpInterrupt

Convert from AlternateC to PushPullOutput

Convert from AlternateC to ReadableOutput

Convert from AlternateD to AlternateB

Convert from AlternateD to AlternateC

Convert from AlternateD to AlternateE

Convert from AlternateD to AlternateF

Convert from AlternateD to AlternateG

Convert from AlternateD to AlternateH

Convert from AlternateD to FloatingDisabled

Convert from AlternateD to FloatingInput

Convert from AlternateD to FloatingInterrupt

Convert from AlternateD to PullDownDisabled

Convert from AlternateD to PullDownInput

Convert from AlternateD to PullDownInterrupt

Convert from AlternateD to PullUpDisabled

Convert from AlternateD to PullUpInput

Convert from AlternateD to PullUpInterrupt

Convert from AlternateD to PushPullOutput

Convert from AlternateD to ReadableOutput

Convert from AlternateE to AlternateB

Convert from AlternateE to AlternateC

Convert from AlternateE to AlternateD

Convert from AlternateE to AlternateF

Convert from AlternateE to AlternateG

Convert from AlternateE to AlternateH

Convert from AlternateE to FloatingDisabled

Convert from AlternateE to FloatingInput

Convert from AlternateE to FloatingInterrupt

Convert from AlternateE to PullDownDisabled

Convert from AlternateE to PullDownInput

Convert from AlternateE to PullDownInterrupt

Convert from AlternateE to PullUpDisabled

Convert from AlternateE to PullUpInput

Convert from AlternateE to PullUpInterrupt

Convert from AlternateE to PushPullOutput

Convert from AlternateE to ReadableOutput

Convert from AlternateF to AlternateB

Convert from AlternateF to AlternateC

Convert from AlternateF to AlternateD

Convert from AlternateF to AlternateE

Convert from AlternateF to AlternateG

Convert from AlternateF to AlternateH

Convert from AlternateF to FloatingDisabled

Convert from AlternateF to FloatingInput

Convert from AlternateF to FloatingInterrupt

Convert from AlternateF to PullDownDisabled

Convert from AlternateF to PullDownInput

Convert from AlternateF to PullDownInterrupt

Convert from AlternateF to PullUpDisabled

Convert from AlternateF to PullUpInput

Convert from AlternateF to PullUpInterrupt

Convert from AlternateF to PushPullOutput

Convert from AlternateF to ReadableOutput

Convert from AlternateG to AlternateB

Convert from AlternateG to AlternateC

Convert from AlternateG to AlternateD

Convert from AlternateG to AlternateE

Convert from AlternateG to AlternateF

Convert from AlternateG to AlternateH

Convert from AlternateG to FloatingDisabled

Convert from AlternateG to FloatingInput

Convert from AlternateG to FloatingInterrupt

Convert from AlternateG to PullDownDisabled

Convert from AlternateG to PullDownInput

Convert from AlternateG to PullDownInterrupt

Convert from AlternateG to PullUpDisabled

Convert from AlternateG to PullUpInput

Convert from AlternateG to PullUpInterrupt

Convert from AlternateG to PushPullOutput

Convert from AlternateG to ReadableOutput

Convert from AlternateH to AlternateB

Convert from AlternateH to AlternateC

Convert from AlternateH to AlternateD

Convert from AlternateH to AlternateE

Convert from AlternateH to AlternateF

Convert from AlternateH to AlternateG

Convert from AlternateH to FloatingDisabled

Convert from AlternateH to FloatingInput

Convert from AlternateH to FloatingInterrupt

Convert from AlternateH to PullDownDisabled

Convert from AlternateH to PullDownInput

Convert from AlternateH to PullDownInterrupt

Convert from AlternateH to PullUpDisabled

Convert from AlternateH to PullUpInput

Convert from AlternateH to PullUpInterrupt

Convert from AlternateH to PushPullOutput

Convert from AlternateH to ReadableOutput

Convert from FloatingDisabled to AlternateB

Convert from FloatingDisabled to AlternateC

Convert from FloatingDisabled to AlternateD

Convert from FloatingDisabled to AlternateE

Convert from FloatingDisabled to AlternateF

Convert from FloatingDisabled to AlternateG

Convert from FloatingDisabled to AlternateH

Convert from FloatingDisabled to PullUpInput

Convert from PullDownDisabled to AlternateB

Convert from PullDownDisabled to AlternateC

Convert from PullDownDisabled to AlternateD

Convert from PullDownDisabled to AlternateE

Convert from PullDownDisabled to AlternateF

Convert from PullDownDisabled to AlternateG

Convert from PullDownDisabled to AlternateH

Convert from PullDownDisabled to PullUpInput

Convert from PullUpDisabled to AlternateB

Convert from PullUpDisabled to AlternateC

Convert from PullUpDisabled to AlternateD

Convert from PullUpDisabled to AlternateE

Convert from PullUpDisabled to AlternateF

Convert from PullUpDisabled to AlternateG

Convert from PullUpDisabled to AlternateH

Convert from PullUpDisabled to FloatingInput

Convert from PullUpDisabled to PullDownInput

Convert from PullUpDisabled to PullUpInput

Convert from FloatingInput to AlternateB

Convert from FloatingInput to AlternateC

Convert from FloatingInput to AlternateD

Convert from FloatingInput to AlternateE

Convert from FloatingInput to AlternateF

Convert from FloatingInput to AlternateG

Convert from FloatingInput to AlternateH

Convert from FloatingInput to PullDownInput

Convert from FloatingInput to PullUpDisabled

Convert from FloatingInput to PullUpInput

Convert from FloatingInput to PushPullOutput

Convert from FloatingInput to ReadableOutput

Convert from PullDownInput to AlternateB

Convert from PullDownInput to AlternateC

Convert from PullDownInput to AlternateD

Convert from PullDownInput to AlternateE

Convert from PullDownInput to AlternateF

Convert from PullDownInput to AlternateG

Convert from PullDownInput to AlternateH

Convert from PullDownInput to FloatingInput

Convert from PullDownInput to PullUpDisabled

Convert from PullDownInput to PullUpInput

Convert from PullDownInput to PushPullOutput

Convert from PullDownInput to ReadableOutput

Convert from PullUpInput to AlternateB

Convert from PullUpInput to AlternateC

Convert from PullUpInput to AlternateD

Convert from PullUpInput to AlternateE

Convert from PullUpInput to AlternateF

Convert from PullUpInput to AlternateG

Convert from PullUpInput to AlternateH

Convert from PullUpInput to FloatingDisabled

Convert from PullUpInput to FloatingInput

Convert from PullUpInput to PullDownDisabled

Convert from PullUpInput to PullDownInput

Convert from PullUpInput to PullUpDisabled

Convert from PullUpInput to PullUpInterrupt

Convert from PullUpInput to PushPullOutput

Convert from PullUpInput to ReadableOutput

Convert from FloatingInterrupt to AlternateB

Convert from FloatingInterrupt to AlternateC

Convert from FloatingInterrupt to AlternateD

Convert from FloatingInterrupt to AlternateE

Convert from FloatingInterrupt to AlternateF

Convert from FloatingInterrupt to AlternateG

Convert from FloatingInterrupt to AlternateH

Convert from PullDownInterrupt to AlternateB

Convert from PullDownInterrupt to AlternateC

Convert from PullDownInterrupt to AlternateD

Convert from PullDownInterrupt to AlternateE

Convert from PullDownInterrupt to AlternateF

Convert from PullDownInterrupt to AlternateG

Convert from PullDownInterrupt to AlternateH

Convert from PullUpInterrupt to AlternateB

Convert from PullUpInterrupt to AlternateC

Convert from PullUpInterrupt to AlternateD

Convert from PullUpInterrupt to AlternateE

Convert from PullUpInterrupt to AlternateF

Convert from PullUpInterrupt to AlternateG

Convert from PullUpInterrupt to AlternateH

Convert from PullUpInterrupt to PullUpInput

Erase the type-level information in a Pin and return a value-level DynPin

Convert from PushPullOutput to AlternateB

Convert from PushPullOutput to AlternateC

Convert from PushPullOutput to AlternateD

Convert from PushPullOutput to AlternateE

Convert from PushPullOutput to AlternateF

Convert from PushPullOutput to AlternateG

Convert from PushPullOutput to AlternateH

Convert from PushPullOutput to FloatingInput

Convert from PushPullOutput to PullDownInput

Convert from PushPullOutput to PullUpInput

Convert from ReadableOutput to AlternateB

Convert from ReadableOutput to AlternateC

Convert from ReadableOutput to AlternateD

Convert from ReadableOutput to AlternateE

Convert from ReadableOutput to AlternateF

Convert from ReadableOutput to AlternateG

Convert from ReadableOutput to AlternateH

Convert from ReadableOutput to FloatingInput

Convert from ReadableOutput to PullDownInput

Convert from ReadableOutput to PullUpInput

Error type
Is the input pin high?
Is the input pin low?
Error type
Is the input pin high?
Is the input pin low?
Error type
Is the input pin high?
Is the input pin low?
Error type
Drives the pin high Read more
Drives the pin low Read more
Drives the pin high or low depending on the provided value Read more
Is the pin in drive high mode? Read more
Is the pin in drive low mode? Read more
Error type
Toggle pin output.

Try to recreate a type-level Pin from a value-level DynPin

There is no way for the compiler to know if the conversion will be successful at compile-time. We must verify the conversion at run-time or refuse to perform it.

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
If an SS pin is present, assert it by bringing it low
If an SS pin is present, deassert it by bringing it high

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.