Struct stm32f412g::gpio::Pin
source · pub struct Pin<'a> { /* private fields */ }
Implementations§
source§impl<'a> Pin<'a>
impl<'a> Pin<'a>
pub const fn new(pinid: PinId, exti: &'a Exti<'a>) -> Pin<'a>
pub fn set_ports_ref(&self, ports: &'a GpioPorts<'a>)
pub fn set_client(&self, client: &'a dyn Client)
pub fn handle_interrupt(&self)
pub fn get_mode(&self) -> Mode
pub fn set_mode(&self, mode: Mode)
pub fn set_alternate_function(&self, af: AlternateFunction)
pub fn get_pinid(&self) -> PinId
pub unsafe fn enable_interrupt(&'static self)
pub fn set_exti_lineid(&self, lineid: LineId)
pub fn set_speed(&self)
pub fn set_mode_output_opendrain(&self)
Trait Implementations§
source§impl Configure for Pin<'_>
impl Configure for Pin<'_>
source§fn make_output(&self) -> Configuration
fn make_output(&self) -> Configuration
Output mode default is push-pull
source§fn make_input(&self) -> Configuration
fn make_input(&self) -> Configuration
Input mode default is no internal pull-up, no pull-down (i.e., floating). Also upon setting the mode as input, the internal schmitt trigger is automatically activated. Schmitt trigger is deactivated in AnalogMode.
source§fn deactivate_to_low_power(&self)
fn deactivate_to_low_power(&self)
According to AN4899, Section 6.1, setting to AnalogMode, disables internal schmitt trigger. We do not disable clock to the GPIO port, because there could be other pins active on the port.
source§fn disable_output(&self) -> Configuration
fn disable_output(&self) -> Configuration
Disable the pin as an output, returning the current configuration.
source§fn disable_input(&self) -> Configuration
fn disable_input(&self) -> Configuration
Disable the pin as an input, returning the current configuration.
source§fn set_floating_state(&self, mode: FloatingState)
fn set_floating_state(&self, mode: FloatingState)
Set the floating state of the pin.
source§fn floating_state(&self) -> FloatingState
fn floating_state(&self) -> FloatingState
Return the current floating state of the pin.
source§fn configuration(&self) -> Configuration
fn configuration(&self) -> Configuration
Return the current pin configuration.
source§impl Input for Pin<'_>
impl Input for Pin<'_>
source§fn read(&self) -> bool
fn read(&self) -> bool
Get the current state of an input GPIO pin. For an output
pin, return the output; for an input pin, return the input;
for disabled or function pins the value is undefined.
source§fn read_activation(&self, mode: ActivationMode) -> ActivationState
fn read_activation(&self, mode: ActivationMode) -> ActivationState
Get the current state of a GPIO pin, for a given activation mode.
source§impl<'a> Interrupt<'a> for Pin<'a>
impl<'a> Interrupt<'a> for Pin<'a>
source§fn enable_interrupts(&self, mode: InterruptEdge)
fn enable_interrupts(&self, mode: InterruptEdge)
Enable an interrupt on the GPIO pin. This does not
configure the pin except to enable an interrupt: it
should be separately configured as an input, etc.
source§fn disable_interrupts(&self)
fn disable_interrupts(&self)
Disable interrupts for the GPIO pin.
source§fn set_client(&self, client: &'a dyn Client)
fn set_client(&self, client: &'a dyn Client)
Set the client for interrupt events.
source§fn is_pending(&self) -> bool
fn is_pending(&self) -> bool
Return whether this interrupt is pending
source§impl Output for Pin<'_>
impl Output for Pin<'_>
source§fn set(&self)
fn set(&self)
Set the GPIO pin high. If the pin is not an output or
input/output, this call is ignored.
source§fn clear(&self)
fn clear(&self)
Set the GPIO pin low. If the pin is not an output or
input/output, this call is ignored.
source§fn toggle(&self) -> bool
fn toggle(&self) -> bool
Toggle the GPIO pin. If the pin was high, set it low. If
the pin was low, set it high. If the pin is not an output or
input/output, this call is ignored. Return the new value
of the pin.
source§fn write_activation(&self, state: ActivationState, mode: ActivationMode)
fn write_activation(&self, state: ActivationState, mode: ActivationMode)
Activate or deactivate a GPIO pin, for a given activation mode.
Auto Trait Implementations§
impl<'a> !Freeze for Pin<'a>
impl<'a> !RefUnwindSafe for Pin<'a>
impl<'a> !Send for Pin<'a>
impl<'a> !Sync for Pin<'a>
impl<'a> Unpin for Pin<'a>
impl<'a> !UnwindSafe for Pin<'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