pub fn read_unscaled(&mut self) -> Result<UnscaledMeasurement, Error<E>> {
        let mut data = [0; 6];
        self.i2c
            .write_read(self.address, &[Register::XOUT_L], &mut data)
            .map_err(Error::I2C)?;
        let m = match self.get_measurement_bits() {
            MeasurementBits::_8bit => convert_8bit(data[0], data[2], data[4]),
            MeasurementBits::_12bit => convert_12bit(
                u16::from(data[0]) | u16::from(data[1]) << 8,
                u16::from(data[2]) | u16::from(data[3]) << 8,
                u16::from(data[4]) | u16::from(data[5]) << 8,
            ),
            MeasurementBits::_14bit => convert_14bit(
                u16::from(data[0]) | u16::from(data[1]) << 8,
                u16::from(data[2]) | u16::from(data[3]) << 8,
                u16::from(data[4]) | u16::from(data[5]) << 8,
            ),
        };
        Ok(m)
    }
/// Read unscaled acceleration sensor data.
Read unscaled acceleration sensor data.
Read unscaled acceleration sensor data .
pub fn read_unscaled(&mut self) -> Result<UnscaledMeasurement, Error<E>> {
        let mut data = [0; 6];
        self.i2c
            .write_read(self.address, &[Register::XOUT_L], &mut data)
            .map_err(Error::I2C)?;
        let m = match self.get_measurement_bits() {
            MeasurementBits::_8bit => convert_8bit(data[0], data[2], data[4]),
            MeasurementBits::_12bit => convert_12bit(
                u16::from(data[0]) | u16::from(data[1]) << 8,
                u16::from(data[2]) | u16::from(data[3]) << 8,
                u16::from(data[4]) | u16::from(data[5]) << 8,
            ),
            MeasurementBits::_14bit => convert_14bit(
                u16::from(data[0]) | u16::from(data[1]) << 8,
                u16::from(data[2]) | u16::from(data[3]) << 8,
                u16::from(data[4]) | u16::from(data[5]) << 8,
            ),
        };
        Ok(m)
    }
pub fn read_unscaled ( & mut self ) -> Result < UnscaledMeasurement , Error < E > > { let mut data = [ 0 ; 6 ] ; self . i2c . write_read ( self . address , & [ Register :: XOUT_L ] , & mut data ) . map_err ( Error :: I2C ) ? ; let m = match self . get_measurement_bits ( ) { MeasurementBits :: _8bit => convert_8bit ( data [ 0 ] , data [ 2 ] , data [ 4 ] ) , MeasurementBits :: _12bit => convert_12bit ( u16 :: from ( data [ 0 ] ) | u16 :: from ( data [ 1 ] ) << 8 , u16 :: from ( data [ 2 ] ) | u16 :: from ( data [ 3 ] ) << 8 , u16 :: from ( data [ 4 ] ) | u16 :: from ( data [ 5 ] ) << 8 , ) , MeasurementBits :: _14bit => convert_14bit ( u16 :: from ( data [ 0 ] ) | u16 :: from ( data [ 1 ] ) << 8 , u16 :: from ( data [ 2 ] ) | u16 :: from ( data [ 3 ] ) << 8 , u16 :: from ( data [ 4 ] ) | u16 :: from ( data [ 5 ] ) << 8 , ) , } ; Ok ( m ) }
Read unscaled acceleration sensor data.
Read unscaled acceleration sensor data .
&mut self
&mut self