Struct atsamd_hal::sercom::i2c::Pads

source ·
pub struct Pads<S, SDA, SCL>where
    S: Sercom,
    SDA: IsI2cPad<PadNum = Pad0, Sercom = S>,
    SCL: IsI2cPad<PadNum = Pad1, Sercom = S>,{ /* private fields */ }
Expand description

Container for a set of SERCOM Pads

See the module-level documentation for more details on specifying a Pads type and creating instances.

Implementations§

source§

impl<S, DI, CI> Pads<S, Pin<DI, <DI as GetPad<S>>::PinMode>, Pin<CI, <CI as GetPad<S>>::PinMode>>where S: Sercom, DI: GetPad<S>, CI: GetPad<S>, Pad<S, DI>: IsI2cPad<PadNum = Pad0, Sercom = S>, Pad<S, CI>: IsI2cPad<PadNum = Pad1, Sercom = S>,

source

pub fn new(sda: impl AnyPin<Id = DI>, scl: impl AnyPin<Id = CI>) -> Self

Create a new Pads struct. SDA must always be SERCOM pad 0, and SCL SERCOM pad 1.{

source§

impl<S, SDA, SCL> Pads<S, SDA, SCL>where S: Sercom, SDA: IsI2cPad<PadNum = Pad0, Sercom = S>, SCL: IsI2cPad<PadNum = Pad1, Sercom = S>,

source

pub fn free(self) -> (SDA, SCL)

Consume the Pads and return each individual Pin

Trait Implementations§

source§

impl<S, SDA, SCL> PadSet for Pads<S, SDA, SCL>where S: Sercom, SDA: IsI2cPad<PadNum = Pad0, Sercom = S>, SCL: IsI2cPad<PadNum = Pad1, Sercom = S>,

§

type Sercom = S

§

type Sda = SDA

§

type Scl = SCL

Auto Trait Implementations§

§

impl<S, SDA, SCL> RefUnwindSafe for Pads<S, SDA, SCL>where S: RefUnwindSafe, SCL: RefUnwindSafe, SDA: RefUnwindSafe,

§

impl<S, SDA, SCL> Send for Pads<S, SDA, SCL>where S: Send, SCL: Send, SDA: Send,

§

impl<S, SDA, SCL> Sync for Pads<S, SDA, SCL>where S: Sync, SCL: Sync, SDA: Sync,

§

impl<S, SDA, SCL> Unpin for Pads<S, SDA, SCL>where S: Unpin, SCL: Unpin, SDA: Unpin,

§

impl<S, SDA, SCL> UnwindSafe for Pads<S, SDA, SCL>where S: UnwindSafe, SCL: UnwindSafe, SDA: 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> Same<T> for T

§

type Output = T

Should always be Self
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.