pub struct Pads<S, I, DI = NoneT, DO = NoneT, CK = NoneT, SS = NoneT>where
S: Sercom,
I: IoSet,
DI: OptionalPad,
DO: OptionalPad,
CK: OptionalPad,
SS: OptionalPad,{ /* private fields */ }
Expand description
Container for a set of SERCOM pads
See the spi module documentation for more details on declaring and
instantiating a Pads
type.
Implementations
sourceimpl<S, I, DI, DO, CK, SS> Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: OptionalPad,
DO: OptionalPad,
CK: OptionalPad,
SS: OptionalPad,
impl<S, I, DI, DO, CK, SS> Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: OptionalPad,
DO: OptionalPad,
CK: OptionalPad,
SS: OptionalPad,
sourcepub fn data_in<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, Pad<S, Id>, DO, CK, SS>where
Id: GetPad<S>,
Id::PadNum: Dipo,
Pad<S, Id>: InIoSet<I>,
pub fn data_in<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, Pad<S, Id>, DO, CK, SS>where
Id: GetPad<S>,
Id::PadNum: Dipo,
Pad<S, Id>: InIoSet<I>,
Set the DI
pad
In a MasterMode
, this is MISO. In Slave
OpMode
, this is
MOSI.
sourcepub fn data_out<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, DI, Pad<S, Id>, CK, SS>where
Id: GetPad<S>,
Id::PadNum: Dopo,
Pad<S, Id>: InIoSet<I>,
pub fn data_out<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, DI, Pad<S, Id>, CK, SS>where
Id: GetPad<S>,
Id::PadNum: Dopo,
Pad<S, Id>: InIoSet<I>,
Set the DO
pad
In a MasterMode
, this is MOSI. In Slave
OpMode
, this is
MISO.
sourcepub fn sclk<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, DI, DO, Pad<S, Id>, SS>where
Id: GetPad<S, PadNum = Pad1>,
Pad<S, Id>: InIoSet<I>,
pub fn sclk<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, DI, DO, Pad<S, Id>, SS>where
Id: GetPad<S, PadNum = Pad1>,
Pad<S, Id>: InIoSet<I>,
Set the SCK
pad, which is always Pad1
sourcepub fn ss<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, DI, DO, CK, Pad<S, Id>>where
Id: GetPad<S, PadNum = Pad2>,
Pad<S, Id>: InIoSet<I>,
pub fn ss<Id>(
self,
pin: impl AnyPin<Id = Id>
) -> Pads<S, I, DI, DO, CK, Pad<S, Id>>where
Id: GetPad<S, PadNum = Pad2>,
Pad<S, Id>: InIoSet<I>,
Set the SS
pad, which is always Pad2
sourcepub fn free(self) -> (DI, DO, CK, SS)
pub fn free(self) -> (DI, DO, CK, SS)
Trait Implementations
sourceimpl<S, I, DI, DO, CK, SS> DipoDopo for Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: OptionalPad,
DO: OptionalPad,
CK: OptionalPad,
SS: OptionalPad,
DI::PadNum: Dipo,
DO::PadNum: Dopo,
impl<S, I, DI, DO, CK, SS> DipoDopo for Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: OptionalPad,
DO: OptionalPad,
CK: OptionalPad,
SS: OptionalPad,
DI::PadNum: Dipo,
DO::PadNum: Dopo,
Lift the implementations of DipoDopo
from implementations on
OptionalPadNum
s to the corresponding Pads
types.
sourceimpl<S, I, DI, DO, CK, SS> PadSet for Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: OptionalPad,
DO: OptionalPad,
CK: OptionalPad,
SS: OptionalPad,
impl<S, I, DI, DO, CK, SS> PadSet for Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: OptionalPad,
DO: OptionalPad,
CK: OptionalPad,
SS: OptionalPad,
sourceimpl<S, I, DI, DO, CK, SS> ValidPads for Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: SomePad,
DO: SomePad,
CK: SomePad,
SS: OptionalPad,
Pads<S, I, DI, DO, CK, SS>: DipoDopo,
impl<S, I, DI, DO, CK, SS> ValidPads for Pads<S, I, DI, DO, CK, SS>where
S: Sercom,
I: IoSet,
DI: SomePad,
DO: SomePad,
CK: SomePad,
SS: OptionalPad,
Pads<S, I, DI, DO, CK, SS>: DipoDopo,
type Capability = Duplex
Auto Trait Implementations
impl<S, I, DI, DO, CK, SS> RefUnwindSafe for Pads<S, I, DI, DO, CK, SS>where
CK: RefUnwindSafe,
DI: RefUnwindSafe,
DO: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
SS: RefUnwindSafe,
impl<S, I, DI, DO, CK, SS> Send for Pads<S, I, DI, DO, CK, SS>where
CK: Send,
DI: Send,
DO: Send,
I: Send,
S: Send,
SS: Send,
impl<S, I, DI, DO, CK, SS> Sync for Pads<S, I, DI, DO, CK, SS>where
CK: Sync,
DI: Sync,
DO: Sync,
I: Sync,
S: Sync,
SS: Sync,
impl<S, I, DI, DO, CK, SS> Unpin for Pads<S, I, DI, DO, CK, SS>where
CK: Unpin,
DI: Unpin,
DO: Unpin,
I: Unpin,
S: Unpin,
SS: Unpin,
impl<S, I, DI, DO, CK, SS> UnwindSafe for Pads<S, I, DI, DO, CK, SS>where
CK: UnwindSafe,
DI: UnwindSafe,
DO: UnwindSafe,
I: UnwindSafe,
S: UnwindSafe,
SS: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more