#embedded-hal-driver #pressure #temperature #sensor #infineon

no-std dps310

A platform agnostic driver to interface with the DPS310 barometric pressure & temp sensor through I2C

2 releases

0.1.2 Jan 25, 2021
0.1.1 Dec 25, 2020
0.1.0 Dec 25, 2020

#484 in Embedded development

21 downloads per month

MIT/Apache

22KB
446 lines

DPS310 - embedded-hal I2C driver crate

A platform agnostic driver to interface with the DPS310 barometric pressure & temp sensor. This driver uses I2C via embedded-hal. Note that the DPS310 also supports SPI, however that is not (yet) implemented in this driver.

Usage

Include this crate as a dependency in your Cargo.toml

[dependencies.dps310]
version = "<version>"

Use embedded-hal implementation to get I2C, then create a driver instance

use dps310::{DPS310, self};


let address = 0x77;
let mut dps = DPS310::new(i2c, address, &dps310::Config::new()).unwrap();

dps.trigger_measurement(true, true, true).unwrap();

if dps.data_ready().unwrap() {
    let pressure = dps.read_pressure_calibrated().unwrap();
    let temp = dps.read_temp_calibrated().unwrap();
    iprintln!(stim, "pressure: {:.1} [Pa]\t temp: {:.1} [˚C]", pressure, temp);
}

Dependencies

~37MB
~1M SLoC

Z`