Struct InputBuilder
pub struct InputBuilder<P>where
P: Peripheral,
<P as Peripheral>::P: InputPin,{ /* private fields */ }
Expand description
Builder type for Input
, can be obtained with Input::builder()
.
Implementations§
§impl<P> InputBuilder<P>where
P: Peripheral + 'static,
<P as Peripheral>::P: InputPin,
impl<P> InputBuilder<P>where
P: Peripheral + 'static,
<P as Peripheral>::P: InputPin,
pub fn schmitt_trigger(self, enable: bool) -> InputBuilder<P>
pub fn schmitt_trigger(self, enable: bool) -> InputBuilder<P>
Configures the input’s Schmitt trigger.
§Note
Fails to compile if the HAL does not support configuring Schmitt trigger on inputs.
§impl<P> InputBuilder<P>where
P: Peripheral + 'static,
<P as Peripheral>::P: InputPin,
impl<P> InputBuilder<P>where
P: Peripheral + 'static,
<P as Peripheral>::P: InputPin,
pub fn build_with_interrupt(self) -> Result<IntEnabledInput, Error>
Available on crate feature external-interrupts
only.
pub fn build_with_interrupt(self) -> Result<IntEnabledInput, Error>
external-interrupts
only.Returns an IntEnabledInput
by finalizing the builder.
§Errors
On some MCU families, the number of external interrupts that can simultaneously be
enabled is limited by the number of hardware interrupt channels.
Some MCU families also have other limitations, for instance it may not be possible to
register interrupts on a pin if one is already registered on the pin with the same pin
number of another port (e.g., PA0
and PB0
).
In these cases, this returns an Error::InterruptChannel
, with a HAL-specific error.
Auto Trait Implementations§
impl<P> Freeze for InputBuilder<P>where
P: Freeze,
impl<P> RefUnwindSafe for InputBuilder<P>where
P: RefUnwindSafe,
impl<P> Send for InputBuilder<P>where
P: Send,
impl<P> Sync for InputBuilder<P>where
P: Sync,
impl<P> Unpin for InputBuilder<P>where
P: Unpin,
impl<P> UnwindSafe for InputBuilder<P>where
P: UnwindSafe,
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