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

pub struct PB4<LOCKED, MODE> { /* fields omitted */ }

Pin

Methods

impl<MODE> PB4<Unlocked, MODE> where
    MODE: Active
[src]

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

Configures the pin to serve as an analog input pin.

pub fn into_floating_input(
    self,
    ctl0: &mut CTL0
) -> PB4<Unlocked, 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
) -> PB4<Unlocked, 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
) -> PB4<Unlocked, Input<PullUp>>
[src]

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

pub fn into_push_pull_output(
    self,
    ctl0: &mut CTL0
) -> PB4<Unlocked, 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
) -> PB4<Unlocked, 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_push_pull_alternate(
    self,
    ctl0: &mut CTL0
) -> PB4<Unlocked, 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_open_drain_alternate(
    self,
    ctl0: &mut CTL0
) -> PB4<Unlocked, 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
) -> PB4<Unlocked, 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
) -> PB4<Unlocked, Output<OpenDrain>>
[src]

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

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

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

pub fn into_open_drain_alternate_speed<SPEED: Speed>(
    self,
    ctl0: &mut CTL0
) -> PB4<Unlocked, 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) -> PB4<Locked, MODE>[src]

Lock the pin to prevent further configurations on pin mode.

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 lock_all_pins method of LOCK struct was called; see its documentation for details.

impl<MODE> PB4<Locked, MODE> where
    MODE: Active
[src]

pub fn unlock(self, lock: &mut LOCK) -> PB4<Unlocked, MODE>[src]

Unlock this locked pin to allow configurations of pin mode.

You don't need to unlock pins if you only want to change output state other than reconfigurate the pin mode. The caller of this method must obtain a mutable reference of LOCK struct; if you have called the lock_all_pins method of that struct, you would be no longer possible to change lock state or unlock any locked pins - see its documentation for details.

impl<LOCKED, MODE> PB4<LOCKED, MODE> where
    MODE: Active
[src]

pub fn downgrade(self) -> PBx<LOCKED, 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<LOCKED, MODE> OutputPin for PB4<LOCKED, Output<MODE>>[src]

type Error = Infallible

Error type

impl<LOCKED, MODE> OutputPin for PB4<LOCKED, Alternate<MODE>>[src]

type Error = Infallible

Error type

impl<LOCKED, MODE> StatefulOutputPin for PB4<LOCKED, Output<MODE>>[src]

impl<LOCKED, MODE> StatefulOutputPin for PB4<LOCKED, Alternate<MODE>>[src]

impl<LOCKED, MODE> ToggleableOutputPin for PB4<LOCKED, Output<MODE>>[src]

type Error = Infallible

Error type

impl<LOCKED, MODE> ToggleableOutputPin for PB4<LOCKED, Alternate<MODE>>[src]

type Error = Infallible

Error type

impl<LOCKED, MODE> InputPin for PB4<LOCKED, Input<MODE>>[src]

type Error = Infallible

Error type

impl<LOCKED> InputPin for PB4<LOCKED, Output<OpenDrain>>[src]

type Error = Infallible

Error type

Auto Trait Implementations

impl<LOCKED, MODE> Unpin for PB4<LOCKED, MODE> where
    LOCKED: Unpin,
    MODE: Unpin

impl<LOCKED, MODE> Send for PB4<LOCKED, MODE> where
    LOCKED: Send,
    MODE: Send

impl<LOCKED, MODE> Sync for PB4<LOCKED, MODE> where
    LOCKED: Sync,
    MODE: Sync

Blanket Implementations

impl<T> From<T> for 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> Into<U> for T where
    U: From<T>, 
[src]

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.

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

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

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

impl<T> OutputPin for T where
    T: OutputPin
[src]

type Error = ()

Error type

impl<T> StatefulOutputPin for T where
    T: StatefulOutputPin + OutputPin
[src]

impl<P> ToggleableOutputPin for P where
    P: Default
[src]

type Error = <P as OutputPin>::Error

Error type

fn toggle(&mut self) -> Result<(), <P as ToggleableOutputPin>::Error>[src]

Toggle pin output

impl<T> InputPin for T where
    T: InputPin
[src]

type Error = ()

Error type