Struct esp32c2_hal::gpio::GpioPin
source · pub struct GpioPin<MODE, const GPIONUM: u8> { /* private fields */ }
Implementations§
source§impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>where
GpioPin<MODE, GPIONUM>: GpioProperties,
impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>where GpioPin<MODE, GPIONUM>: GpioProperties,
pub fn into_floating_input(self) -> GpioPin<Input<Floating>, GPIONUM>
pub fn into_pull_up_input(self) -> GpioPin<Input<PullUp>, GPIONUM>
pub fn into_pull_down_input(self) -> GpioPin<Input<PullDown>, GPIONUM>
source§impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>where
GpioPin<MODE, GPIONUM>: GpioProperties,
<GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>where GpioPin<MODE, GPIONUM>: GpioProperties, <GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
pub fn into_push_pull_output(self) -> GpioPin<Output<PushPull>, GPIONUM>
pub fn into_open_drain_output(self) -> GpioPin<Output<OpenDrain>, GPIONUM>
pub fn into_alternate_1(self) -> GpioPin<Alternate<AF1>, GPIONUM>
pub fn into_alternate_2(self) -> GpioPin<Alternate<AF2>, GPIONUM>
source§impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>where
GpioPin<MODE, GPIONUM>: GpioProperties,
<GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsAnalogPin,
impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>where GpioPin<MODE, GPIONUM>: GpioProperties, <GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsAnalogPin,
pub fn into_analog(self) -> GpioPin<Analog, GPIONUM>
Trait Implementations§
source§impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Analog, GPIONUM>where
GpioPin<Analog, GPIONUM>: GpioProperties,
<GpioPin<Analog, GPIONUM> as GpioProperties>::PinType: IsAnalogPin,
GpioPin<Unknown, GPIONUM>: GpioProperties,
<GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsAnalogPin,
impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Analog, GPIONUM>where GpioPin<Analog, GPIONUM>: GpioProperties, <GpioPin<Analog, GPIONUM> as GpioProperties>::PinType: IsAnalogPin, GpioPin<Unknown, GPIONUM>: GpioProperties, <GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsAnalogPin,
source§impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Input<Floating>, GPIONUM>where
GpioPin<Input<Floating>, GPIONUM>: GpioProperties,
<GpioPin<Input<Floating>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
GpioPin<Unknown, GPIONUM>: GpioProperties,
impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Input<Floating>, GPIONUM>where GpioPin<Input<Floating>, GPIONUM>: GpioProperties, <GpioPin<Input<Floating>, GPIONUM> as GpioProperties>::PinType: IsOutputPin, GpioPin<Unknown, GPIONUM>: GpioProperties,
source§impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Input<PullDown>, GPIONUM>where
GpioPin<Input<PullDown>, GPIONUM>: GpioProperties,
<GpioPin<Input<PullDown>, GPIONUM> as GpioProperties>::PinType: IsInputPin,
GpioPin<Unknown, GPIONUM>: GpioProperties,
impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Input<PullDown>, GPIONUM>where GpioPin<Input<PullDown>, GPIONUM>: GpioProperties, <GpioPin<Input<PullDown>, GPIONUM> as GpioProperties>::PinType: IsInputPin, GpioPin<Unknown, GPIONUM>: GpioProperties,
source§impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Input<PullUp>, GPIONUM>where
GpioPin<Input<PullUp>, GPIONUM>: GpioProperties,
<GpioPin<Input<PullUp>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
GpioPin<Unknown, GPIONUM>: GpioProperties,
impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Input<PullUp>, GPIONUM>where GpioPin<Input<PullUp>, GPIONUM>: GpioProperties, <GpioPin<Input<PullUp>, GPIONUM> as GpioProperties>::PinType: IsOutputPin, GpioPin<Unknown, GPIONUM>: GpioProperties,
source§impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Output<OpenDrain>, GPIONUM>where
GpioPin<Output<OpenDrain>, GPIONUM>: GpioProperties,
<GpioPin<Output<OpenDrain>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
GpioPin<Unknown, GPIONUM>: GpioProperties,
<GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Output<OpenDrain>, GPIONUM>where GpioPin<Output<OpenDrain>, GPIONUM>: GpioProperties, <GpioPin<Output<OpenDrain>, GPIONUM> as GpioProperties>::PinType: IsOutputPin, GpioPin<Unknown, GPIONUM>: GpioProperties, <GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
source§impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Output<PushPull>, GPIONUM>where
GpioPin<Output<PushPull>, GPIONUM>: GpioProperties,
<GpioPin<Output<PushPull>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
GpioPin<Unknown, GPIONUM>: GpioProperties,
<GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<Output<PushPull>, GPIONUM>where GpioPin<Output<PushPull>, GPIONUM>: GpioProperties, <GpioPin<Output<PushPull>, GPIONUM> as GpioProperties>::PinType: IsOutputPin, GpioPin<Unknown, GPIONUM>: GpioProperties, <GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
source§impl<MODE> GpioProperties for GpioPin<MODE, 0>
impl<MODE> GpioProperties for GpioPin<MODE, 0>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio0Signals
type PinType = InputOutputAnalogPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 1>
impl<MODE> GpioProperties for GpioPin<MODE, 1>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio1Signals
type PinType = InputOutputAnalogPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 10>
impl<MODE> GpioProperties for GpioPin<MODE, 10>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio10Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 18>
impl<MODE> GpioProperties for GpioPin<MODE, 18>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio18Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 19>
impl<MODE> GpioProperties for GpioPin<MODE, 19>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio19Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 2>
impl<MODE> GpioProperties for GpioPin<MODE, 2>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio2Signals
type PinType = InputOutputAnalogPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 20>
impl<MODE> GpioProperties for GpioPin<MODE, 20>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio20Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 3>
impl<MODE> GpioProperties for GpioPin<MODE, 3>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio3Signals
type PinType = InputOutputAnalogPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 4>
impl<MODE> GpioProperties for GpioPin<MODE, 4>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio4Signals
type PinType = InputOutputAnalogPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 5>
impl<MODE> GpioProperties for GpioPin<MODE, 5>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio5Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 6>
impl<MODE> GpioProperties for GpioPin<MODE, 6>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio6Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 7>
impl<MODE> GpioProperties for GpioPin<MODE, 7>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio7Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 8>
impl<MODE> GpioProperties for GpioPin<MODE, 8>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio8Signals
type PinType = InputOutputPinType
source§impl<MODE> GpioProperties for GpioPin<MODE, 9>
impl<MODE> GpioProperties for GpioPin<MODE, 9>
type Bank = Bank0GpioRegisterAccess
type InterruptStatus = InterruptStatusRegisterAccessBank0
type Signals = Gpio9Signals
type PinType = InputOutputPinType
source§impl<MODE, const GPIONUM: u8> InputPin for GpioPin<MODE, GPIONUM>where
GpioPin<MODE, GPIONUM>: GpioProperties,
impl<MODE, const GPIONUM: u8> InputPin for GpioPin<MODE, GPIONUM>where GpioPin<MODE, GPIONUM>: GpioProperties,
fn set_to_input(&mut self) -> &mut GpioPin<MODE, GPIONUM>
fn enable_input(&mut self, on: bool) -> &mut GpioPin<MODE, GPIONUM>
fn enable_input_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, GPIONUM>
fn is_input_high(&self) -> bool
fn connect_input_to_peripheral_with_options( &mut self, signal: InputSignal, invert: bool, force_via_gpio_mux: bool ) -> &mut GpioPin<MODE, GPIONUM>
source§fn disconnect_input_from_peripheral(
&mut self,
signal: InputSignal
) -> &mut GpioPin<MODE, GPIONUM>
fn disconnect_input_from_peripheral( &mut self, signal: InputSignal ) -> &mut GpioPin<MODE, GPIONUM>
Remove a connected
signal
from this input pin. Read morefn connect_input_to_peripheral(&mut self, signal: InputSignal) -> &mut Self
source§impl<MODE, const GPIONUM: u8> OutputPin for GpioPin<MODE, GPIONUM>where
GpioPin<MODE, GPIONUM>: GpioProperties,
<GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
impl<MODE, const GPIONUM: u8> OutputPin for GpioPin<MODE, GPIONUM>where GpioPin<MODE, GPIONUM>: GpioProperties, <GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
fn set_to_open_drain_output(&mut self) -> &mut GpioPin<MODE, GPIONUM>
fn set_to_push_pull_output(&mut self) -> &mut GpioPin<MODE, GPIONUM>
fn enable_output(&mut self, on: bool) -> &mut GpioPin<MODE, GPIONUM>
fn set_output_high(&mut self, high: bool) -> &mut GpioPin<MODE, GPIONUM>
fn set_drive_strength( &mut self, strength: DriveStrength ) -> &mut GpioPin<MODE, GPIONUM>
fn enable_open_drain(&mut self, on: bool) -> &mut GpioPin<MODE, GPIONUM>
fn internal_pull_up_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, GPIONUM>
fn internal_pull_down_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, GPIONUM>
fn enable_output_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, GPIONUM>
fn connect_peripheral_to_output_with_options( &mut self, signal: OutputSignal, invert: bool, invert_enable: bool, enable_from_gpio: bool, force_via_gpio_mux: bool ) -> &mut GpioPin<MODE, GPIONUM>
source§fn disconnect_peripheral_from_output(&mut self) -> &mut GpioPin<MODE, GPIONUM>
fn disconnect_peripheral_from_output(&mut self) -> &mut GpioPin<MODE, GPIONUM>
fn internal_pull_up(&mut self, on: bool) -> &mut GpioPin<MODE, GPIONUM>
fn internal_pull_down(&mut self, on: bool) -> &mut GpioPin<MODE, GPIONUM>
fn connect_peripheral_to_output(&mut self, signal: OutputSignal) -> &mut Self
source§impl<MODE, const GPIONUM: u8> Peripheral for GpioPin<MODE, GPIONUM>where
GpioPin<MODE, GPIONUM>: GpioProperties,
impl<MODE, const GPIONUM: u8> Peripheral for GpioPin<MODE, GPIONUM>where GpioPin<MODE, GPIONUM>: GpioProperties,
source§unsafe fn clone_unchecked(
&mut self
) -> <GpioPin<MODE, GPIONUM> as Peripheral>::P
unsafe fn clone_unchecked( &mut self ) -> <GpioPin<MODE, GPIONUM> as Peripheral>::P
Unsafely clone (duplicate) a peripheral singleton. Read more
source§impl<MODE, const GPIONUM: u8> Pin for GpioPin<MODE, GPIONUM>where
GpioPin<MODE, GPIONUM>: GpioProperties,
impl<MODE, const GPIONUM: u8> Pin for GpioPin<MODE, GPIONUM>where GpioPin<MODE, GPIONUM>: GpioProperties,
fn number(&self) -> u8
fn sleep_mode(&mut self, on: bool)
fn set_alternate_function(&mut self, alternate: AlternateFunction)
fn listen_with_options( &mut self, event: Event, int_enable: bool, nmi_enable: bool, wake_up_from_light_sleep: bool )
fn is_listening(&self) -> bool
fn unlisten(&mut self)
fn clear_interrupt(&mut self)
fn listen(&mut self, event: Event)
source§impl<MODE, const GPIONUM: u8> InputPin for GpioPin<Input<MODE>, GPIONUM>where
GpioPin<Input<MODE>, GPIONUM>: GpioProperties,
impl<MODE, const GPIONUM: u8> InputPin for GpioPin<Input<MODE>, GPIONUM>where GpioPin<Input<MODE>, GPIONUM>: GpioProperties,
source§impl<const GPIONUM: u8> InputPin for GpioPin<Output<OpenDrain>, GPIONUM>where
GpioPin<Output<OpenDrain>, GPIONUM>: GpioProperties,
impl<const GPIONUM: u8> InputPin for GpioPin<Output<OpenDrain>, GPIONUM>where GpioPin<Output<OpenDrain>, GPIONUM>: GpioProperties,
source§impl<MODE, const GPIONUM: u8> OutputPin for GpioPin<Output<MODE>, GPIONUM>where
GpioPin<Output<MODE>, GPIONUM>: GpioProperties,
<GpioPin<Output<MODE>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
impl<MODE, const GPIONUM: u8> OutputPin for GpioPin<Output<MODE>, GPIONUM>where GpioPin<Output<MODE>, GPIONUM>: GpioProperties, <GpioPin<Output<MODE>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
source§impl<MODE, const GPIONUM: u8> StatefulOutputPin for GpioPin<Output<MODE>, GPIONUM>where
GpioPin<Output<MODE>, GPIONUM>: GpioProperties,
<GpioPin<Output<MODE>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
impl<MODE, const GPIONUM: u8> StatefulOutputPin for GpioPin<Output<MODE>, GPIONUM>where GpioPin<Output<MODE>, GPIONUM>: GpioProperties, <GpioPin<Output<MODE>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
source§impl<MODE, const GPIONUM: u8> ToggleableOutputPin for GpioPin<Output<MODE>, GPIONUM>where
GpioPin<Output<MODE>, GPIONUM>: GpioProperties,
<GpioPin<Output<MODE>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
impl<MODE, const GPIONUM: u8> ToggleableOutputPin for GpioPin<Output<MODE>, GPIONUM>where GpioPin<Output<MODE>, GPIONUM>: GpioProperties, <GpioPin<Output<MODE>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,
Auto Trait Implementations§
impl<MODE, const GPIONUM: u8> RefUnwindSafe for GpioPin<MODE, GPIONUM>where MODE: RefUnwindSafe,
impl<MODE, const GPIONUM: u8> Send for GpioPin<MODE, GPIONUM>where MODE: Send,
impl<MODE, const GPIONUM: u8> Sync for GpioPin<MODE, GPIONUM>where MODE: Sync,
impl<MODE, const GPIONUM: u8> Unpin for GpioPin<MODE, GPIONUM>where MODE: Unpin,
impl<MODE, const GPIONUM: u8> UnwindSafe for GpioPin<MODE, GPIONUM>where MODE: UnwindSafe,
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