Skip to content

Commit

Permalink
Added basic driver that should be able to query pressure readings and…
Browse files Browse the repository at this point in the history
… perform basic configuration and error checking
  • Loading branch information
asasine committed May 24, 2024
1 parent 5563b78 commit f95cb65
Show file tree
Hide file tree
Showing 6 changed files with 1,831 additions and 6 deletions.
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
/target
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ keywords = ["embedded-hal", "async", "pressure", "sensor"]
categories = ["aerospace", "embedded", "hardware-support", "no-std"]

[dependencies]
embedded-hal-async = "1.0"
embedded-hal-async = "1.0.0"

[dev-dependencies]
embedded-hal-mock = { version = "0.10", default-features = false, features = [
embedded-hal-mock = { version = "0.10.0", default-features = false, features = [
"eh1",
"embedded-hal-async",
] }
tokio = { version = "1.37.0", features = ["macros", "rt"] }

[patch.crates-io]
# Until https://github.com/dbrgn/embedded-hal-mock/pull/119 is merged (async I2C mock)
embedded-hal-mock = { git = "https://github.com/asasine/embedded-hal-mock", branch = "feat/asasine/async-i2c" }
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# BMP390

[![Crates.io Version](https://img.shields.io/crates/v/bmp390?logo=rust)](https://crates.io/crates/bmp390)
[![Docs](https://docs.rs/bmp390/badge.svg)](https://docs.rs/bmp390)
[![CI](https://img.shields.io/github/actions/workflow/status/asasine/bmp390/rust.yaml?branch=main&logo=github&label=CI)](https://github.com/asasine/bmp390/actions/workflows/rust.yaml?query=branch%3Amain)
[![Crates.io Downloads](https://img.shields.io/crates/d/bmp390)](https://crates.io/crates/bmp390)

The BMP390 is a digital sensor with pressure and temperature measurement based on proven sensing principles. The sensor is more accurate than its predecessor BMP380, covering a wider measurement range. It offers new interrupt functionality, lower power, and a FIFO functionality. The integrated 512 byte FIFO buffer supports low power applications and prevents data loss in non-real-time systems.

[`Bmp390`](https://docs.rs/bmp390/latest/bmp390/struct.Bmp390.html) is a driver for the BMP390 sensor. It provides methods to read the temperature and pressure from the sensor over [I2C](https://en.wikipedia.org/wiki/I%C2%B2C). It is built on top of the [`embedded_hal_async::i2c`](https://docs.rs/embedded-hal-async/latest/embedded_hal_async/i2c/index.html) traits to be compatible with a wide range of embedded platforms.

## Datasheet
The [BMP390 Datasheet](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp390-ds002.pdf) contains detailed information about the sensor's features, electrical characteristics, and registers. This package implements the functionality described in the datasheet and references the relevant sections in the documentation.
Loading

0 comments on commit f95cb65

Please sign in to comment.