pub struct DynPin { /* private fields */ }
Expand description
A value-level pin, parameterized by DynPinId
and DynPinMode
This type acts as a type-erased version of Pin
. Every pin is represented
by the same type, and pins are tracked and distinguished at run-time.
Implementations
sourceimpl DynPin
impl DynPin
sourcepub fn mode(&self) -> DynPinMode
pub fn mode(&self) -> DynPinMode
Return a copy of the pin mode
sourcepub fn into_mode(&mut self, mode: DynPinMode)
pub fn into_mode(&mut self, mode: DynPinMode)
Convert the pin to the requested DynPinMode
sourcepub fn into_floating_disabled(&mut self)
pub fn into_floating_disabled(&mut self)
Disable the pin and set it to float
sourcepub fn into_pull_down_disabled(&mut self)
pub fn into_pull_down_disabled(&mut self)
Disable the pin and set it to pull down
sourcepub fn into_pull_up_disabled(&mut self)
pub fn into_pull_up_disabled(&mut self)
Disable the pin and set it to pull up
sourcepub fn into_floating_input(&mut self)
pub fn into_floating_input(&mut self)
Configure the pin to operate as a floating input
sourcepub fn into_pull_down_input(&mut self)
pub fn into_pull_down_input(&mut self)
Configure the pin to operate as a pulled down input
sourcepub fn into_pull_up_input(&mut self)
pub fn into_pull_up_input(&mut self)
Configure the pin to operate as a pulled up input
sourcepub fn into_floating_interrupt(&mut self)
pub fn into_floating_interrupt(&mut self)
Configure the pin to operate as a floating interrupt
sourcepub fn into_pull_down_interrupt(&mut self)
pub fn into_pull_down_interrupt(&mut self)
Configure the pin to operate as a pulled down interrupt
sourcepub fn into_pull_up_interrupt(&mut self)
pub fn into_pull_up_interrupt(&mut self)
Configure the pin to operate as a pulled up interrupt
sourcepub fn into_push_pull_output(&mut self)
pub fn into_push_pull_output(&mut self)
Configure the pin to operate as a push-pull output
sourcepub fn into_readable_output(&mut self)
pub fn into_readable_output(&mut self)
Configure the pin to operate as a readable push pull output
sourcepub fn into_alternate(&mut self, config: DynAlternate)
pub fn into_alternate(&mut self, config: DynAlternate)
Configure the pin to operate as the corresponding peripheral function.
The config
argument indicates the desired peripheral function.
sourcepub fn get_drive_strength(&self) -> bool
pub fn get_drive_strength(&self) -> bool
Read the current drive strength of the pin.
The drive strength is reset to normal on every change in pin mode.
sourcepub fn set_drive_strength(&mut self, stronger: bool)
pub fn set_drive_strength(&mut self, stronger: bool)
Set the drive strength for the pin.
The drive strength is reset to normal on every change in pin mode.