Rust KXCJ9 Ultra-Low-Power Tri-Axis Accelerometer
This is a platform agnostic Rust driver for the KXCJ9 ultra-low-power tri-axis accelerometer
(up to +/-16g) using the embedded-hal
traits.
This driver allows you to:
- Enable/disable the device. See
enable()
. - Read the acceleration measurement. See
read()
. - Read the unscaled acceleration measurement. See
read_unscaled()
. - Set resolution. See
set_resolution()
. - Set output data rate. See
set_output_data_rate()
. - Set +/- G range. See
set_scale()
. - Read
WHO_AM_I
register. Seewho_am_i()
. - Perform a software reset. See
reset()
. - Run a communication self-test. See
self_test()
.
The device
The KXCJ9 is a high-performance, ultra-low-power, tri-axis accelerometer designed for mobile applications. It offers our best power performance along with an embedded wake-up feature, Fast-mode I²C and up to 14-bit resolution. The KXCJ9 sensor offers improved shock, reflow, and temperature performance, and the ASIC has internal voltage regulators that allow operation from 1.8 V to 3.6 V within the specified product performance.
The communication is done through an I2C bidirectional bus.
Datasheet:
Application Note:
Usage
To use this driver, import this crate and an embedded_hal
implementation,
then instantiate the appropriate device.
Please find additional examples using hardware in this repository: driver-examples
extern crate kxcj9;
extern crate linux_embedded_hal as hal;
use ;
Support
For questions, issues, feature requests, and other changes, please file an issue in the github project.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.