Struct gd32vf103_hal::gpio::gpiob::PB2[][src]

pub struct PB2<MODE> { /* fields omitted */ }

Pin

Implementations

impl<MODE> PB2<MODE> where
    MODE: Active
[src]

pub fn into_analog(self, ctl0: &mut CTL0) -> PB2<Analog>[src]

Configures the pin to serve as an analog input pin.

pub fn into_floating_input(self, ctl0: &mut CTL0) -> PB2<Input<Floating>>[src]

Configures the pin to serve as a floating input pin.

pub fn into_pull_down_input(
    self,
    ctl0: &mut CTL0,
    octl: &mut OCTL
) -> PB2<Input<PullDown>>
[src]

Configures the pin to serve as a pull down input pin.

pub fn into_pull_up_input(
    self,
    ctl0: &mut CTL0,
    octl: &mut OCTL
) -> PB2<Input<PullUp>>
[src]

Configures the pin to serve as a pull up input pin.

pub fn into_push_pull_output(self, ctl0: &mut CTL0) -> PB2<Output<PushPull>>[src]

Configures the pin to serve as a push pull output pin; the maximum speed is set to the default value 50MHz.

pub fn into_open_drain_output(self, ctl0: &mut CTL0) -> PB2<Output<OpenDrain>>[src]

Configures the pin to serve as an open drain output pin; the maximum speed is set to the default value 50MHz.

pub fn into_alternate_push_pull(
    self,
    ctl0: &mut CTL0
) -> PB2<Alternate<PushPull>>
[src]

Configures the pin to serve as a push pull alternate pin; the maximum speed is set to the default value 50MHz.

pub fn into_alternate_open_drain(
    self,
    ctl0: &mut CTL0
) -> PB2<Alternate<OpenDrain>>
[src]

Configures the pin to serve as an open drain alternate pin; the maximum speed is set to the default value 50MHz.

pub fn into_push_pull_output_speed<SPEED: Speed>(
    self,
    ctl0: &mut CTL0
) -> PB2<Output<PushPull>>
[src]

Configures the pin to serve as a push pull output pin with maximum speed given.

pub fn into_open_drain_output_speed<SPEED: Speed>(
    self,
    ctl0: &mut CTL0
) -> PB2<Output<OpenDrain>>
[src]

Configures the pin to serve as an open drain output pin with maximum speed given.

pub fn into_alternate_push_pull_speed<SPEED: Speed>(
    self,
    ctl0: &mut CTL0
) -> PB2<Alternate<PushPull>>
[src]

Configures the pin to serve as a push pull alternate pin with maximum speed given

pub fn into_alternate_open_drain_speed<SPEED: Speed>(
    self,
    ctl0: &mut CTL0
) -> PB2<Alternate<OpenDrain>>
[src]

Configures the pin to serve as an open drain alternate pin with maximum speed given.

pub fn lock(self, lock: &mut LOCK) -> Locked<PB2<MODE>>[src]

Lock the pin to prevent further configurations on pin mode.

After this function is called, the pin is not actually locked; it only sets a marker temporary variant to prepare for the real lock freezing procedure freeze. To actually perform the lock, users are encouraged to call freeze after all pins configured and marked properly for lock.

The output state of this pin can still be changed. You may unlock locked pins by using unlock method with a mutable reference of LOCK struct, but it will not be possible if freeze method of LOCK struct was called; see its documentation for details.

impl<MODE> PB2<MODE> where
    MODE: Active
[src]

pub fn downgrade(self) -> PBx<MODE>[src]

Erases the pin number from the type.

This is useful when you want to collect the pins into an array where you need all the elements to have the same type.

Trait Implementations

impl<MODE> InputPin for PB2<Input<MODE>>[src]

type Error = Infallible

Error type

impl InputPin for PB2<Output<OpenDrain>>[src]

type Error = Infallible

Error type

impl<MODE> OutputPin for PB2<Output<MODE>>[src]

type Error = Infallible

Error type

impl<MODE> OutputPin for PB2<Alternate<MODE>>[src]

type Error = Infallible

Error type

impl<MODE> StatefulOutputPin for PB2<Output<MODE>>[src]

impl<MODE> StatefulOutputPin for PB2<Alternate<MODE>>[src]

impl<MODE> ToggleableOutputPin for PB2<Output<MODE>>[src]

type Error = Infallible

Error type

impl<MODE> ToggleableOutputPin for PB2<Alternate<MODE>>[src]

type Error = Infallible

Error type

Auto Trait Implementations

impl<MODE> Send for PB2<MODE> where
    MODE: Send

impl<MODE> Sync for PB2<MODE> where
    MODE: Sync

impl<MODE> Unpin for PB2<MODE> where
    MODE: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.