Struct Output
pub struct Output<'a> { /* private fields */ }Expand description
A GPIO output.
Implementations§
§impl<'a> Output<'a>
impl<'a> Output<'a>
pub fn new<P>(
pin: impl IntoPeripheral<'a, P>,
initial_level: Level,
) -> Output<'a>where
P: OutputPin + 'a,
pub fn new<P>(
pin: impl IntoPeripheral<'a, P>,
initial_level: Level,
) -> Output<'a>where
P: OutputPin + 'a,
Returns a configured Output.
If you want to re-use a pin at runtime, you can give the result of .reborrow() of the pin instance to this constructor.
This driver and the child pin instance need to be dropped before being able to use the pin in another driver.
pub fn builder<T, P>(pin: T, initial_level: Level) -> OutputBuilder<'a, T, P>where
T: IntoPeripheral<'a, P>,
P: OutputPin + 'a,
pub fn builder<T, P>(pin: T, initial_level: Level) -> OutputBuilder<'a, T, P>where
T: IntoPeripheral<'a, P>,
P: OutputPin + 'a,
Returns an OutputBuilder, allowing to configure the GPIO output further.
If you want to re-use a pin at runtime, you can give the result of .reborrow() of the pin instance to this constructor.
This driver and the child pin instance need to be dropped before being able to use the pin in another driver.
pub fn set_high(&mut self)
pub fn set_high(&mut self)
Sets the output as high.
pub fn set_low(&mut self)
pub fn set_low(&mut self)
Sets the output as low.
pub fn toggle(&mut self)
pub fn toggle(&mut self)
Toggles the output level.
Trait Implementations§
§impl OutputPin for Output<'_>
impl OutputPin for Output<'_>
Auto Trait Implementations§
impl<'a> Freeze for Output<'a>
impl<'a> RefUnwindSafe for Output<'a>
impl<'a> Send for Output<'a>
impl<'a> Sync for Output<'a>
impl<'a> Unpin for Output<'a>
impl<'a> UnwindSafe for Output<'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