Struct esp32c3_hal::gpio::GpioPin

source ·
pub struct GpioPin<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8>where
    RA: BankGpioRegisterAccess,
    IRA: InteruptStatusRegisterAccess,
    PINTYPE: PinType,
    SIG: GpioSignal,{ /* private fields */ }

Implementations§

source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: PinType, SIG: GpioSignal,

source

pub fn into_floating_input( self ) -> GpioPin<Input<Floating>, RA, IRA, PINTYPE, SIG, GPIONUM>

source

pub fn into_pull_up_input( self ) -> GpioPin<Input<PullUp>, RA, IRA, PINTYPE, SIG, GPIONUM>

source

pub fn into_pull_down_input( self ) -> GpioPin<Input<PullDown>, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

source

pub fn into_push_pull_output( self ) -> GpioPin<Output<PushPull>, RA, IRA, PINTYPE, SIG, GPIONUM>

source

pub fn into_open_drain_output( self ) -> GpioPin<Output<OpenDrain>, RA, IRA, PINTYPE, SIG, GPIONUM>

source

pub fn into_alternate_1( self ) -> GpioPin<Alternate<AF1>, RA, IRA, PINTYPE, SIG, GPIONUM>

source

pub fn into_alternate_2( self ) -> GpioPin<Alternate<AF2>, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsAnalogPin, SIG: GpioSignal,

source

pub fn into_analog(self) -> GpioPin<Analog, RA, IRA, PINTYPE, SIG, GPIONUM>

Trait Implementations§

source§

impl<RA, IRA, PINTYPE, SIG, const GPIONUM: u8> From<GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM>> for GpioPin<Input<Floating>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

source§

fn from( pin: GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM> ) -> GpioPin<Input<Floating>, RA, IRA, PINTYPE, SIG, GPIONUM>

Converts to this type from the input type.
source§

impl<RA, IRA, PINTYPE, SIG, const GPIONUM: u8> From<GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM>> for GpioPin<Input<PullDown>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsInputPin, SIG: GpioSignal,

source§

fn from( pin: GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM> ) -> GpioPin<Input<PullDown>, RA, IRA, PINTYPE, SIG, GPIONUM>

Converts to this type from the input type.
source§

impl<RA, IRA, PINTYPE, SIG, const GPIONUM: u8> From<GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM>> for GpioPin<Input<PullUp>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

source§

fn from( pin: GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM> ) -> GpioPin<Input<PullUp>, RA, IRA, PINTYPE, SIG, GPIONUM>

Converts to this type from the input type.
source§

impl<RA, IRA, PINTYPE, SIG, const GPIONUM: u8> From<GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM>> for GpioPin<Output<OpenDrain>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

source§

fn from( pin: GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM> ) -> GpioPin<Output<OpenDrain>, RA, IRA, PINTYPE, SIG, GPIONUM>

Converts to this type from the input type.
source§

impl<RA, IRA, PINTYPE, SIG, const GPIONUM: u8> From<GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM>> for GpioPin<Output<PushPull>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

source§

fn from( pin: GpioPin<Unknown, RA, IRA, PINTYPE, SIG, GPIONUM> ) -> GpioPin<Output<PushPull>, RA, IRA, PINTYPE, SIG, GPIONUM>

Converts to this type from the input type.
source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> InputPin for GpioPin<Input<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: PinType, SIG: GpioSignal,

§

type Error = Infallible

Error type
source§

fn is_high( &self ) -> Result<bool, <GpioPin<Input<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM> as InputPin>::Error>

Is the input pin high?
source§

fn is_low( &self ) -> Result<bool, <GpioPin<Input<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM> as InputPin>::Error>

Is the input pin low?
source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> InputPin for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: PinType, SIG: GpioSignal,

source§

fn set_to_input(&mut self) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn enable_input( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn enable_input_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn is_input_high(&self) -> bool

source§

fn connect_input_to_peripheral_with_options( &mut self, signal: InputSignal, invert: bool, force_via_gpio_mux: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn disconnect_input_from_peripheral( &mut self, signal: InputSignal ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

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

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

source§

impl<RA, IRA, PINTYPE, SIG, const GPIONUM: u8> InputPin for GpioPin<Output<OpenDrain>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: PinType, SIG: GpioSignal,

§

type Error = Infallible

Error type
source§

fn is_high( &self ) -> Result<bool, <GpioPin<Output<OpenDrain>, RA, IRA, PINTYPE, SIG, GPIONUM> as InputPin>::Error>

Is the input pin high?
source§

fn is_low( &self ) -> Result<bool, <GpioPin<Output<OpenDrain>, RA, IRA, PINTYPE, SIG, GPIONUM> as InputPin>::Error>

Is the input pin low?
source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> OutputPin for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

source§

fn set_to_open_drain_output( &mut self ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn set_to_push_pull_output( &mut self ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn enable_output( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn set_output_high( &mut self, high: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn set_drive_strength( &mut self, strength: DriveStrength ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn enable_open_drain( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn internal_pull_up_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn internal_pull_down_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn enable_output_in_sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

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, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn disconnect_peripheral_from_output( &mut self ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

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

fn internal_pull_up( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn internal_pull_down( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn connect_peripheral_to_output(&mut self, signal: OutputSignal) -> &mut Self

source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> OutputPin for GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

§

type Error = Infallible

Error type
source§

fn set_high( &mut self ) -> Result<(), <GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM> as OutputPin>::Error>

Drives the pin high Read more
source§

fn set_low( &mut self ) -> Result<(), <GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM> as OutputPin>::Error>

Drives the pin low 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, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> Peripheral for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: PinType, SIG: GpioSignal,

§

type P = GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

Peripheral singleton type
source§

unsafe fn clone_unchecked( &mut self ) -> <GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM> as Peripheral>::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, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> Pin for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: PinType, SIG: GpioSignal,

source§

fn number(&self) -> u8

source§

fn sleep_mode( &mut self, on: bool ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

fn set_alternate_function( &mut self, alternate: AlternateFunction ) -> &mut GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>

source§

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

source§

fn is_listening(&self) -> bool

source§

fn unlisten(&mut self)

source§

fn clear_interrupt(&mut self)

source§

fn is_pcore_interrupt_set(&self) -> bool

source§

fn is_pcore_non_maskable_interrupt_set(&self) -> bool

source§

fn is_acore_interrupt_set(&self) -> bool

source§

fn is_acore_non_maskable_interrupt_set(&self) -> bool

source§

fn enable_hold(&mut self, _on: bool)

source§

fn listen(&mut self, event: Event)

source§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> StatefulOutputPin for GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

source§

fn is_set_high( &self ) -> Result<bool, <GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM> as OutputPin>::Error>

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

fn is_set_low( &self ) -> Result<bool, <GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM> as OutputPin>::Error>

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

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> ToggleableOutputPin for GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM>where RA: BankGpioRegisterAccess, IRA: InteruptStatusRegisterAccess, PINTYPE: IsOutputPin, SIG: GpioSignal,

§

type Error = Infallible

Error type
source§

fn toggle( &mut self ) -> Result<(), <GpioPin<Output<MODE>, RA, IRA, PINTYPE, SIG, GPIONUM> as ToggleableOutputPin>::Error>

Toggle pin output.

Auto Trait Implementations§

§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> RefUnwindSafe for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where IRA: RefUnwindSafe, MODE: RefUnwindSafe, PINTYPE: RefUnwindSafe, RA: RefUnwindSafe, SIG: RefUnwindSafe,

§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> Send for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where IRA: Send, MODE: Send, PINTYPE: Send, RA: Send, SIG: Send,

§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> Sync for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where IRA: Sync, MODE: Sync, PINTYPE: Sync, RA: Sync, SIG: Sync,

§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> Unpin for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where IRA: Unpin, MODE: Unpin, PINTYPE: Unpin, RA: Unpin, SIG: Unpin,

§

impl<MODE, RA, IRA, PINTYPE, SIG, const GPIONUM: u8> UnwindSafe for GpioPin<MODE, RA, IRA, PINTYPE, SIG, GPIONUM>where IRA: UnwindSafe, MODE: UnwindSafe, PINTYPE: UnwindSafe, RA: UnwindSafe, SIG: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.