| Crates.io | lsm6dsox |
| lib.rs | lsm6dsox |
| version | 2.0.0 |
| created_at | 2024-02-16 14:11:07.069301+00 |
| updated_at | 2025-02-06 10:00:10.433354+00 |
| description | Platform-agnostic embedded-hal driver for the ST LSM6DSOX iNEMO inertial module |
| homepage | |
| repository | https://git.openlogisticsfoundation.org/silicon-economy/libraries/serum/lsm6dsox |
| max_upload_size | |
| id | 1142467 |
| size | 74,769 |
Platform-agnostic embedded-hal driver for the STMicroelectronics LSM6DSOX iNEMO inertial module.
Provided functionality is inspired by the C implementation from ST, but tries to provide a higher level interface where possible.
To provide measurements the [accelerometer] traits and [measurements] crate are utilized.
For application hints please also refer to the application note provided by ST.
Accelerometer trait implementationembedded-hal I²C supportuse accelerometer::Accelerometer;
use lsm6dsox::*;
let mut lsm = lsm6dsox::Lsm6dsox::new(i2c, SlaveAddress::Low, delay);
lsm.setup()?;
lsm.set_accel_sample_rate(DataRate::Freq52Hz)?;
lsm.set_accel_scale(AccelerometerScale::Accel16g)?;
if let Ok(reading) = lsm.accel_norm() {
println!("Acceleration: {:?}", reading);
}
Open Logistics Foundation License
Version 1.3, January 2023
See the LICENSE file in the top-level directory.
Fraunhofer IML Embedded Rust Group - embedded-rust@iml.fraunhofer.de