4 releases (2 breaking)
Uses new Rust 2024
| 0.2.2 | May 4, 2025 |
|---|---|
| 0.2.1 |
|
| 0.1.1 | Jun 22, 2023 |
| 0.1.0 | Mar 24, 2023 |
| 0.0.0 | Jan 26, 2023 |
#392 in Hardware support
307 downloads per month
Used in adxl343-i2c-generic
3.5MB
1.5K
SLoC
LSM6DS3TR-C Rust
LSM6DS3TR-C 6-axis (DOF) IMU accelerometer & gyroscope rust driver library.
Example
use lsm6ds3tr::{interface::SpiInterface, AccelScale, LsmSettings, LSM6DS3TR};
// let spi_cs_pin = ...
// let spi_bus = ...
let mut imu = LSM6DS3TR::new(SpiInterface::new(spi_bus, spi_cs_pin)).with_settings(LsmSettings::basic();
imu.init().expect("LSM6DS3TR-C initialization failure!");
if let (Ok(xyz_a), Ok(xyz_g)) = (imu.read_accel(), imu.read_gyro()) {
dbg!(xyz_a, xyz_g);
}
See my LightCube lsm6 example for application usage.