#instrument #pressure-sensor #driver #texas #i2c #mocking #i2c-transaction

ms5837

A driver for the MS5837 pressure/temperature sensor from Texas Instruments

5 releases

0.2.1 Jul 30, 2022
0.1.3 Jun 17, 2022
0.1.2 Jun 15, 2022
0.1.1 Jun 12, 2022
0.1.0 Jun 12, 2022

#1389 in Hardware support

MIT license

26KB
399 lines

ms5837-driver

Rust

A driver for the ms5837 temperature/pressure sensor from Texas Instruments.


lib.rs:

Getting started

A platform agnostic driver for the MS5837 from Texas Instruments.

This drivers supports reading the temperature/pressure from the on-chip ADC.

Example

use ms5837::OverSamplingRatio;
let pressure_sensor = ms5837::new(i2c);
let mut pressure_sensor = pressure_sensor.init().unwrap();
println!(
    "{:?}",
    pressure_sensor
        .read_temperature_and_pressure(OverSamplingRatio::R4096)
        .unwrap()
);

Dependencies

~69–250KB