[−][src]Struct gd32vf103_hal::gpio::gpiob::PB4
Pin
Methods
impl<MODE> PB4<Unlocked, MODE> where
MODE: Active,
[src]
MODE: Active,
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Input<Floating>>
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]
self,
ctl0: &mut CTL0,
octl: &mut OCTL
) -> PB4<Unlocked, Input<PullDown>>
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]
self,
ctl0: &mut CTL0,
octl: &mut OCTL
) -> PB4<Unlocked, Input<PullUp>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Output<PushPull>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Output<OpenDrain>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Alternate<PushPull>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Alternate<OpenDrain>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Output<PushPull>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Output<OpenDrain>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Alternate<PushPull>>
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]
self,
ctl0: &mut CTL0
) -> PB4<Unlocked, Alternate<OpenDrain>>
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]
MODE: Active,
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]
MODE: Active,
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
fn set_high(&mut self) -> Result<(), Self::Error>
[src]
fn set_low(&mut self) -> Result<(), Self::Error>
[src]
impl<LOCKED, MODE> OutputPin for PB4<LOCKED, Alternate<MODE>>
[src]
type Error = Infallible
Error type
fn set_high(&mut self) -> Result<(), Self::Error>
[src]
fn set_low(&mut self) -> Result<(), Self::Error>
[src]
impl<LOCKED, MODE> StatefulOutputPin for PB4<LOCKED, Output<MODE>>
[src]
fn is_set_high(&self) -> Result<bool, Self::Error>
[src]
fn is_set_low(&self) -> Result<bool, Self::Error>
[src]
impl<LOCKED, MODE> StatefulOutputPin for PB4<LOCKED, Alternate<MODE>>
[src]
fn is_set_high(&self) -> Result<bool, Self::Error>
[src]
fn is_set_low(&self) -> Result<bool, Self::Error>
[src]
impl<LOCKED, MODE> ToggleableOutputPin for PB4<LOCKED, Output<MODE>>
[src]
impl<LOCKED, MODE> ToggleableOutputPin for PB4<LOCKED, Alternate<MODE>>
[src]
impl<LOCKED, MODE> InputPin for PB4<LOCKED, Input<MODE>>
[src]
type Error = Infallible
Error type
fn is_high(&self) -> Result<bool, Self::Error>
[src]
fn is_low(&self) -> Result<bool, Self::Error>
[src]
impl<LOCKED> InputPin for PB4<LOCKED, Output<OpenDrain>>
[src]
Auto Trait Implementations
impl<LOCKED, MODE> Unpin for PB4<LOCKED, MODE> where
LOCKED: Unpin,
MODE: Unpin,
LOCKED: Unpin,
MODE: Unpin,
impl<LOCKED, MODE> Send for PB4<LOCKED, MODE> where
LOCKED: Send,
MODE: Send,
LOCKED: Send,
MODE: Send,
impl<LOCKED, MODE> Sync for PB4<LOCKED, MODE> where
LOCKED: Sync,
MODE: Sync,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> OutputPin for T where
T: OutputPin,
[src]
T: OutputPin,
type Error = ()
Error type
fn set_low(&mut self) -> Result<(), <T as OutputPin>::Error>
[src]
fn set_high(&mut self) -> Result<(), <T as OutputPin>::Error>
[src]
impl<T> StatefulOutputPin for T where
T: StatefulOutputPin + OutputPin,
[src]
T: StatefulOutputPin + OutputPin,
fn is_set_low(&self) -> Result<bool, <T as OutputPin>::Error>
[src]
fn is_set_high(&self) -> Result<bool, <T as OutputPin>::Error>
[src]
impl<P> ToggleableOutputPin for P where
P: Default,
[src]
P: Default,
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]
T: InputPin,