Struct imxrt10xx::gpio::Pin

source ·
pub struct Pin<'a> { /* private fields */ }
Expand description

A GPIO pin, like GPIO3[17]

Pin implements the hil::gpio traits. To acquire a Pin,

Implementations§

source§

impl<'a> Pin<'a>

source

pub fn from_pin_id(pin_id: PinId) -> Self

Fabricate a new Pin from a PinId

Trait Implementations§

source§

impl Configure for Pin<'_>

source§

fn make_output(&self) -> Configuration

Make the pin an output, returning the current configuration, which should be either Configuration::Output or Configuration::InputOutput.
source§

fn make_input(&self) -> Configuration

Make the pin an input, returning the current configuration, which should be ither Configuration::Input or Configuration::InputOutput.
source§

fn deactivate_to_low_power(&self)

Put a pin into its lowest power state, with no guarantees on if it is enabled or not. Implementations are free to use any state (e.g. input, output, disable, etc.) the hardware pin supports to ensure the pin is as low power as possible. Re-enabling the pin requires reconfiguring it (i.e. the state of its enabled configuration is not stored).
source§

fn disable_output(&self) -> Configuration

Disable the pin as an output, returning the current configuration.
source§

fn disable_input(&self) -> Configuration

Disable the pin as an input, returning the current configuration.
source§

fn set_floating_state(&self, _mode: FloatingState)

Set the floating state of the pin.
source§

fn floating_state(&self) -> FloatingState

Return the current floating state of the pin.
source§

fn configuration(&self) -> Configuration

Return the current pin configuration.
source§

fn is_input(&self) -> bool

Return whether the pin is an input (reading from the Input trait will return valid results). Returns true if the pin is in Configuration::Input or Configuration::InputOutput.
source§

fn is_output(&self) -> bool

Return whether the pin is an output (writing to the Output trait will change the output of the pin). Returns true if the pin is in Configuration::Output or Configuration::InputOutput.
source§

impl Input for Pin<'_>

source§

fn read(&self) -> bool

Get the current state of an input GPIO pin. For an output pin, return the output; for an input pin, return the input; for disabled or function pins the value is undefined.
source§

fn read_activation(&self, mode: ActivationMode) -> ActivationState

Get the current state of a GPIO pin, for a given activation mode.
source§

impl<'a> Interrupt<'a> for Pin<'a>

source§

fn enable_interrupts(&self, mode: InterruptEdge)

Enable an interrupt on the GPIO pin. This does not configure the pin except to enable an interrupt: it should be separately configured as an input, etc.
source§

fn disable_interrupts(&self)

Disable interrupts for the GPIO pin.
source§

fn set_client(&self, client: &'a dyn Client)

Set the client for interrupt events.
source§

fn is_pending(&self) -> bool

Return whether this interrupt is pending
source§

impl Output for Pin<'_>

source§

fn set(&self)

Set the GPIO pin high. If the pin is not an output or input/output, this call is ignored.
source§

fn clear(&self)

Set the GPIO pin low. If the pin is not an output or input/output, this call is ignored.
source§

fn toggle(&self) -> bool

Toggle the GPIO pin. If the pin was high, set it low. If the pin was low, set it high. If the pin is not an output or input/output, this call is ignored. Return the new value of the pin.
source§

fn write_activation(&self, state: ActivationState, mode: ActivationMode)

Activate or deactivate a GPIO pin, for a given activation mode.

Auto Trait Implementations§

§

impl<'a> !Freeze for Pin<'a>

§

impl<'a> !RefUnwindSafe for Pin<'a>

§

impl<'a> !Send for Pin<'a>

§

impl<'a> !Sync for Pin<'a>

§

impl<'a> Unpin for Pin<'a>

§

impl<'a> !UnwindSafe for Pin<'a>

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> 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<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<T> SizedTypeProperties for T

source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
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<'a, T> InterruptPin<'a> for T
where T: Pin + Interrupt<'a>,

source§

impl<T> Pin for T
where T: Input + Output + Configure,