{"id":16064665,"url":"https://github.com/eldruin/bmi160-rs","last_synced_at":"2025-05-07T03:25:32.523Z","repository":{"id":57520077,"uuid":"239197155","full_name":"eldruin/bmi160-rs","owner":"eldruin","description":"Platform-agnostic Rust driver for the BMI160 inertial measurement unit (IMU)","archived":false,"fork":false,"pushed_at":"2024-05-21T09:49:21.000Z","size":53,"stargazers_count":14,"open_issues_count":1,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-03T19:49:23.043Z","etag":null,"topics":["accelerometer","driver","embedded-hal-driver","gyroscope","i2c","imu","imu-sensor","inertial","magnetometer","rust","spi"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldruin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-08T20:06:16.000Z","updated_at":"2025-03-29T21:30:11.000Z","dependencies_parsed_at":"2024-01-17T12:32:32.732Z","dependency_job_id":"4fb68039-aeb6-4285-a571-6d7a88e76693","html_url":"https://github.com/eldruin/bmi160-rs","commit_stats":{"total_commits":49,"total_committers":5,"mean_commits":9.8,"dds":"0.12244897959183676","last_synced_commit":"7bb0559c9c54f59c8bf75aa5d2ca31a472d585a1"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fbmi160-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fbmi160-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fbmi160-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fbmi160-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldruin","download_url":"https://codeload.github.com/eldruin/bmi160-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252805457,"owners_count":21807009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accelerometer","driver","embedded-hal-driver","gyroscope","i2c","imu","imu-sensor","inertial","magnetometer","rust","spi"],"created_at":"2024-10-09T05:09:02.480Z","updated_at":"2025-05-07T03:25:32.500Z","avatar_url":"https://github.com/eldruin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust BMI160 Inertial Measurement Unit Driver\n\n[![crates.io](https://img.shields.io/crates/v/bmi160.svg)](https://crates.io/crates/bmi160)\n[![Docs](https://docs.rs/bmi160/badge.svg)](https://docs.rs/bmi160)\n![MSRV](https://img.shields.io/badge/rustc-1.62+-blue.svg)\n[![Build Status](https://github.com/eldruin/bmi160-rs/workflows/Build/badge.svg)](https://github.com/eldruin/bmi160-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/eldruin/bmi160-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/bmi160-rs?branch=master)\n\nThis is a platform agnostic Rust driver for the BMI160 small, low-power\ninertial measurement unit using the [`embedded-hal`] traits.\n\nThis driver allows you to:\n- Get the latest sensor data. See: `data()`.\n- Get the latest sensor data scaled to the configured ranges. See: `data_scaled()`.  \n- Set the accelerometer, gyroscope and magnetometer power mode. See: `set_accel_power_mode()`.\n- Set the accelerometer and gyro range, See: `set_accel_range()` and `set_gyro_range()`.\n- Get the sensor status. See: `status()`.\n- Get power mode. See: `power_mode()`.\n- Get chip ID. See: `chip_id()`.\n\n\u003c!-- TODO\n[Introductory blog post]()\n--\u003e\n\nThe BMI160 is an inertial measurement unit (IMU) consisting of a\nstate-of-the-art 3-axis, low-g accelerometer and a low power 3-axis\ngyroscope. It has been designed for low power, high precision 6-axis and\n9-axis applications in mobile phones, tablets, wearable devices, remote\ncontrols, game controllers, head-mounted devices and toys.\n\nThe BMI160 is available in a compact 14-pin 2.5 × 3.0 × 0.83 mm3 LGA\npackage. When accelerometer and gyroscope are in full operation mode, power\nconsumption is typically 925 μA, enabling always-on applications in\nbattery driven devices.\n\nFurther Bosch Sensortec sensors, e.g. geomagnetic (BMM150) can be connected\nas slave via a secondary I2C interface. In this configuration, the BMI160\ncontrols the data acquisition of the external sensor and the synchronized\ndata of all sensors is stored the register data and can be additionally\nstored in the built-in FIFO.\n\nBesides the flexible primary interface (I2C or SPI) that is used to connect\nto the host, BMI160 provides an additional secondary interface. This\nsecondary interface can be used in SPI mode for OIS (optical image\nstabilization) applications in conjunction with camera modules, or in\nadvanced gaming use cases.\n\n[Datasheet](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmi160-ds000.pdf)\n\n## Usage\n\nTo use this driver, import this crate and an `embedded_hal` implementation,\nthen instantiate the device.\n\nPlease find additional examples using hardware in this repository: [driver-examples]\n\n[driver-examples]: https://github.com/eldruin/driver-examples\n\n```rust\nextern crate linux_embedded_hal as hal;\nuse bmi160::{AccelerometerPowerMode, Bmi160, GyroscopePowerMode, SensorSelector, SlaveAddr};\n\nfn main() {\n    let dev = hal::I2cdev::new(\"/dev/i2c-1\").unwrap();\n    let address = SlaveAddr::default();\n    let mut imu = Bmi160::new_with_i2c(dev, address);\n    imu.set_accel_power_mode(AccelerometerPowerMode::Normal)\n        .unwrap();\n    imu.set_gyro_power_mode(GyroscopePowerMode::Normal).unwrap();\n    loop {\n        let data = imu.data(SensorSelector::new().accel().gyro()).unwrap();\n        let accel = data.accel.unwrap();\n        let gyro = data.gyro.unwrap();\n        println!(\n            \"Accelerometer: x {:5} y {:5} z {:5}, \\\n             Gyroscope: x {:5} y {:5} z {:5}\",\n            accel.x, accel.y, accel.z, gyro.x, gyro.y, gyro.z\n        );\n    }\n}\n```\n\n## Features\n\n- `defmt-03`: derives `defmt::Format` for public data types.\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.62 and up. It *might*\ncompile with older versions but that may change in any new patch release.\n\n## Support\n\nFor questions, issues, feature requests, and other changes, please file an\n[issue in the github project](https://github.com/eldruin/bmi160-rs/issues).\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n[`embedded-hal`]: https://github.com/rust-embedded/embedded-hal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fbmi160-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldruin%2Fbmi160-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fbmi160-rs/lists"}