[−][src]Struct trinket_m0::sercom::Pad
Represents a SERCOM Pad configured to use a particular pin
Each Pad
is parameterized by a Sercom
, a PadNum
, and a third
type that implements Map
, which is used to determine the corresponding
Pin
and its configuration.
For the SAMD51 and SAME5x chips, Map
is implemented on instances of
IoSet
. The SAMD11 and SAMD21 do not have any concept of IOSET, so
Map
is instead implemented directly on the corresponding PinId
.
Each Pad
takes ownership of the corresponding Pin
for the duration
of its lifetime. Pad
s can be converted to and from Pin
s using the
Into
and From
traits.
Implementations
impl<S, P, M> Pad<S, P, M> where
P: PadNum,
M: Map<S, P>,
S: Sercom,
[src]
P: PadNum,
M: Map<S, P>,
S: Sercom,
pub fn new<O>(pin: Pin<<M as Map<S, P>>::Id, O>) -> Pad<S, P, M> where
O: PinMode,
Pin<<M as Map<S, P>>::Id, O>: Into<Pin<<M as Map<S, P>>::Id, <M as Map<S, P>>::Mode>>,
[src]
O: PinMode,
Pin<<M as Map<S, P>>::Id, O>: Into<Pin<<M as Map<S, P>>::Id, <M as Map<S, P>>::Mode>>,
Create a new SERCOM Pad
from a Pin
The specified Map
type must map the specified Sercom
and
PadNum
to the given Pin
pub fn free(self) -> Pin<<M as Map<S, P>>::Id, <M as Map<S, P>>::Mode>
[src]
pub fn as_any<T>(self) -> T where
T: AnyPad<Sercom = S, PadNum = P, Map = M>,
[src]
T: AnyPad<Sercom = S, PadNum = P, Map = M>,
Trait Implementations
impl<S, P, M> AnyPad for Pad<S, P, M> where
P: PadNum,
M: Map<S, P>,
S: Sercom,
[src]
P: PadNum,
M: Map<S, P>,
S: Sercom,
type Sercom = S
type PadNum = P
type Map = M
pub fn as_concrete(
self
) -> Pad<<Pad<S, P, M> as AnyPad>::Sercom, <Pad<S, P, M> as AnyPad>::PadNum, <Pad<S, P, M> as AnyPad>::Map>
[src]
self
) -> Pad<<Pad<S, P, M> as AnyPad>::Sercom, <Pad<S, P, M> as AnyPad>::PadNum, <Pad<S, P, M> as AnyPad>::Map>
impl<S, P, I> From<Pad<S, P, I>> for Pad<S, P, Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>> where
P: PadNum,
I: PinId + Map<S, P>,
S: Sercom,
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]
P: PadNum,
I: PinId + Map<S, P>,
S: Sercom,
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,
Convert from a v2
Pad
to a v1
Pad
The difference here is the Map
type. v2
Pad
s use PinId
s for
Map
, while v1
Pad
s use configured Pin
s. This conversion is
usually only applicable to thumbv6m chips. The thumbv7em chips usually
implement Map
on IoSet
pub fn from(
pad: Pad<S, P, I>
) -> Pad<S, P, Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>>
[src]
pad: Pad<S, P, I>
) -> Pad<S, P, Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>>
impl<S, P, M> From<Pad<S, P, M>> for Pin<<M as Map<S, P>>::Id, <M as Map<S, P>>::Mode> where
P: PadNum,
M: Map<S, P>,
S: Sercom,
[src]
P: PadNum,
M: Map<S, P>,
S: Sercom,
impl<S, P, I> From<Pad<S, P, Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>>> for Pad<S, P, I> where
P: PadNum,
I: PinId + Map<S, P>,
S: Sercom,
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]
P: PadNum,
I: PinId + Map<S, P>,
S: Sercom,
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,
Convert from a v1
Pad
to a v2
Pad
The difference here is the Map
type. v2
Pad
s use PinId
s for
Map
, while v1
Pad
s use configured Pin
s. This conversion is
usually only applicable to thumbv6m chips. The thumbv7em chips usually
implement Map
on IoSet
.
pub fn from(
pad: Pad<S, P, Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>>
) -> Pad<S, P, I>
[src]
pad: Pad<S, P, Pin<<I as Map<S, P>>::Id, <I as Map<S, P>>::Mode>>
) -> Pad<S, P, I>
impl<S, P, M, O> From<Pin<<M as Map<S, P>>::Id, O>> for Pad<S, P, M> where
P: PadNum,
M: Map<S, P>,
S: Sercom,
O: PinMode,
Pin<<M as Map<S, P>>::Id, O>: Into<Pin<<M as Map<S, P>>::Id, <M as Map<S, P>>::Mode>>,
[src]
P: PadNum,
M: Map<S, P>,
S: Sercom,
O: PinMode,
Pin<<M as Map<S, P>>::Id, O>: Into<Pin<<M as Map<S, P>>::Id, <M as Map<S, P>>::Mode>>,
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]
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,
Auto Trait Implementations
impl<S, P, M> Send for Pad<S, P, M> where
<M as Map<S, P>>::Id: Send,
<M as Map<S, P>>::Mode: Send,
[src]
<M as Map<S, P>>::Id: Send,
<M as Map<S, P>>::Mode: Send,
impl<S, P, M> Sync for Pad<S, P, M> where
<M as Map<S, P>>::Id: Sync,
<M as Map<S, P>>::Mode: Sync,
[src]
<M as Map<S, P>>::Id: Sync,
<M as Map<S, P>>::Mode: Sync,
impl<S, P, M> Unpin for Pad<S, P, M> where
<M as Map<S, P>>::Id: Unpin,
<M as Map<S, P>>::Mode: Unpin,
[src]
<M as Map<S, P>>::Id: Unpin,
<M as Map<S, P>>::Mode: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<P> OptionalPad for P where
P: AnyPad,
[src]
P: AnyPad,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<P> SomePad for P where
P: AnyPad,
[src]
P: AnyPad,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,