Skip to content

crosstyan/bmp180-nostd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Bosch BMP180 Driver [no-std, embedded-hal]

This is a platform agnostic Rust driver for the BMP180 pressure sensor using the embedded-hal traits.

This driver allows you to:

  • Measure the pressure in pascals. See: pressure_pa().
  • Measure the pressure in hectopascals. See: pressure_hpa().
  • Measure the pressure in kilopascals. See: pressure_kpa().
  • Measure the temperature in celsius. See: temperature_celsius().

The BMP180 is the function compatible successor of the BMP085, a new generation of high precision digital pressure sensors for consumer applications.

The ultra-low power, low voltage electronics of the BMP180 is optimized for use in mobile phones, PDAs, GPS navigation devices and outdoor equipment. With a low altitude noise of merely 0.25m at fast conversion time, the BMP180 offers superior performance. The I2C interface allows for easy system integration with a microcontroller.

The BMP180 is based on piezo-resistive technology for EMC robustness, high accuracy and linearity as well as long term stability.

Documentation:

Usage

To use this driver, import this crate and an embedded_hal implementation, then instantiate the appropriate device.

use linux_embedded_hal::I2cdev;
use mlx9061x::{Mlx9061x, SlaveAddr};

fn main() {
    // Create a delay abstraction based on SysTick
    let mut delayObj = hal::delay::Delay::new(cp.SYST, &clocks);

    let i2c = I2c::new(dp.I2C1, (scl, sda), 100.kHz(), &clocks); //100 kHz I2C Bus speed
    let mut sensor = bmp180::BMP180BarometerThermometer::new(i2c, boxy , bmp180::BMP180PressureMode::BMP180Standard);
    loop {
            let pressure_in_hpa: f32 = barometer.pressure_hpa();
            let pressure_temp_celsius: f32 = barometer.temperature_celsius();
    }
}

Support

For questions, issues, feature requests, and other changes, please file an issue in the github project.

License

Licensed under either of

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be triple licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%