Skip to main content

Crate ism330dhcx

Crate ism330dhcx 

Source
Expand description

This is a simple driver for ST’s ism330dhcx sensor.

§Quick Start

To declare a sensor is pretty simple:

let sensor = Ism330Dhcx::new(&mut i2c).unwrap();

The driver borrows the I2C bus for each operation.

To configure the sensor, use the high-level methods:

sensor.set_accel_odr(OdrXl::Hz52).unwrap();
sensor.set_boot(true).unwrap();

Register layouts, typed fields, reset values, and address namespaces are defined in registers. Feature modules expose the public I2C API through Accelerometer, Gyroscope, Configuration, Fifo, Motion, InterruptStatus, EmbeddedFunctions, SensorHub, Offsets, and Ois.

§Reference

Re-exports§

pub use accelerometer::AccelValue;
pub use accelerometer::Accelerometer;
pub use accelerometer::SENSORS_GRAVITY_STANDARD;
pub use configuration::Configuration;
pub use configuration::CoreField;
pub use embedded::EmbeddedFunctions;
pub use fifo::Fifo;
pub use fifo::Value;
pub use gyroscope::GyroValue;
pub use gyroscope::Gyroscope;
pub use gyroscope::SENSORS_DPS_TO_RADS;
pub use interrupt::InterruptStatus;
pub use interrupt::Interrupts;
pub use motion::Motion;
pub use offsets::Offsets;
pub use ois::Ois;
pub use sensor_hub::SensorHub;

Modules§

accelerometer
configuration
embedded
fifo
gyroscope
interrupt
motion
offsets
ois
registers
Register modules and address definitions.
sensor_hub

Structs§

Ism330Dhcx
Driver for the ISM330DHCX sensor.

Enums§

Error
Errors for the ISM330DHCX driver.

Constants§

DEFAULT_I2C_ADDRESS
Datasheet write address for the device. (D6h)