Struct nrf52840_hal::gpio::p0::P0_04

source ·
pub struct P0_04<MODE> { /* private fields */ }

Implementations§

source§

impl<MODE> P0_04<MODE>

source

pub fn into_floating_input(self) -> P0_04<Input<Floating>>

Convert the pin to be a floating input

source

pub fn into_pulldown_input(self) -> P0_04<Input<PullDown>>

source

pub fn into_pullup_input(self) -> P0_04<Input<PullUp>>

source

pub fn into_push_pull_output_drive( self, initial_output: Level, drive: DriveConfig ) -> P0_04<Output<PushPull>>

Convert the pin to bepin a push-pull output with specified drive

source

pub fn into_push_pull_output( self, initial_output: Level ) -> P0_04<Output<PushPull>>

Convert the pin to bepin a push-pull output with normal drive

source

pub fn into_open_drain_output( self, config: OpenDrainConfig, initial_output: Level ) -> P0_04<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.

source

pub fn into_open_drain_input_output( self, config: OpenDrainConfig, initial_output: Level ) -> P0_04<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.

source

pub fn into_disconnected(self) -> P0_04<Disconnected>

Disconnects the pin.

In disconnected mode the pin cannot be used as input or output. It is primarily useful to reduce power usage.

source

pub fn degrade(self) -> Pin<MODE>

Degrade to a generic pin struct, which can be used with peripherals

Trait Implementations§

source§

impl<STATE> Channel<Saadc> for P0_04<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> <P0_04<STATE> as Channel<Saadc>>::ID

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
source§

impl CompInputPin for P0_04<Input<Floating>>

source§

fn ain(&self) -> PSEL_A

source§

impl CompRefPin for P0_04<Input<Floating>>

source§

impl<MODE> From<P0_04<MODE>> for Pin<MODE>

source§

fn from(value: P0_04<MODE>) -> Pin<MODE>

Converts to this type from the input type.
source§

impl<MODE> InputPin for P0_04<Input<MODE>>

§

type Error = Void

Error type
source§

fn is_high(&self) -> Result<bool, <P0_04<Input<MODE>> as InputPin>::Error>

Is the input pin high?
source§

fn is_low(&self) -> Result<bool, <P0_04<Input<MODE>> as InputPin>::Error>

Is the input pin low?
source§

impl InputPin for P0_04<Output<OpenDrainIO>>

§

type Error = Void

Error type
source§

fn is_high( &self ) -> Result<bool, <P0_04<Output<OpenDrainIO>> as InputPin>::Error>

Is the input pin high?
source§

fn is_low( &self ) -> Result<bool, <P0_04<Output<OpenDrainIO>> as InputPin>::Error>

Is the input pin low?
source§

impl LpCompInputPin for P0_04<Input<Floating>>

source§

fn ain(&self) -> PSEL_A

source§

impl<MODE> OutputPin for P0_04<Output<MODE>>

source§

fn set_high(&mut self) -> Result<(), <P0_04<Output<MODE>> as OutputPin>::Error>

Set the output as high

source§

fn set_low(&mut self) -> Result<(), <P0_04<Output<MODE>> as OutputPin>::Error>

Set the output as low

§

type Error = Void

Error type
source§

fn set_state(&mut self, state: PinState) -> Result<(), Self::Error>

Drives the pin high or low depending on the provided value Read more
source§

impl<MODE> StatefulOutputPin for P0_04<Output<MODE>>

source§

fn is_set_high(&self) -> Result<bool, <P0_04<Output<MODE>> as OutputPin>::Error>

Is the output pin set as high?

source§

fn is_set_low(&self) -> Result<bool, <P0_04<Output<MODE>> as OutputPin>::Error>

Is the output pin set as low?

Auto Trait Implementations§

§

impl<MODE> RefUnwindSafe for P0_04<MODE>
where MODE: RefUnwindSafe,

§

impl<MODE> Send for P0_04<MODE>
where MODE: Send,

§

impl<MODE> Sync for P0_04<MODE>
where MODE: Sync,

§

impl<MODE> Unpin for P0_04<MODE>
where MODE: Unpin,

§

impl<MODE> UnwindSafe for P0_04<MODE>
where MODE: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.