2 unstable releases
0.2.0 | Aug 10, 2022 |
---|---|
0.1.0 | Jul 28, 2022 |
#16 in #drones
61KB
1K
SLoC
ICM-20948 IMU Device Driver
This is a device-agnostic ICM-20948 (Inertial Measurement Unit) device driver.
The source code can be found on github.
The data sheet for this device can be found here.
See the documentation for current limitations and future plans.
Please create an issue on github or contact me if there are issues that need to be resolved.
Getting Started
The examples folder contains a number of examples to help you use the driver including a basic example, an example using the raw data interrupt, and an example using RTIC. All the examples are in both SPI and I2C.
lib.rs
:
Device agnostic driver for the icm-20948 IMU (inertial measurement unit). The driver depends on embedded-hal, so as long as the HAL you use implements those traits, then this driver will be compatible.
The driver is split into two parts: an I2C part and an SPI part. All functions are implemented for both bus types.
You can instantiate multiple objects if you have multiple IMUs. The driver assumes control of the bus and thus it is recommended to use shared-bus if you have multiple device drivers that need control of the bus.
Currently, there is no support for the magnetometer, temperature sensor, the sensor acting like an I2C master, the FIFO, the FSYNC, or the DMP. I am hoping to add support for the FIFO, magnetometer, and temperature sensor soon. See the change log in the repo for recent changes.
Examples
Examples can be found here.
Features
This crate has implemented defmt for the IcmError type. This can be enabled as a feature of this crate. This implementation assumes that the SPI/I2C error type also implements defmt. The HAL that you are using may have a feature you need to enable for this.
Data Sheet
The data sheet for this device can be found here.
Repository
The github repo can be found here.
Dependencies
~1.2–1.7MB
~30K SLoC