Struct aw_soc::gpio::Pin

source ·
pub struct Pin<A: BaseAddress, const P: char, const N: u8, M> { /* private fields */ }
Expand description

Individual GPIO pin.

Implementations§

source§

impl<A: BaseAddress, const P: char, const N: u8, M: PinMode> Pin<A, P, N, M>

source

pub fn into_disabled(self) -> Pin<A, P, N, Disabled>

Disables the pin.

source

pub fn into_input(self) -> Pin<A, P, N, Input>

Configures the pin to operate as an input pin.

source

pub fn into_output(self) -> Pin<A, P, N, Output>

Configures the pin to operate as an output pin.

source

pub fn into_eint(self) -> Pin<A, P, N, EintMode>

Configures the pin to operate as an external interrupt.

source

pub fn into_function<const F: u8>(self) -> Pin<A, P, N, Function<F>>

Configures the pin to operate as an alternate function.

Trait Implementations§

source§

impl<A: BaseAddress, const P: char, const N: u8> EintPin for Pin<A, P, N, EintMode>

source§

impl<A: BaseAddress, const P: char, const N: u8> ErrorType for Pin<A, P, N, Input>

§

type Error = Infallible

Error type
source§

impl<A: BaseAddress, const P: char, const N: u8> ErrorType for Pin<A, P, N, Output>

§

type Error = Infallible

Error type
source§

impl<A: BaseAddress, const P: char, const N: u8> InputPin for Pin<A, P, N, Input>

source§

fn is_high(&self) -> Result<bool, Self::Error>

Is the input pin high?
source§

fn is_low(&self) -> Result<bool, Self::Error>

Is the input pin low?
source§

impl<A: BaseAddress, const P: char, const N: u8> OutputPin for Pin<A, P, N, Output>

source§

fn set_low(&mut self) -> Result<(), Self::Error>

Drives the pin low Read more
source§

fn set_high(&mut self) -> Result<(), Self::Error>

Drives the pin high Read more
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<A: BaseAddress, const P: char, const N: u8> StatefulOutputPin for Pin<A, P, N, Output>

source§

fn is_set_high(&self) -> Result<bool, Self::Error>

Is the pin in drive high mode? Read more
source§

fn is_set_low(&self) -> Result<bool, Self::Error>

Is the pin in drive low mode? Read more

Auto Trait Implementations§

§

impl<A, const P: char, const N: u8, M> RefUnwindSafe for Pin<A, P, N, M>where A: RefUnwindSafe, M: RefUnwindSafe,

§

impl<A, const P: char, const N: u8, M> Send for Pin<A, P, N, M>where A: Send, M: Send,

§

impl<A, const P: char, const N: u8, M> Sync for Pin<A, P, N, M>where A: Sync, M: Sync,

§

impl<A, const P: char, const N: u8, M> Unpin for Pin<A, P, N, M>where A: Unpin, M: Unpin,

§

impl<A, const P: char, const N: u8, M> UnwindSafe for Pin<A, P, N, M>where A: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.