SMI230 linux driver
SMI230 is a system-in-package inertial measurement unit which offers accurate acceleration and angular rate measurements.
Due to system-in-package approach of SMI230 (two sensors in single package), the gyroscope and acceleration data is acquired in a non-synchronized manner.
However, synchronization between accelerometer and gyroscope can be achieved:
The software modules in this repository are provided as reference for SMI230 users and shall demonstrate exemplarily the usage of the following features:
Note: SMI230 is rather an Industrial I/O (IIO) than an input device. Therefore, we now implement SMI230 as an IIO driver (see GitHub). Further development will only happen on the IIO driver, not on the input driver anymore.
Note: The sensor driver utilizes a sensor API, which is following BMI08x’s sensor API, available on GitHub.
Note: The data synchronization feature utilizes the sensor’s configuration, which is following BMI08x sensor configuration, available on GitHub.
See LICENSE file
User space
-------------------------------------------------------
| |
sysfs dev
\ /
input-subsystem
|
sensor_API <-- smi230_driver --> smi230_SPI/I2C_driver
|
SPI/I2C_bus
|
-------------------------------------------------------
Hardware
Userspace
The driver exposes a device file node under /dev/input/event*, which can be read as a normal Linux file. Tools like evtest can also be used for read data out. E.g.:
sudo evtest /dev/input/event0
The data will be displayed on the console with timestamp.
Sysfs
The driver also exposes a set of sysfs nodes under /sys/devices/virtual/input/input*
, where users can get information about the sensor and also control the sensor. E.g.:
```
cat /sys/devices/virtual/input/SMI230ACC/pwr_cfg
echo 0 > /sys/devices/virtual/input/SMI230ACC/pwr_cfg
echo 3 > /sys/devices/virtual/input/SMI230ACC/pwr_cfg
cat /sys/devices/virtual/input/SMI230GYRO/pwr_cfg
echo 0 > /sys/devices/virtual/input/SMI230GYRO/pwr_cfg
echo 3 > /sys/devices/virtual/input/SMI230GYRO/pwr_cfg
cat /sys/devices/virtual/input/SMI230GYRO/chip_id
cat /sys/devices/virtual/input/SMI230ACC/data_sync
cat /sys/devices/virtual/input/SMI230ACC/acc_value
cat /sys/devices/virtual/input/SMI230GYRO/gyro_value
```