Skip to content

Rechenmaschine/ms56xx

Repository files navigation

MS56xx device drivers

CI

no_std drivers for the TE Connectivity MS56xx family of barometric pressure sensors.

  • Supports MS5607, MS5611, and MS5637 sensors
  • I2C and SPI interfaces supported (SPI for MS5607/MS5611 only)
  • Async and blocking APIs via embedded-hal traits
  • Second-order temperature compensation
  • CRC validation of calibration data

The MS5607 driver is actively used in several projects at https://github.com/aris-space and deployed on flight hardware.

Crates

Supported Sensors

All sensors use a similar communication protocol but differ in their temperature compensation algorithms and features.

Usage Examples

Using the MS5607 crate

use ms5607_rs::{Ms5607, Oversampling};

// I2C (CSB pin high = address 0x76)
let mut sensor = Ms5607::new_i2c(i2c, true);

// Or SPI
let mut sensor = Ms5607::new_spi(spi);

// Async API
sensor.init(&mut delay).await?;
let measurement = sensor.measure(Oversampling::Osr2048, &mut delay).await?;

// Blocking API
sensor.init_blocking(&mut delay)?;
let measurement = sensor.measure_blocking(Oversampling::Osr2048, &mut delay)?;

Using the MS5611 crate

use ms5611_rs::{Ms5611, Oversampling};

// Same API as MS5607
let mut sensor = Ms5611::new_i2c(i2c, true);
sensor.init(&mut delay).await?;
let measurement = sensor.measure(Oversampling::Osr4096, &mut delay).await?;

Using the MS5637 crate

use ms5637_rs::{Ms5637, Oversampling};

// I2C only, fixed address 0x76
let mut sensor = Ms5637::new_i2c(i2c);
sensor.init(&mut delay).await?;
// Extended oversampling range
let measurement = sensor.measure(Oversampling::Osr8192, &mut delay).await?;

Cargo Features

  • defmt-03: Enables defmt::Format for all public types

License

MIT or Apache-2.0 license, at your option.

About

Rust no_std drivers for MS56xx series barometric pressure sensors

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors

Languages