Type Alias Gpio2

Source
pub type Gpio2<MODE> = GpioPin<MODE, 2>;

Aliased Type§

struct Gpio2<MODE> { /* private fields */ }

Implementations

Source§

impl<MODE> GpioPin<MODE, 2>

Source

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

Source§

impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>
where GpioPin<MODE, GPIONUM>: GpioProperties, <GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsOutputPin,

Source

pub fn into_push_pull_output(self) -> GpioPin<Output<PushPull>, GPIONUM>

Configures the pin to operate as an push pull output pin

Source

pub fn into_open_drain_output(self) -> GpioPin<Output<OpenDrain>, GPIONUM>

Configures the pin to operate as an open drain output pin

Source

pub fn into_inverted_push_pull_output( self, ) -> GpioPin<InvertedOutput<PushPull>, GPIONUM>

Configures the pin to operate as an inverted push pull output pin. Only suitable to be passed into an peripheral driver

Source

pub fn into_inverted_open_drain_output( self, ) -> GpioPin<InvertedOutput<OpenDrain>, GPIONUM>

Configures the pin to operate as an open drain output pin. Only suitable to be passed into an peripheral driver

Source

pub fn into_alternate_1(self) -> GpioPin<Alternate<AF1>, GPIONUM>

Source

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,

Source

pub fn into_analog(self) -> GpioPin<Analog, GPIONUM>

Source§

impl<MODE, const GPIONUM: u8> GpioPin<MODE, GPIONUM>
where GpioPin<MODE, GPIONUM>: GpioProperties,

Source

pub fn into_floating_input(self) -> GpioPin<Input<Floating>, GPIONUM>

Configures the pin to operate as a floating input pin

Source

pub fn into_pull_up_input(self) -> GpioPin<Input<PullUp>, GPIONUM>

Configures the pin to operate as a pulled up input pin

Source

pub fn into_pull_down_input(self) -> GpioPin<Input<PullDown>, GPIONUM>

Configures the pin to operate as a pulled down input pin

Source

pub fn into_inverted_floating_input( self, ) -> GpioPin<InvertedInput<Floating>, GPIONUM>

Configures the pin to operate as an inverted floating input pin. Only suitable to be passed into a peripheral driver.

Source

pub fn into_inverted_pull_up_input( self, ) -> GpioPin<InvertedInput<PullUp>, GPIONUM>

Configures the pin to operate as an inverted pulled up input pin. Only suitable to be passed into a peripheral driver.

Source

pub fn into_inverted_pull_down_input( self, ) -> GpioPin<InvertedInput<PullDown>, GPIONUM>

Configures the pin to operate as an inverted pulled down input pin. Only suitable to be passed into a peripheral driver.

Trait Implementations

Source§

impl Channel<ADC1> for GpioPin<Analog, 2>

Source§

type ID = u8

Channel ID type Read more
Source§

fn channel() -> u8

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8.
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,

Source§

fn from(pin: GpioPin<Unknown, GPIONUM>) -> GpioPin<Analog, GPIONUM>

Converts to this type from the input type.
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,

Source§

fn from(pin: GpioPin<Unknown, GPIONUM>) -> GpioPin<Input<Floating>, GPIONUM>

Converts to this type from the input type.
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,

Source§

fn from(pin: GpioPin<Unknown, GPIONUM>) -> GpioPin<Input<PullDown>, GPIONUM>

Converts to this type from the input type.
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,

Source§

fn from(pin: GpioPin<Unknown, GPIONUM>) -> GpioPin<Input<PullUp>, GPIONUM>

Converts to this type from the input type.
Source§

impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<InvertedInput<Floating>, GPIONUM>

Source§

fn from( pin: GpioPin<Unknown, GPIONUM>, ) -> GpioPin<InvertedInput<Floating>, GPIONUM>

Converts to this type from the input type.
Source§

impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<InvertedInput<PullDown>, GPIONUM>

Source§

fn from( pin: GpioPin<Unknown, GPIONUM>, ) -> GpioPin<InvertedInput<PullDown>, GPIONUM>

Converts to this type from the input type.
Source§

impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<InvertedInput<PullUp>, GPIONUM>

Source§

fn from( pin: GpioPin<Unknown, GPIONUM>, ) -> GpioPin<InvertedInput<PullUp>, GPIONUM>

Converts to this type from the input type.
Source§

impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<InvertedOutput<OpenDrain>, GPIONUM>
where GpioPin<InvertedOutput<OpenDrain>, GPIONUM>: GpioProperties, <GpioPin<InvertedOutput<OpenDrain>, GPIONUM> as GpioProperties>::PinType: IsOutputPin, GpioPin<Unknown, GPIONUM>: GpioProperties, <GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsOutputPin,

Source§

fn from( pin: GpioPin<Unknown, GPIONUM>, ) -> GpioPin<InvertedOutput<OpenDrain>, GPIONUM>

Converts to this type from the input type.
Source§

impl<const GPIONUM: u8> From<GpioPin<Unknown, GPIONUM>> for GpioPin<InvertedOutput<PushPull>, GPIONUM>
where GpioPin<InvertedOutput<PushPull>, GPIONUM>: GpioProperties, <GpioPin<InvertedOutput<PushPull>, GPIONUM> as GpioProperties>::PinType: IsOutputPin, GpioPin<Unknown, GPIONUM>: GpioProperties, <GpioPin<Unknown, GPIONUM> as GpioProperties>::PinType: IsOutputPin,

Source§

fn from( pin: GpioPin<Unknown, GPIONUM>, ) -> GpioPin<InvertedOutput<PushPull>, GPIONUM>

Converts to this type from the input type.
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,

Source§

fn from(pin: GpioPin<Unknown, GPIONUM>) -> GpioPin<Output<OpenDrain>, GPIONUM>

Converts to this type from the input type.
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,

Source§

fn from(pin: GpioPin<Unknown, GPIONUM>) -> GpioPin<Output<PushPull>, GPIONUM>

Converts to this type from the input type.
Source§

impl<MODE> GpioProperties for GpioPin<MODE, 2>

Source§

type Bank = Bank0GpioRegisterAccess

Source§

type InterruptStatus = InterruptStatusRegisterAccessBank0

Source§

type Signals = Gpio2Signals

Source§

type PinType = InputOutputAnalogPinType

Source§

impl<MODE, const GPIONUM: u8> InputPin for GpioPin<MODE, GPIONUM>
where GpioPin<MODE, GPIONUM>: GpioProperties, MODE: InputMode,

Source§

fn set_to_input(&mut self) -> &mut GpioPin<MODE, GPIONUM>

Source§

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

Source§

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

Source§

fn is_input_high(&self) -> bool

Source§

fn connect_input_to_peripheral( &mut self, signal: InputSignal, ) -> &mut GpioPin<MODE, GPIONUM>

Source§

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>

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

impl<MODE> IntoLowPowerPin<2> for GpioPin<MODE, 2>

Source§

impl<MODE, const GPIONUM: u8> OutputPin for GpioPin<MODE, GPIONUM>
where GpioPin<MODE, GPIONUM>: GpioProperties, <GpioPin<MODE, GPIONUM> as GpioProperties>::PinType: IsOutputPin, MODE: OutputMode,

Source§

fn set_to_open_drain_output(&mut self) -> &mut GpioPin<MODE, GPIONUM>

Source§

fn set_to_push_pull_output(&mut self) -> &mut GpioPin<MODE, GPIONUM>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn connect_peripheral_to_output( &mut self, signal: OutputSignal, ) -> &mut GpioPin<MODE, 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, GPIONUM>

Source§

fn disconnect_peripheral_from_output(&mut self) -> &mut GpioPin<MODE, GPIONUM>

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

impl<MODE, const GPIONUM: u8> Peripheral for GpioPin<MODE, GPIONUM>
where GpioPin<MODE, GPIONUM>: GpioProperties,

Source§

type P = GpioPin<MODE, GPIONUM>

Peripheral singleton type
Source§

unsafe fn clone_unchecked( &mut self, ) -> <GpioPin<MODE, 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, const GPIONUM: u8> Pin for GpioPin<MODE, GPIONUM>
where GpioPin<MODE, GPIONUM>: GpioProperties,

Source§

fn number(&self) -> u8

Source§

fn sleep_mode(&mut self, on: bool)

Source§

fn set_alternate_function(&mut self, alternate: AlternateFunction)

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 is_listening(&self) -> bool

Checks if listening for interrupts is enabled for this Pin
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§

fn listen(&mut self, event: Event)

Listen for interrupts
Source§

impl<MODE> RTCPin for GpioPin<MODE, 2>

Source§

fn rtc_set_config(&mut self, input_enable: bool, mux: bool, func: RtcFunction)

Set the LP properties of the pin. If mux is true then then pin is routed to LP_IO, when false it is routed to IO_MUX.

Source§

unsafe fn apply_wakeup(&mut self, wakeup: bool, level: u8)

Source§

fn rtcio_pad_hold(&mut self, enable: bool)

Source§

impl<MODE> RTCPinWithResistors for GpioPin<MODE, 2>

Source§

fn rtcio_pullup(&mut self, enable: bool)

Source§

fn rtcio_pulldown(&mut self, enable: bool)

Source§

impl<MODE, const GPIONUM: u8> InputPin for GpioPin<Input<MODE>, GPIONUM>
where GpioPin<Input<MODE>, GPIONUM>: GpioProperties,

Source§

type Error = Infallible

Error type
Source§

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

Is the input pin high?
Source§

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

Is the input pin low?
Source§

impl<const GPIONUM: u8> InputPin for GpioPin<Output<OpenDrain>, GPIONUM>

Source§

type Error = Infallible

Error type
Source§

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

Is the input pin high?
Source§

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

Is the input pin low?
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,

Source§

type Error = Infallible

Error type
Source§

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

Drives the pin high Read more
Source§

fn set_low( &mut self, ) -> Result<(), <GpioPin<Output<MODE>, 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, const GPIONUM: u8> StatefulOutputPin for GpioPin<Output<MODE>, GPIONUM>
where GpioPin<Output<MODE>, GPIONUM>: GpioProperties, <GpioPin<Output<MODE>, GPIONUM> as GpioProperties>::PinType: IsOutputPin,

Source§

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

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

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

Is the pin in drive low mode? Read more
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,

Source§

type Error = Infallible

Error type
Source§

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

Toggle pin output.