Expand description
Implements a driver for accessing an MS5637 temperature and pressure sensor.
The library is built to work with [embedded-hal
] and has been tested on an
STM32L072 micro controller. The 1st-order temperature compensation is
implemented as per the datasheet definition, and inspired by the
implementation in the Sparkfun MS5637 library. The 2nd-order
temperature compensation is probably wrong and untested, but may be
activated using the feature flag second-order
. Additional height
adjustment methods available in the Sparkfun library were copied over
for convenience and may be enabled using the altitude-adjust
feature flag.
Usage
Using the library is very easy, just provide something that can delay execution by a specific time, and a reference to the I2C bus itself:
let mut ms5637 = ms5637::MS5637::new(&mut syst_delay, &mut i2c_bus);
let reading = ms5637.read_temperature_and_pressure_1st_order(&mut syst_delay, &mut i2c);
The library can be cooperatively used iwth other sensors on the same I2C-bus.
Structs
- Represents an I2C-connected MS5637 sensor.
- Represents the reading gotten from the sensor.
Enums
- Represents any error that may happen during communication.
- Resolution RMS, where a higher resolution means longer conversion time.
Constants
- 7-bit unshifted I2C address for the MS5637 sensor.