https://github.com/shymega/bmi270
This is an embedded-hal driver for the Bosch BMI260/270 inertial measurement unit.
https://github.com/shymega/bmi270
Last synced: over 1 year ago
JSON representation
This is an embedded-hal driver for the Bosch BMI260/270 inertial measurement unit.
- Host: GitHub
- URL: https://github.com/shymega/bmi270
- Owner: shymega
- License: mit
- Created: 2024-08-03T15:39:50.000Z (almost 2 years ago)
- Default Branch: bmi260
- Last Pushed: 2024-08-03T15:41:50.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T22:38:52.332Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust BMI260/270 driver
[](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#work-in-progress)
This is an [embedded-hal](https://github.com/rust-embedded/embedded-hal) driver for the Bosch BMI260/270 inertial measurement unit.
## Quick start
```rust
// ...
/// Create a new Bmi270 device using I2C with its alternative address (0x69).
/// Configure the max data burst to 255 bytes:
/// - used for the upload of the configuration during initialization.
/// - This is a limitation from your device or its HAL.
let mut bmi = Bmi270::new_i2c(i2c, I2cAddr::Alternative, Burst::Other(255));
/// Get the chip id. Should be 0x24 or 36 in decimal
let chip_id = bmi.get_chip_id().unwrap();
/// Initialize the senor.
/// During this process a configuration of > 8kB is uploaded to the sensor.
bmi.init(&config::BMI270_CONFIG_FILE).unwrap();
/// Enable power for the accelerometer and the gyroscope.
let pwr_ctrl = PwrCtrl { aux_en: false, gyr_en: true, acc_en: true, temp_en: false };
bmi.set_pwr_ctrl(pwr_ctrl).unwrap();
/// Read the raw data
let data = bmi.get_data().unwrap();
// ...
```