Giter Club home page Giter Club logo

smi230-linux-driver's Introduction

SMI230 Input Sensor-API and Sensor Driver

Table of Contents

Introduction

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

  • data synchronization.
  • data collection from FIFO.

Note: SMI230 is rather an Industrial I/O (IIO) than an input device. Therefore we now implement SMI230 as an IIO driver github. The further development will only happen on the IIO driver not on input driver any more.

Note: The sensor driver utilizes sensor api, which is following BMI08x sensor api available on github.

Note: The data synchronization feature utilizes sensor configuration, which is following BMI08x sensor configuration available on github.

License

See LICENSE file

Sensor interfaces

  • I2C
  • SPI

Architecture

                  User space
-------------------------------------------------------
                 |          |
               sysfs       dev
                 \          /
               input-subsystem
	             |
sensor_API <-- smi230_driver --> smi230_SPI/I2C_driver
                                           |
                                      SPI/I2C_bus
                                           |
-------------------------------------------------------
                  Hardware

Operation examples

  1. 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. Eg.:
sudo evtest /dev/input/event0

The data will be displayed on the console with timestamp.

  1. 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. Eg.:
# read the acc power config
cat /sys/devices/virtual/input/SMI230ACC/pwr_cfg

# set the acc power config active, this command is needed if acc needs to be fully fuctional.
echo 0 > /sys/devices/virtual/input/SMI230ACC/pwr_cfg

# set the acc power config suspend
echo 3 > /sys/devices/virtual/input/SMI230ACC/pwr_cfg

# read the gyro power config
cat /sys/devices/virtual/input/SMI230GYRO/pwr_cfg

# set the gyro power config active, this command is needed if gyro needs to be fully fuctional.
echo 0 > /sys/devices/virtual/input/SMI230GYRO/pwr_cfg

# set the gyro power config suspend
echo 3 > /sys/devices/virtual/input/SMI230GYRO/pwr_cfg

# read the chip id
cat /sys/devices/virtual/input/SMI230GYRO/chip_id

# read the synced acc data 
cat /sys/devices/virtual/input/SMI230ACC/data_sync

# read the asynced acc data 
cat /sys/devices/virtual/input/SMI230ACC/acc_value

# read the gyro data 
cat /sys/devices/virtual/input/SMI230GYRO/gyro_value

smi230-linux-driver's People

Contributors

christianlorenz3 avatar she2rt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.