2009-08-18 19:06:32 +02:00
|
|
|
Overview of IIO
|
|
|
|
|
2010-09-04 18:54:51 +02:00
|
|
|
The Industrial I/O subsystem is intended to provide support for devices
|
|
|
|
that in some sense are analog to digital converters (ADCs). As many
|
|
|
|
actual devices combine some ADCs with digital to analog converters
|
2009-08-18 19:06:32 +02:00
|
|
|
(DACs) the intention is to add that functionality at a future date
|
|
|
|
(hence the name).
|
|
|
|
|
|
|
|
The aim is to fill the gap between the somewhat similar hwmon and
|
|
|
|
input subsystems. Hwmon is very much directed at low sample rate
|
|
|
|
sensors used in applications such as fan speed control and temperature
|
|
|
|
measurement. Input is, as it's name suggests focused on input
|
|
|
|
devices. In some cases there is considerable overlap between these and
|
|
|
|
IIO.
|
|
|
|
|
|
|
|
A typical device falling into this category would be connected via SPI
|
|
|
|
or I2C.
|
|
|
|
|
|
|
|
Functionality of IIO
|
|
|
|
|
|
|
|
* Basic device registration and handling. This is very similar to
|
|
|
|
hwmon with simple polled access to device channels via sysfs.
|
|
|
|
|
|
|
|
* Event chrdevs. These are similar to input in that they provide a
|
|
|
|
route to user space for hardware triggered events. Such events include
|
|
|
|
threshold detectors, free-fall detectors and more complex action
|
2009-11-09 14:10:15 +01:00
|
|
|
detection. The events themselves are currently very simple with
|
2009-08-18 19:06:32 +02:00
|
|
|
merely an event code and a timestamp. Any data associated with the
|
2009-11-09 14:10:15 +01:00
|
|
|
event must be accessed via polling.
|
|
|
|
|
|
|
|
Note: A given device may have one or more event channel. These events are
|
|
|
|
turned on or off (if possible) via sysfs interfaces.
|
2009-08-18 19:06:32 +02:00
|
|
|
|
|
|
|
* Hardware ring buffer support. Some recent sensors have included
|
|
|
|
fifo / ring buffers on the sensor chip. These greatly reduce the load
|
|
|
|
on the host CPU by buffering relatively large numbers of data samples
|
|
|
|
based on an internal sampling clock. Examples include VTI SCA3000
|
|
|
|
series and Analog Device ADXL345 accelerometers. Each ring buffer
|
|
|
|
typically has an event chrdev (similar to the more general ones above)
|
|
|
|
to pass on events such as buffer 50% full and an access chrdev via
|
|
|
|
which the raw data it self may be read back.
|
|
|
|
|
|
|
|
* Trigger and software ring buffer support. In many data analysis
|
|
|
|
applications it it useful to be able to capture data based on some
|
|
|
|
external signal (trigger). These triggers might be a data ready
|
|
|
|
signal, a gpio line connected to some external system or an on
|
2010-07-23 22:28:56 +02:00
|
|
|
processor periodic interrupt. A single trigger may initialize data
|
2009-08-18 19:06:32 +02:00
|
|
|
capture or reading from a number of sensors. These triggers are
|
2010-09-04 18:54:51 +02:00
|
|
|
used in IIO to fill software ring buffers acting in a very similar
|
2009-08-18 19:06:32 +02:00
|
|
|
fashion to the hardware buffers described above.
|
|
|
|
|
|
|
|
Other documentation:
|
|
|
|
|
2010-09-04 18:54:51 +02:00
|
|
|
userspace.txt - overview of ring buffer reading from userspace.
|
2009-08-18 19:06:32 +02:00
|
|
|
|
2010-09-04 18:54:51 +02:00
|
|
|
device.txt - elements of a typical device driver.
|
2009-08-18 19:06:32 +02:00
|
|
|
|
|
|
|
trigger.txt - elements of a typical trigger driver.
|
|
|
|
|
2010-09-04 18:54:51 +02:00
|
|
|
ring.txt - additional elements required for ring buffer support.
|
2009-08-18 19:06:32 +02:00
|
|
|
|
2010-09-04 18:54:51 +02:00
|
|
|
sysfs-bus-iio - abi documentation file.
|