lsm6ds3tr

Crates.iolsm6ds3tr
lib.rslsm6ds3tr
version0.2.2
created_at2023-01-26 13:44:12.662818+00
updated_at2025-05-04 22:15:03.491394+00
descriptionLSM6DS3TR 6-axis (DOF) IMU accelerometer & gyroscope rust driver library
homepage
repositoryhttps://gitlab.com/mtczekajlo/lsm6ds3tr-rs
max_upload_size
id768529
size4,888,735
Marcin Czekajło (mtczekajlo)

documentation

README

LSM6DS3TR-C Rust

Crates.io Docs

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.

Commit count: 32

cargo fmt