#pressure-sensor #temperature #pressure #i2c #no-alloc #no-std

no-std ms5637

no-std I2C driver for the MS5637 temperature and pressure sensor

1 unstable release

0.1.0 Dec 14, 2023

#1243 in Hardware support

MIT license

24KB
318 lines

I2C-driver for MS5637

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.

Dependencies

~175KB