diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..8a60e81 --- /dev/null +++ b/README.md | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | # bosch-bme690 | ||
| 2 | |||
| 3 | AI-generated Rust port of the official Bosch BME690 environmental sensor driver. | ||
| 4 | |||
| 5 | ## About | ||
| 6 | |||
| 7 | This crate provides a `no_std` Rust driver for the BME690 environmental sensor, based on the [official Bosch C driver](https://github.com/boschsensortec/BME690_SensorAPI). The implementation has been automatically translated and verified to match the floating-point calculation formulas from the original C driver. | ||
| 8 | |||
| 9 | ## Features | ||
| 10 | |||
| 11 | - ✅ Temperature measurement (°C) | ||
| 12 | - ✅ Pressure measurement (Pa) | ||
| 13 | - ✅ Relative humidity measurement (%) | ||
| 14 | - ✅ Blocking and async implementations using `embedded-hal` traits | ||
| 15 | - ✅ `no_std` compatible | ||
| 16 | - ✅ Calculation formulas verified against official C driver | ||
| 17 | |||
| 18 | ## Limitations | ||
| 19 | |||
| 20 | - Gas resistance measurement not yet implemented | ||
| 21 | - Only forced mode supported (no sequential/parallel modes) | ||
| 22 | - Basic configuration only (1x oversampling) | ||
| 23 | |||
| 24 | ## Usage | ||
| 25 | |||
| 26 | ### Blocking | ||
| 27 | |||
| 28 | ```rust | ||
| 29 | use bosch_bme690::{AsyncBme690, DeviceAddr, Measurement}; | ||
| 30 | use embassy_time::Delay; | ||
| 31 | |||
| 32 | // Create driver instance | ||
| 33 | let i2c = /* your I2C peripheral */; | ||
| 34 | let delay = Delay; | ||
| 35 | let mut bme = AsyncBme690::new(i2c, delay, DeviceAddr::Primary).await.unwrap(); | ||
| 36 | |||
| 37 | // Take measurements | ||
| 38 | let data = bme.measure().await; | ||
| 39 | println!("Temperature: {} °C", data.temperature); | ||
| 40 | println!("Pressure: {} Pa", data.pressure); | ||
| 41 | println!("Humidity: {} %", data.humidity); | ||
| 42 | ``` | ||
| 43 | |||
| 44 | ### Async (embassy-rs) | ||
| 45 | |||
| 46 | ```rust | ||
| 47 | use bosch_bme690::{AsyncBme690, DeviceAddr}; | ||
| 48 | use embassy_time::Delay; | ||
| 49 | |||
| 50 | let i2c = /* your async I2C peripheral */; | ||
| 51 | let delay = Delay; | ||
| 52 | let mut bme = AsyncBme690::new(i2c, delay, DeviceAddr::Primary).await.unwrap(); | ||
| 53 | |||
| 54 | loop { | ||
| 55 | let data = bme.measure().await; | ||
| 56 | // Use measurement data... | ||
| 57 | Timer::after_secs(1).await; | ||
| 58 | } | ||
| 59 | ``` | ||
| 60 | |||
| 61 | ## I2C Addresses | ||
| 62 | |||
| 63 | - **Primary (0x76)**: SDO pin connected to GND - use `DeviceAddr::Primary` | ||
| 64 | - **Secondary (0x77)**: SDO pin connected to VDD - use `DeviceAddr::Secondary` | ||
| 65 | |||
| 66 | ## License | ||
| 67 | |||
| 68 | BSD-3-Clause (matching the original Bosch driver) | ||
| 69 | |||
| 70 | ## Acknowledgments | ||
| 71 | |||
| 72 | This is an AI-generated port of the official Bosch Sensortec BME690 driver. All calculation formulas and calibration logic are derived from the [original C implementation](https://github.com/boschsensortec/BME690_SensorAPI). | ||
