Struct lsm303c::Lsm303c

source ·
pub struct Lsm303c<I2C> { /* private fields */ }
Expand description

LSM303C driver

Implementations

Creates a new Lsm303c driver from a I2C peripheral with default configuration.

Creates a new Lsm303c driver from a I2C peripheral with provided LsmConfig.

Reads the accelerometer WHO_AM_I register

Reads the magnetometer WHO_AM_I register

Configures device using provided [MpuConfig].

Reads and returns unscaled accelerometer measurements (LSB).

Reads and returns accelerometer measurements converted to g.

Reads and returns magnetometer measurements converted to mgauss.

Reads and returns unscaled magnetometer measurements (LSB).

Temperature sensor measurement in Celcius

  • Range: [-40, +85] C

Raw temperature sensor measurement

  • Resolution: 12-bit

Reads and returns raw unscaled Accelerometer + Magnetometer + Thermometer measurements (LSB).

Reads and returns Accelerometer + Magnetometer + Thermometer measurements scaled and converted to respective units.

Configures the accelerometer output data rate

Configures the magnetometer output data rate (MagDataRate).

Configures accelerometer full reading scale (AccelScale).

Configures accelerometer block data update (AccelBlockDataUpdate).

Enables or disables accelerometer axes (AccelAxesControl).

Configures temperature control (TempControl).

Configures magnetometer mode (MagMode).

Configures magnetometer x and y axes operative mode (MagXYOperativeMode).

Configures magnetometer z axis operative mode ([MagXOperativeMode]).

Configures magnetometer full reading scale (MagScale).

Configures magnetometer block data update (MagBlockDataUpdate).

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.