[][src]Struct trinket_m0::gpio::Pin

pub struct Pin<I, M> where
    M: PinMode,
    I: PinId
{ /* fields omitted */ }

Represents a GPIO pin with a corresponding PinId and PinMode

Implementations

impl<I, M> Pin<I, M> where
    M: PinMode,
    I: PinId
[src]

pub fn into_floating_input(self, port: &mut Port) -> Pin<I, Input<Floating>>[src]

Configures the pin to operate as a floating input

pub fn into_pull_down_input(self, port: &mut Port) -> Pin<I, Input<PullDown>>[src]

Configures the pin to operate as a pulled down input pin

pub fn into_pull_up_input(self, port: &mut Port) -> Pin<I, Input<PullUp>>[src]

Configures the pin to operate as a pulled up input pin

pub fn into_open_drain_output(self, port: &mut Port) -> Pin<I, Output<PushPull>>[src]

Configures the pin to operate as an open drain output

pub fn into_readable_open_drain_output(
    self,
    port: &mut Port
) -> Pin<I, Output<Readable>>
[src]

Configures the pin to operate as an open drain output which can be read

pub fn into_push_pull_output(self, port: &mut Port) -> Pin<I, Output<PushPull>>[src]

Configures the pin to operate as a push-pull output

pub fn into_function_a(self, port: &mut Port) -> Pin<I, Alternate<A>>[src]

Configures the pin to operate with a peripheral

pub fn into_function_b(self, port: &mut Port) -> Pin<I, Alternate<B>>[src]

Configures the pin to operate with a peripheral

pub fn into_function_c(self, port: &mut Port) -> Pin<I, Alternate<C>>[src]

Configures the pin to operate with a peripheral

pub fn into_function_d(self, port: &mut Port) -> Pin<I, Alternate<D>>[src]

Configures the pin to operate with a peripheral

pub fn into_function_e(self, port: &mut Port) -> Pin<I, Alternate<E>>[src]

Configures the pin to operate with a peripheral

pub fn into_function_f(self, port: &mut Port) -> Pin<I, Alternate<F>>[src]

Configures the pin to operate with a peripheral

pub fn into_function_g(self, port: &mut Port) -> Pin<I, Alternate<G>>[src]

Configures the pin to operate with a peripheral

pub fn into_function_h(self, port: &mut Port) -> Pin<I, Alternate<H>>[src]

Configures the pin to operate with a peripheral

impl<I> Pin<I, Output<PushPull>> where
    I: PinId
[src]

pub fn internal_pull_up(&mut self, port: &mut Port, on: bool)[src]

Control state of the internal pull up

This function shouldn't exist. It is not possible to enable a pull-up resistor in an output mode.

impl<I, M> Pin<I, Output<M>> where
    M: OutputConfig,
    I: PinId
[src]

pub fn toggle(&mut self)[src]

Toggle the logic level of the pin; if it is currently high, set it low and vice versa.

Trait Implementations

impl<MODE> EicPin<ExtInt0<Pin<PA00, Alternate<A>>>> for Pin<PA00, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt0<Pin<PA16, Alternate<A>>>> for Pin<PA16, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt1<Pin<PA01, Alternate<A>>>> for Pin<PA01, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt1<Pin<PA17, Alternate<A>>>> for Pin<PA17, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt10<Pin<PA10, Alternate<A>>>> for Pin<PA10, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt10<Pin<PA30, Alternate<A>>>> for Pin<PA30, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt11<Pin<PA11, Alternate<A>>>> for Pin<PA11, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt11<Pin<PA31, Alternate<A>>>> for Pin<PA31, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt12<Pin<PA24, Alternate<A>>>> for Pin<PA24, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt13<Pin<PA25, Alternate<A>>>> for Pin<PA25, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt14<Pin<PA14, Alternate<A>>>> for Pin<PA14, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt15<Pin<PA15, Alternate<A>>>> for Pin<PA15, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt15<Pin<PA27, Alternate<A>>>> for Pin<PA27, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt2<Pin<PA02, Alternate<A>>>> for Pin<PA02, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt2<Pin<PA18, Alternate<A>>>> for Pin<PA18, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt3<Pin<PA03, Alternate<A>>>> for Pin<PA03, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt3<Pin<PA19, Alternate<A>>>> for Pin<PA19, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt4<Pin<PA04, Alternate<A>>>> for Pin<PA04, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt5<Pin<PA05, Alternate<A>>>> for Pin<PA05, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt6<Pin<PA06, Alternate<A>>>> for Pin<PA06, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt6<Pin<PA22, Alternate<A>>>> for Pin<PA22, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt7<Pin<PA07, Alternate<A>>>> for Pin<PA07, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt7<Pin<PA23, Alternate<A>>>> for Pin<PA23, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt8<Pin<PA28, Alternate<A>>>> for Pin<PA28, MODE> where
    MODE: PinMode
[src]

impl<MODE> EicPin<ExtInt9<Pin<PA09, Alternate<A>>>> for Pin<PA09, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA31, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA24, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA03, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA02, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA07, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA23, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA27, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA11, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA30, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA04, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA22, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA00, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA15, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA16, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA01, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA05, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA28, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA18, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA19, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA17, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA10, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA14, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA25, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA06, MODE> where
    MODE: PinMode
[src]

impl<'_, MODE> ExternalInterrupt for &'_ Pin<PA09, MODE> where
    MODE: PinMode
[src]

impl<I, M> From<Pin<I, M>> for Pin<I, M> where
    M: PinMode,
    I: PinId
[src]

Convert from a v1::Pin to a v2::Pin

impl<I, M> From<Pin<I, M>> for Pin<I, M> where
    M: PinMode,
    I: PinId
[src]

Convert from a v2::Pin to a v1::Pin

impl<I, M, C> IntoFunction<Pin<I, Alternate<C>>> for Pin<I, M> where
    C: AlternateConfig,
    M: PinMode,
    I: PinId
[src]

impl<S, P, I> Map<S, P> for Pin<I, <I as Map<S, P>>::Mode> where
    P: PadNum,
    I: PinId + Map<S, P>,
    S: Sercom
[src]

type Id = I

The PinId for the corresponding pin

type Mode = <I as Map<S, P>>::Mode

The PinMode for the corresponding pin

impl<I, M> OutputPin for Pin<I, Output<M>> where
    M: OutputConfig,
    I: PinId
[src]

type Error = ()

Error type

impl<S, P, I, M> PadPin<Pad<S, P, Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>>> for Pin<I, M> where
    P: PadNum,
    M: PinMode,
    I: PinId + Map<S, P>,
    S: Sercom,
    Pin<I, M>: IntoFunction<Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>>,
    Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>: Map<S, P>,
    <Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode> as Map<S, P>>::Id == <I as Map<S, P>>::Id,
    <Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode> as Map<S, P>>::Mode == <I as Map<S, P>>::Mode
[src]

Auto Trait Implementations

impl<I, M> Send for Pin<I, M> where
    I: Send,
    M: Send
[src]

impl<I, M> Sync for Pin<I, M> where
    I: Sync,
    M: Sync
[src]

impl<I, M> Unpin for Pin<I, M> where
    I: Unpin,
    M: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.