ms5637

Crates.ioms5637
lib.rsms5637
version0.1.0
sourcesrc
created_at2023-12-14 23:20:10.171976
updated_at2023-12-14 23:20:10.171976
descriptionno-std I2C driver for the MS5637 temperature and pressure sensor.
homepage
repositoryhttps://github.com/decryphe/ms5637
max_upload_size
id1070489
size24,821
(decryphe)

documentation

README

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.

Commit count: 1

cargo fmt