Struct stm32_hal2::gpio::GpioAPin [−][src]
Represents a single GPIO pin. Provides methods that, when passed a mutable reference to its port’s register block, can change and read various properties of the pin.
Fields
port: PortLetter
pin: PinNum
Implementations
impl GpioAPin
[src]
pub fn mode(&mut self, value: PinMode, regs: &mut GPIOA)
[src]
Set pin mode.
pub fn output_type(&mut self, value: OutputType, regs: &mut GPIOA)
[src]
Set output type.
pub fn output_speed(&mut self, value: OutputSpeed, regs: &mut GPIOA)
[src]
Set output speed.
pub fn pull(&mut self, value: Pull, regs: &mut GPIOA)
[src]
Set internal pull resistor: Pull up, pull down, or floating.
pub fn output_data(&mut self, value: PinState, regs: &mut GPIOA)
[src]
Set the output_data register.
pub fn cfg_lock(&mut self, value: CfgLock, regs: &mut GPIOA)
[src]
Lock or unlock a port configuration.
pub fn input_data(&mut self, regs: &mut GPIOA) -> PinState
[src]
Read the input data register.
pub fn set_state(&mut self, value: PinState, regs: &mut GPIOA)
[src]
Set a pin state (ie set high or low output voltage level).
pub fn enable_interrupt(
&mut self,
edge: Edge,
exti: &mut EXTI,
syscfg: &mut SYSCFG
)
[src]
&mut self,
edge: Edge,
exti: &mut EXTI,
syscfg: &mut SYSCFG
)
Configure this pin as an interrupt source.
pub fn disable_interrupt()
[src]
Disable interrupts on this pin.
pub fn is_high(&self) -> bool
[src]
Check if the pin’s input voltage is high (VCC).
pub fn is_low(&self) -> bool
[src]
Check if the pin’s input voltage is low (ground).
pub fn set_high(&self)
[src]
Set the pin’s output voltage to high (VCC).
pub fn set_low(&self)
[src]
Set the pin’s output voltage to ground (low).
Trait Implementations
impl InputPin for GpioAPin
[src]
type Error = Infallible
Error type
fn is_high(&self) -> Result<bool, Self::Error>
[src]
fn is_low(&self) -> Result<bool, Self::Error>
[src]
impl OutputPin for GpioAPin
[src]
type Error = Infallible
Error type
fn set_low(&mut self) -> Result<(), Self::Error>
[src]
fn set_high(&mut self) -> Result<(), Self::Error>
[src]
impl ToggleableOutputPin for GpioAPin
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,