pub struct Pin<MODE> {
pub pin: u8,
/* private fields */
}Expand description
Generic $PX pin
Fields§
§pin: u8Implementations§
Source§impl<MODE> Pin<MODE>
impl<MODE> Pin<MODE>
Sourcepub fn into_floating_input(self) -> Pin<Input<Floating>>
pub fn into_floating_input(self) -> Pin<Input<Floating>>
Convert the pin to be a floating input
pub fn into_pullup_input(self) -> Pin<Input<PullUp>>
pub fn into_pulldown_input(self) -> Pin<Input<PullDown>>
Sourcepub fn into_push_pull_output(
self,
initial_output: Level,
) -> Pin<Output<PushPull>>
pub fn into_push_pull_output( self, initial_output: Level, ) -> Pin<Output<PushPull>>
Convert the pin to be a push-pull output with normal drive
Sourcepub fn into_open_drain_output(
self,
config: OpenDrainConfig,
initial_output: Level,
) -> Pin<Output<OpenDrain>>
pub fn into_open_drain_output( self, config: OpenDrainConfig, initial_output: Level, ) -> Pin<Output<OpenDrain>>
Convert the pin to be an open-drain output
This method currently does not support configuring an internal pull-up or pull-down resistor.
Trait Implementations§
Source§impl<MODE> InputPin for Pin<Input<MODE>>
impl<MODE> InputPin for Pin<Input<MODE>>
Source§impl<MODE> OutputPin for Pin<Output<MODE>>
impl<MODE> OutputPin for Pin<Output<MODE>>
Source§impl<MODE> StatefulOutputPin for Pin<Output<MODE>>
impl<MODE> StatefulOutputPin for Pin<Output<MODE>>
Source§fn is_set_high(&self) -> bool
👎Deprecated since 0.2.2: Deprecated because the methods cannot return errors. Users should use the traits in digital::v2.
fn is_set_high(&self) -> bool
Deprecated because the methods cannot return errors. Users should use the traits in digital::v2.
Is the output pin set as high?
Source§fn is_set_low(&self) -> bool
👎Deprecated since 0.2.2: Deprecated because the methods cannot return errors. Users should use the traits in digital::v2.
fn is_set_low(&self) -> bool
Deprecated because the methods cannot return errors. Users should use the traits in digital::v2.
Is the output pin set as low?
Auto Trait Implementations§
impl<MODE> Freeze for Pin<MODE>
impl<MODE> RefUnwindSafe for Pin<MODE>where
MODE: RefUnwindSafe,
impl<MODE> Send for Pin<MODE>where
MODE: Send,
impl<MODE> Sync for Pin<MODE>where
MODE: Sync,
impl<MODE> Unpin for Pin<MODE>where
MODE: Unpin,
impl<MODE> UnsafeUnpin for Pin<MODE>
impl<MODE> UnwindSafe for Pin<MODE>where
MODE: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more