Struct stm32_hal2::gpio::GpioCPin [−][src]
pub struct GpioCPin { pub port: PortLetter, pub pin: PinNum, }
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 GpioCPin
[src]
impl GpioCPin
[src]pub fn mode(&mut self, value: PinMode, regs: &mut GPIOC)
[src]
Set pin mode.
pub fn output_type(&mut self, value: OutputType, regs: &mut GPIOC)
[src]
Set output type.
pub fn output_speed(&mut self, value: OutputSpeed, regs: &mut GPIOC)
[src]
Set output speed.
pub fn pull(&mut self, value: Pull, regs: &mut GPIOC)
[src]
Set internal pull resistor: Pull up, pull down, or floating.
pub fn output_data(&mut self, value: PinState, regs: &mut GPIOC)
[src]
Set the output_data register.
pub fn cfg_lock(&mut self, value: CfgLock, regs: &mut GPIOC)
[src]
Lock or unlock a port configuration.
pub fn input_data(&mut self, regs: &mut GPIOC) -> PinState
[src]
Read the input data register.
pub fn set_state(&mut self, value: PinState, regs: &mut GPIOC)
[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 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 ToggleableOutputPin for GpioCPin
[src]
impl ToggleableOutputPin for GpioCPin
[src]