embassy-nxp

Crates

git

Versions

lpc55-core0

Flavors

Struct Output

Source
pub struct Output<'d> { /* private fields */ }
Expand description

GPIO output driver. Internally, this is a specialized Flex pin.

Implementations§

Source§

impl<'d> Output<'d>

Source

pub fn new(pin: Peri<'d, impl Pin>, initial_output: Level) -> Self

Create GPIO output driver for a Pin with the provided initial output.

Source

pub fn set_high(&mut self)

Source

pub fn set_low(&mut self)

Source

pub fn toggle(&mut self)

Source

pub fn level(&self) -> Level

Get the current output level of the pin. Note that the value returned by this function is the voltage level reported by the pin, not the value set by the output driver.

Source§

impl Output<'_>

Source

pub async fn wait_for_any_edge(&mut self) -> Option<()>

Wait for a falling or rising edge on the pin. You can have at most 8 pins waiting. If you try to wait for more than 8 pins, this function will return None.

Source

pub async fn wait_for_falling_edge(&mut self) -> Option<()>

Wait for a falling edge on the pin. You can have at most 8 pins waiting. If you try to wait for more than 8 pins, this function will return None.

Source

pub async fn wait_for_rising_edge(&mut self) -> Option<()>

Wait for a rising edge on the pin. You can have at most 8 pins waiting. If you try to wait for more than 8 pins, this function will return None.

Source

pub async fn wait_for_low(&mut self) -> Option<()>

Wait for a low level on the pin. You can have at most 8 pins waiting. If you try to wait for more than 8 pins, this function will return None.

Source

pub async fn wait_for_high(&mut self) -> Option<()>

Wait for a high level on the pin. You can have at most 8 pins waiting. If you try to wait for more than 8 pins, this function will return None.

Auto Trait Implementations§

§

impl<'d> Freeze for Output<'d>

§

impl<'d> RefUnwindSafe for Output<'d>

§

impl<'d> Send for Output<'d>

§

impl<'d> Sync for Output<'d>

§

impl<'d> Unpin for Output<'d>

§

impl<'d> !UnwindSafe for Output<'d>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.