pub fn init(
        self,
        clocks: &mut GenericClockController,
        sercom4: SERCOM4,
        mclk: &mut MCLK,
    ) -> Lis3dh<I2CMaster4<I2c0Sda, I2c0Scl>> {
        // The accelerometer is connected to the Wio Terminal's `I2C0` bus, so
        // based on the possible padouts listed in the datasheet it must use
        // `SERCOM4` and in turn `I2CMaster4`.
        let gclk0 = clocks.gclk0();
        let i2c = I2CMaster4::new(
            &clocks.sercom4_core(&gclk0).unwrap(),
            400.khz(),
            sercom4,
            mclk,
            self.sda.into(),
            self.scl.into(),
        );

        // The schematic states that the alternate I2C address `0x19` is used,
        // but that doesn't appear to work!
        Lis3dh::new(i2c, SlaveAddr::Default).unwrap()
    }
/// Initialize the LIS3DH accelerometer using the correct pins and
// peripherals. Use the driver's default settings.
Initialize the LIS3DH accelerometer using the correct pins and
peripherals. Use the driver's default settings.
Initialize the LIS3DH accelerometer using the correct pins and peripherals . Use the driver ' s default settings .
pub fn init(
        self,
        clocks: &mut GenericClockController,
        sercom4: SERCOM4,
        mclk: &mut MCLK,
    ) -> Lis3dh<I2CMaster4<I2c0Sda, I2c0Scl>> {
        // The accelerometer is connected to the Wio Terminal's `I2C0` bus, so
        // based on the possible padouts listed in the datasheet it must use
        // `SERCOM4` and in turn `I2CMaster4`.
        let gclk0 = clocks.gclk0();
        let i2c = I2CMaster4::new(
            &clocks.sercom4_core(&gclk0).unwrap(),
            400.khz(),
            sercom4,
            mclk,
            self.sda.into(),
            self.scl.into(),
        );
        // The schematic states that the alternate I2C address `0x19` is used,
        // but that doesn't appear to work!
        Lis3dh::new(i2c, SlaveAddr::Default).unwrap()
    }
pub fn init ( self , clocks : & mut GenericClockController , sercom4 : SERCOM4 , mclk : & mut MCLK , ) -> Lis3dh < I2CMaster4 < I2c0Sda , I2c0Scl > > { // The accelerometer is connected to the Wio Terminal's `I2C0` bus, so // based on the possible padouts listed in the datasheet it must use // `SERCOM4` and in turn `I2CMaster4`. let gclk0 = clocks . gclk0 ( ) ; let i2c = I2CMaster4 :: new ( & clocks . sercom4_core ( & gclk0 ) . unwrap ( ) , 400 . khz ( ) , sercom4 , mclk , self . sda . into ( ) , self . scl . into ( ) , ) ; // The schematic states that the alternate I2C address `0x19` is used, // but that doesn't appear to work! Lis3dh :: new ( i2c , SlaveAddr :: Default ) . unwrap ( ) }
Initialize the LIS3DH accelerometer using the correct pins and
peripherals.
Initialize the LIS3DH accelerometer using the correct pins and peripherals .
self
clocks
&mut GenericClockController
sercom4
SERCOM4
mclk
&mut MCLK
self
clocks
&mut GenericClockController
sercom4
SERCOM4
mclk
&mut MCLK