pub struct I2C<'d, T> { /* private fields */ }Expand description
I2C peripheral container (I2C)
Implementations§
source§impl<'d, T> I2C<'d, T>where
    T: Instance,
 
impl<'d, T> I2C<'d, T>where T: Instance,
sourcepub fn new<SDA, SCL>(
    i2c: impl Peripheral<P = T> + 'd,
    sda: impl Peripheral<P = SDA> + 'd,
    scl: impl Peripheral<P = SCL> + 'd,
    frequency: Rate<u32, 1, 1>,
    peripheral_clock_control: &mut PeripheralClockControl,
    clocks: &Clocks<'_>
) -> I2C<'d, T>where
    SDA: OutputPin + InputPin,
    SCL: OutputPin + InputPin,
 
pub fn new<SDA, SCL>( i2c: impl Peripheral<P = T> + 'd, sda: impl Peripheral<P = SDA> + 'd, scl: impl Peripheral<P = SCL> + 'd, frequency: Rate<u32, 1, 1>, peripheral_clock_control: &mut PeripheralClockControl, clocks: &Clocks<'_> ) -> I2C<'d, T>where SDA: OutputPin + InputPin, SCL: OutputPin + InputPin,
Create a new I2C instance This will enable the peripheral but the peripheral won’t get automatically disabled when this gets dropped.