Struct esp_hal::gpio::AnyPin

source ·
pub struct AnyPin<MODE, TYPE = ()> { /* private fields */ }

Implementations§

source§

impl<MODE, TYPE> AnyPin<MODE, TYPE>
where TYPE: PinType,

source

pub fn degrade(self) -> AnyPin<MODE>

source§

impl<MODE> AnyPin<MODE, InputOutputPinType>

source

pub fn into_input_type(self) -> AnyPin<MODE, InputOnlyPinType>

source§

impl<MODE> AnyPin<MODE, InputOutputAnalogPinType>

source

pub fn into_input_type(self) -> AnyPin<MODE, InputOnlyPinType>

source

pub fn into_input_output_type(self) -> AnyPin<MODE, InputOutputPinType>

source

pub fn into_input_only_analog_type(self) -> AnyPin<MODE, InputOnlyAnalogPinType>

source§

impl<MODE> AnyPin<MODE, InputOnlyAnalogPinType>

source

pub fn into_input_type(self) -> AnyPin<MODE, InputOnlyPinType>

Trait Implementations§

source§

impl<MODE, TYPE> ErrorType for AnyPin<Input<MODE>, TYPE>

§

type Error = Infallible

Error type
source§

impl<MODE, TYPE> ErrorType for AnyPin<Output<MODE>, TYPE>

§

type Error = Infallible

Error type
source§

impl<MODE, TYPE> From<AnyPin<MODE, TYPE>> for AnyPin<MODE>
where TYPE: PinType,

source§

fn from(pin: AnyPin<MODE, TYPE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 0>> for AnyPin<MODE>

source§

fn from(value: Gpio0<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 1>> for AnyPin<MODE>

source§

fn from(value: Gpio1<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 10>> for AnyPin<MODE>

source§

fn from(value: Gpio10<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 11>> for AnyPin<MODE>

source§

fn from(value: Gpio11<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 12>> for AnyPin<MODE>

source§

fn from(value: Gpio12<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 13>> for AnyPin<MODE>

source§

fn from(value: Gpio13<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 14>> for AnyPin<MODE>

source§

fn from(value: Gpio14<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 15>> for AnyPin<MODE>

source§

fn from(value: Gpio15<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 16>> for AnyPin<MODE>

source§

fn from(value: Gpio16<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 17>> for AnyPin<MODE>

source§

fn from(value: Gpio17<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 18>> for AnyPin<MODE>

source§

fn from(value: Gpio18<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 19>> for AnyPin<MODE>

source§

fn from(value: Gpio19<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 2>> for AnyPin<MODE>

source§

fn from(value: Gpio2<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 20>> for AnyPin<MODE>

source§

fn from(value: Gpio20<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 21>> for AnyPin<MODE>

source§

fn from(value: Gpio21<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 22>> for AnyPin<MODE>

source§

fn from(value: Gpio22<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 23>> for AnyPin<MODE>

source§

fn from(value: Gpio23<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 24>> for AnyPin<MODE>

source§

fn from(value: Gpio24<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 25>> for AnyPin<MODE>

source§

fn from(value: Gpio25<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 26>> for AnyPin<MODE>

source§

fn from(value: Gpio26<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 27>> for AnyPin<MODE>

source§

fn from(value: Gpio27<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 28>> for AnyPin<MODE>

source§

fn from(value: Gpio28<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 29>> for AnyPin<MODE>

source§

fn from(value: Gpio29<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 3>> for AnyPin<MODE>

source§

fn from(value: Gpio3<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 30>> for AnyPin<MODE>

source§

fn from(value: Gpio30<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 4>> for AnyPin<MODE>

source§

fn from(value: Gpio4<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 5>> for AnyPin<MODE>

source§

fn from(value: Gpio5<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 6>> for AnyPin<MODE>

source§

fn from(value: Gpio6<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 7>> for AnyPin<MODE>

source§

fn from(value: Gpio7<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 8>> for AnyPin<MODE>

source§

fn from(value: Gpio8<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE> From<GpioPin<MODE, 9>> for AnyPin<MODE>

source§

fn from(value: Gpio9<MODE>) -> Self

Converts to this type from the input type.
source§

impl<MODE, TYPE> InputPin for AnyPin<Input<MODE>, TYPE>

source§

fn is_high(&mut self) -> Result<bool, Self::Error>

Is the input pin high?
source§

fn is_low(&mut self) -> Result<bool, Self::Error>

Is the input pin low?
source§

impl<MODE, TYPE> InputPin for AnyPin<Input<MODE>, TYPE>

§

type Error = Infallible

Error type
source§

fn is_high(&self) -> Result<bool, Self::Error>

Is the input pin high?
source§

fn is_low(&self) -> Result<bool, Self::Error>

Is the input pin low?
source§

impl<MODE, TYPE> InputPin for AnyPin<MODE, TYPE>
where MODE: InputMode, TYPE: IsInputPin,

source§

fn set_to_input(&mut self) -> &mut Self

source§

fn enable_input(&mut self, on: bool) -> &mut Self

source§

fn enable_input_in_sleep_mode(&mut self, on: bool) -> &mut Self

source§

fn is_input_high(&self) -> bool

source§

fn connect_input_to_peripheral(&mut self, signal: InputSignal) -> &mut Self

source§

fn connect_input_to_peripheral_with_options( &mut self, signal: InputSignal, invert: bool, force_via_gpio_mux: bool ) -> &mut Self

source§

fn disconnect_input_from_peripheral(&mut self, signal: InputSignal) -> &mut Self

Remove a connected signal from this input pin. Read more
source§

impl<MODE, TYPE> OutputPin for AnyPin<MODE, TYPE>
where MODE: OutputMode, TYPE: IsOutputPin,

source§

impl<MODE, TYPE> OutputPin for AnyPin<Output<MODE>, TYPE>

§

type Error = Infallible

Error type
source§

fn set_low(&mut self) -> Result<(), Self::Error>

Drives the pin low Read more
source§

fn set_high(&mut self) -> Result<(), Self::Error>

Drives the pin high Read more
source§

fn set_state(&mut self, state: PinState) -> Result<(), Self::Error>

Drives the pin high or low depending on the provided value Read more
source§

impl<MODE, TYPE> OutputPin for AnyPin<Output<MODE>, TYPE>

source§

fn set_low(&mut self) -> Result<(), Self::Error>

Drives the pin low. Read more
source§

fn set_high(&mut self) -> Result<(), Self::Error>

Drives the pin high. Read more
source§

fn set_state(&mut self, state: PinState) -> Result<(), Self::Error>

Drives the pin high or low depending on the provided value. Read more
source§

impl<MODE, TYPE> Peripheral for AnyPin<MODE, TYPE>
where TYPE: PinType,

§

type P = AnyPin<MODE, TYPE>

Peripheral singleton type
source§

unsafe fn clone_unchecked(&mut self) -> Self::P

Unsafely clone (duplicate) a peripheral singleton. Read more
source§

fn into_ref<'a>(self) -> PeripheralRef<'a, Self::P>
where Self: 'a,

Convert a value into a PeripheralRef. Read more
source§

impl<MODE, TYPE> Pin for AnyPin<MODE, TYPE>
where TYPE: PinType,

source§

fn number(&self) -> u8

source§

fn sleep_mode(&mut self, on: bool)

source§

fn set_alternate_function(&mut self, alternate: AlternateFunction)

source§

fn is_listening(&self) -> bool

Checks if listening for interrupts is enabled for this Pin
source§

fn listen_with_options( &mut self, event: Event, int_enable: bool, nmi_enable: bool, wake_up_from_light_sleep: bool )

Listen for interrupts
source§

fn listen(&mut self, event: Event)

Listen for interrupts
source§

fn unlisten(&mut self)

Stop listening for interrupts
source§

fn is_interrupt_set(&self) -> bool

Checks if the interrupt status bit for this Pin is set
source§

fn clear_interrupt(&mut self)

Clear the interrupt status bit for this Pin
source§

impl<MODE, TYPE> StatefulOutputPin for AnyPin<Output<MODE>, TYPE>

source§

fn is_set_high(&mut self) -> Result<bool, Self::Error>

Is the pin in drive high mode? Read more
source§

fn is_set_low(&mut self) -> Result<bool, Self::Error>

Is the pin in drive low mode? Read more
source§

fn toggle(&mut self) -> Result<(), Self::Error>

Toggle pin output.
source§

impl<MODE, TYPE> StatefulOutputPin for AnyPin<Output<MODE>, TYPE>

source§

fn is_set_high(&self) -> Result<bool, Self::Error>

Is the pin in drive high mode? Read more
source§

fn is_set_low(&self) -> Result<bool, Self::Error>

Is the pin in drive low mode? Read more
source§

impl<MODE, TYPE> ToggleableOutputPin for AnyPin<Output<MODE>, TYPE>

§

type Error = Infallible

Error type
source§

fn toggle(&mut self) -> Result<(), Self::Error>

Toggle pin output.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 0>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio0<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 1>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio1<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 10>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio10<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 11>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio11<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 12>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio12<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 13>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio13<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 14>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio14<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 15>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio15<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 16>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio16<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 17>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio17<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 18>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio18<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 19>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio19<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 2>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio2<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 20>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio20<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 21>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio21<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 22>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio22<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 23>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio23<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 24>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio24<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 25>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio25<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 26>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio26<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 27>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio27<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 28>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio28<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 29>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio29<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 3>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio3<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 30>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio30<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 4>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio4<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 5>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio5<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 6>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio6<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 7>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio7<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 8>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio8<MODE>, Self::Error>

Performs the conversion.
source§

impl<MODE, TYPE> TryInto<GpioPin<MODE, 9>> for AnyPin<MODE, TYPE>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Gpio9<MODE>, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<MODE, TYPE> Freeze for AnyPin<MODE, TYPE>

§

impl<MODE, TYPE> RefUnwindSafe for AnyPin<MODE, TYPE>
where MODE: RefUnwindSafe, TYPE: RefUnwindSafe,

§

impl<MODE, TYPE> Send for AnyPin<MODE, TYPE>
where MODE: Send, TYPE: Send,

§

impl<MODE, TYPE> Sync for AnyPin<MODE, TYPE>
where MODE: Sync, TYPE: Sync,

§

impl<MODE, TYPE> Unpin for AnyPin<MODE, TYPE>
where MODE: Unpin, TYPE: Unpin,

§

impl<MODE, TYPE> UnwindSafe for AnyPin<MODE, TYPE>
where MODE: UnwindSafe, TYPE: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.