pub struct Input<'a>(/* private fields */);
Expand description
A GP pin in GPIO input mode.
This struct is intended for use with the embedded_hal::digital::InputPin
trait.
Implementations§
Source§impl<'a> Input<'a>
impl<'a> Input<'a>
Sourcepub fn get_level(&self) -> Result<LogicLevel, Error>
pub fn get_level(&self) -> Result<LogicLevel, Error>
Get the input level of this pin.
Sourcepub fn destroy(self) -> GpPin<'a>
pub fn destroy(self) -> GpPin<'a>
Extract the underlying GpPin
.
This method does not change any MCP2221 settings.
If you only wish to change the GPIO direction of the pin, use
Input::try_into_output
.
Sourcepub fn try_into_output(self) -> Result<Output<'a>, Error>
pub fn try_into_output(self) -> Result<Output<'a>, Error>
Switch the pin mode from input to output.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Input<'a>
impl<'a> !RefUnwindSafe for Input<'a>
impl<'a> !Send for Input<'a>
impl<'a> !Sync for Input<'a>
impl<'a> Unpin for Input<'a>
impl<'a> !UnwindSafe for Input<'a>
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