Struct mimxrt500_hal::gpio::pin::Pin
source · pub struct Pin<I, M>where
I: PinId,
M: PinMode,{ /* private fields */ }Expand description
Implementations§
source§impl<I, M> Pin<I, M>where
I: PinId,
M: PinMode,
impl<I, M> Pin<I, M>where I: PinId, M: PinMode,
sourcepub fn set_output(&self, high: bool)
pub fn set_output(&self, high: bool)
Sets the output value for the pin.
This method is always available, but will have no immediate effect
if the pin is not in output mode. Use set_output before converting
to an output to specify the initial value once output mode is enabled.
sourcepub fn toggle_output(&self)
pub fn toggle_output(&self)
Toggles the output state for the pin.
This method is always available, but will have no immediate effect if the pin is not in output mode.
sourcepub fn into_push_pull_output(self) -> Pin<I, OutputPushPull>
pub fn into_push_pull_output(self) -> Pin<I, OutputPushPull>
Reconfigures the pin into a push-pull output and returns the new pin.
sourcepub fn into_input(self) -> Pin<I, InputFloating>
pub fn into_input(self) -> Pin<I, InputFloating>
Reconfigures the pin into a floating input and returns the new pin.
sourcepub fn into_input_pullup(self) -> Pin<I, InputPullUp>
pub fn into_input_pullup(self) -> Pin<I, InputPullUp>
Reconfigures the pin into an input with pull-up and returns the new pin.
sourcepub fn into_input_pulldown(self) -> Pin<I, InputPullDown>
pub fn into_input_pulldown(self) -> Pin<I, InputPullDown>
Reconfigures the pin into an input with pull-down and returns the new pin.
sourcepub const fn into_value_based(self) -> DynPin
pub const fn into_value_based(self) -> DynPin
Reinterprets the pin as a value-based DynPin, which tracks the
pin ID and mode as runtime data rather than as type parameters.
Trait Implementations§
source§impl<Id: PinId, IC: InputConfig, const OOD: bool, const OFD: bool, const OSS: bool> From<Pin<Id, Input<IC>>> for Pin<Id, Output<OOD, OFD, OSS>>
impl<Id: PinId, IC: InputConfig, const OOD: bool, const OFD: bool, const OSS: bool> From<Pin<Id, Input<IC>>> for Pin<Id, Output<OOD, OFD, OSS>>
source§impl<Id: PinId, const OOD: bool, const OFD: bool, const OSS: bool, IC: InputConfig> From<Pin<Id, Output<OOD, OFD, OSS>>> for Pin<Id, Input<IC>>
impl<Id: PinId, const OOD: bool, const OFD: bool, const OSS: bool, IC: InputConfig> From<Pin<Id, Output<OOD, OFD, OSS>>> for Pin<Id, Input<IC>>
source§impl<Id: PinId, F: AltFunc, ST: SignalType> From<Pin<Id, Unknown>> for Pin<Id, Alternate<F, ST>>
impl<Id: PinId, F: AltFunc, ST: SignalType> From<Pin<Id, Unknown>> for Pin<Id, Alternate<F, ST>>
source§impl<Id: PinId, const OD: bool, const FD: bool, const SS: bool> From<Pin<Id, Unknown>> for Pin<Id, Output<OD, FD, SS>>
impl<Id: PinId, const OD: bool, const FD: bool, const SS: bool> From<Pin<Id, Unknown>> for Pin<Id, Output<OD, FD, SS>>
source§impl<Id: PinId, C: InputConfig> InputPin for Pin<Id, Input<C>>
impl<Id: PinId, C: InputConfig> InputPin for Pin<Id, Input<C>>
Pins in input mode implement ehal::InputPin.
This implementation does not take into account the possibility that the port might be configured to invert its input. If that flag is set then the two methods will return opposite values.