aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-12-16 22:11:04 +0000
committerdiogo464 <[email protected]>2025-12-16 22:11:04 +0000
commitbbe6a9302ce52bba5e4db96562b9abea11ef08b0 (patch)
treed1795fd46295b30b0d81fb0208680acfdb9ff79a /README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md72
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
3AI-generated Rust port of the official Bosch BME690 environmental sensor driver.
4
5## About
6
7This 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
29use bosch_bme690::{AsyncBme690, DeviceAddr, Measurement};
30use embassy_time::Delay;
31
32// Create driver instance
33let i2c = /* your I2C peripheral */;
34let delay = Delay;
35let mut bme = AsyncBme690::new(i2c, delay, DeviceAddr::Primary).await.unwrap();
36
37// Take measurements
38let data = bme.measure().await;
39println!("Temperature: {} °C", data.temperature);
40println!("Pressure: {} Pa", data.pressure);
41println!("Humidity: {} %", data.humidity);
42```
43
44### Async (embassy-rs)
45
46```rust
47use bosch_bme690::{AsyncBme690, DeviceAddr};
48use embassy_time::Delay;
49
50let i2c = /* your async I2C peripheral */;
51let delay = Delay;
52let mut bme = AsyncBme690::new(i2c, delay, DeviceAddr::Primary).await.unwrap();
53
54loop {
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
68BSD-3-Clause (matching the original Bosch driver)
69
70## Acknowledgments
71
72This 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).