Struct nrf9160_hal::gpio::Pin
source · pub struct Pin<MODE> { /* private fields */ }
Expand description
Generic $PX pin
Implementations§
source§impl<MODE> Pin<MODE>
impl<MODE> Pin<MODE>
pub unsafe fn from_psel_bits(psel_bits: u32) -> Pin<MODE>
pub fn pin(&self) -> u8
pub fn port(&self) -> Port
pub fn psel_bits(&self) -> u32
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_drive(
self,
initial_output: Level,
drive: DriveConfig
) -> Pin<Output<PushPull>>
pub fn into_push_pull_output_drive( self, initial_output: Level, drive: DriveConfig ) -> Pin<Output<PushPull>>
Convert the pin to be a push-pull output with specified drive.
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 specified initial output level.
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.
sourcepub fn into_open_drain_input_output(
self,
config: OpenDrainConfig,
initial_output: Level
) -> Pin<Output<OpenDrainIO>>
pub fn into_open_drain_input_output( self, config: OpenDrainConfig, initial_output: Level ) -> Pin<Output<OpenDrainIO>>
Convert the pin to be an open-drain input/output.
Similar to into_open_drain_output
, but can also be read from.
This method currently does not support configuring an internal pull-up or pull-down resistor.
sourcepub fn into_disconnected(self) -> Pin<Disconnected>
pub fn into_disconnected(self) -> Pin<Disconnected>
Disconnects the pin.
In disconnected mode the pin cannot be used as input or output. It is primarily useful to reduce power usage.
Trait Implementations§
source§impl<MODE> OutputPin for Pin<Output<MODE>>
impl<MODE> OutputPin for Pin<Output<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>>
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> 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