Crates.io | ism330is-rs |
lib.rs | ism330is-rs |
version | 1.0.0 |
created_at | 2025-08-19 07:26:53.373754+00 |
updated_at | 2025-08-19 07:26:53.373754+00 |
description | Platform-agnostic driver for the ISM330IS 6-axis IMU with integrated ISPU for edge AI, sensor hub support, programmable interrupts, and ultra-low-power operation. |
homepage | |
repository | https://github.com/STMicroelectronics/ism330is-rs |
max_upload_size | |
id | 1801513 |
size | 153,177 |
Provides a platform-agnostic, no_std-compatible driver for the ST ISM330IS IMU, supporting both I2C and SPI communication interfaces.
The ISM330IS is a 6-axis IMU (inertial measurement unit) system-in-package featuring a 3-axis digital accelerometer and a 3-axis digital gyroscope, boosting performance at 0.59 mA in high-performance mode and enabling always-on lowpower features for optimal motion results in industrial and IoT solutions. The ISM330IS has a full-scale acceleration range of ±2/±4/±8/±16 g and an angular rate range of ±125/±250/±500/±1000/±2000 dps.
The ISM330IS features programmable interrupts and an on-chip sensor hub, which includes up to six sensors: the internal accelerometer & gyroscope and four external sensors.
The ISM330IS embeds a new ST category of processing, ISPU (intelligent sensor processing unit) to support real-time applications that rely on sensor data. The ISPU is an ultralow-power, high-performance programmable core, which can execute signal processing and AI algorithms in the edge. The main benefits of the ISPU are C programming and an enhanced ecosystem with libraries and 3rd party tools/IDE.
Its optimized ultralow-power hardware circuitry for real-time execution of the algorithms is a state-of-the-art feature for any wireless sensor node from small equipment or accessories to enterprise solutions for Industry 5.0 (for example, anomaly detection, asset tracking, factory automation, and so forth).
The part number ISM330ISN, moreover, can execute the machine learning libraries generated by ST's NanoEdge AI Studio, a powerful tool that allows anyone to easily create machine learning libraries with on-sensor learning.
The ISM330IS and ISM330ISN are available in a plastic, land grid array (LGA) package.
For more info, please visit the device page at https://www.st.com/en/mems-and-sensors/ism330is.html
Add the driver to your Cargo.toml
dependencies:
[dependencies]
ism330is-rs = "0.1.0"
Or, add it directly from the terminal:
cargo add ism330is-rs
Include the crate and its prelude
use ism330is_rs as ism330is;
use ism330is::*;
use ism330is::prelude::*;
Create an instance of the driver with the new_<bus>
associated function, by passing an I2C (embedded_hal::i2c::I2c
) instance and I2C address, or an SPI (embedded_hal::spi::SpiDevice
) instance, along with a timing peripheral.
An example with I2C:
let mut sensor = Ism330is::new_i2c(i2c, I2CAddress::I2cAddL, delay);
This step ensures correct communication with the sensor. It returns a unique ID to verify the sensor's identity.
let whoami = sensor.device_id_get().unwrap();
if whoami != ID {
panic!("Invalid sensor ID");
}
See details in specific examples; the following are common api calls:
// Restore default configuration
sensor.software_reset().unwrap();
// Disable I3C interface (if needed)
// sensor.i3c_disable_set(ISM330IS_I3C_DISABLE).unwrap();
// Enable Block Data Update (if needed)
sensor.block_data_update_set(true).unwrap();
// Set Output Data Rate for accelerometer and gyroscope
sensor.xl_data_rate_set(XlDataRate::_12_5hzHp).unwrap();
sensor.gy_data_rate_set(GyDataRate::_12_5hzHp).unwrap();
// Set full scale for accelerometer and gyroscope
sensor.xl_full_scale_set(XlFullScale::_2g).unwrap();
sensor.gy_full_scale_set(GyFullScale::_2000dps).unwrap();
Distributed under the BSD-3 Clause license.
More Information: http://www.st.com.
Copyright (C) 2025 STMicroelectronics