pub struct I2C<'pio, P, SMI, SDA, SCL>{ /* private fields */ }Expand description
Instance of I2C Controller.
Implementations§
Source§impl<P, SMI, SDA, SCL> I2C<'_, P, SMI, SDA, SCL>
impl<P, SMI, SDA, SCL> I2C<'_, P, SMI, SDA, SCL>
Source§impl<'pio, P, SMI, SDA, SCL> I2C<'pio, P, SMI, SDA, SCL>
impl<'pio, P, SMI, SDA, SCL> I2C<'pio, P, SMI, SDA, SCL>
Sourcepub fn new(
pio: &'pio mut PIO<P>,
sda: SDA,
scl: SCL,
sm: UninitStateMachine<(P, SMI)>,
bus_freq: HertzU32,
clock_freq: HertzU32,
) -> Selfwhere
SDA: AnyPin<Function = FunctionNull>,
SDA::Id: ValidFunction<P::PinFunction>,
SCL: AnyPin<Function = FunctionNull>,
SCL::Id: ValidFunction<P::PinFunction>,
pub fn new(
pio: &'pio mut PIO<P>,
sda: SDA,
scl: SCL,
sm: UninitStateMachine<(P, SMI)>,
bus_freq: HertzU32,
clock_freq: HertzU32,
) -> Selfwhere
SDA: AnyPin<Function = FunctionNull>,
SDA::Id: ValidFunction<P::PinFunction>,
SCL: AnyPin<Function = FunctionNull>,
SCL::Id: ValidFunction<P::PinFunction>,
Creates a new instance of this driver.
Note: the PIO must have been reset before using this driver.
Source§impl<P, SMI, SDA, SCL> I2C<'_, P, SMI, SDA, SCL>where
P: PIOExt,
SMI: StateMachineIndex,
SDA: AnyPin,
SDA::Id: ValidFunction<SDA::Function>,
SCL: AnyPin,
SCL::Id: ValidFunction<SCL::Function>,
impl<P, SMI, SDA, SCL> I2C<'_, P, SMI, SDA, SCL>where
P: PIOExt,
SMI: StateMachineIndex,
SDA: AnyPin,
SDA::Id: ValidFunction<SDA::Function>,
SCL: AnyPin,
SCL::Id: ValidFunction<SCL::Function>,
Trait Implementations§
Source§impl<A, P, SMI, SDA, SCL> I2c<A> for I2C<'_, P, SMI, SDA, SCL>
impl<A, P, SMI, SDA, SCL> I2c<A> for I2C<'_, P, SMI, SDA, SCL>
Source§fn transaction(
&mut self,
address: A,
operations: &mut [Operation<'_>],
) -> Result<(), Self::Error>
fn transaction( &mut self, address: A, operations: &mut [Operation<'_>], ) -> Result<(), Self::Error>
Execute the provided operations on the I2C bus. Read more
Source§impl<A, P, SMI, SDA, SCL> Transactional<A> for I2C<'_, P, SMI, SDA, SCL>
impl<A, P, SMI, SDA, SCL> Transactional<A> for I2C<'_, P, SMI, SDA, SCL>
Source§impl<A, P, SMI, SDA, SCL> TransactionalIter<A> for I2C<'_, P, SMI, SDA, SCL>
impl<A, P, SMI, SDA, SCL> TransactionalIter<A> for I2C<'_, P, SMI, SDA, SCL>
Source§impl<A, P, SMI, SDA, SCL> WriteIterRead<A> for I2C<'_, P, SMI, SDA, SCL>
impl<A, P, SMI, SDA, SCL> WriteIterRead<A> for I2C<'_, P, SMI, SDA, SCL>
Auto Trait Implementations§
impl<'pio, P, SMI, SDA, SCL> Freeze for I2C<'pio, P, SMI, SDA, SCL>
impl<'pio, P, SMI, SDA, SCL> !RefUnwindSafe for I2C<'pio, P, SMI, SDA, SCL>
impl<'pio, P, SMI, SDA, SCL> Send for I2C<'pio, P, SMI, SDA, SCL>
impl<'pio, P, SMI, SDA, SCL> !Sync for I2C<'pio, P, SMI, SDA, SCL>
impl<'pio, P, SMI, SDA, SCL> Unpin for I2C<'pio, P, SMI, SDA, SCL>
impl<'pio, P, SMI, SDA, SCL> !UnwindSafe for I2C<'pio, P, SMI, SDA, SCL>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more