This crate is a no_std driver for the LIS3DH accelerometer using SPI.
https://www.st.com/resource/en/datasheet/lis3dh.pdf
This driver is not consuming the SPI bus the communication is running on. Bus has to be passed as mutable reference when interacting with the LIS3DH.
Add this to your Cargo.toml:
toml
[dependencies]
lis3dh-spi = "0.0.5"
And this to your main.rs
```rust
let mut accelerometer = lis3dh_spi::Lis3dh::default();
accelerometer.setlpen(LPEn::HighResolutionNormalMode); accelerometer.setoutputdatarate(ODR::Hz400); accelerometer.writeallsettings(&mut chipselectpin, &mut spibus).ok(); let angleandgravityoffset = accelerometer.getangleandgravityoffset(&mut chipselectpin, &mut spi_bus).ok();
```
Licensed under either of
at your option.