2015-12-21 15:27:15 +00:00
|
|
|
iio {#iio}
|
2015-11-16 18:24:31 +00:00
|
|
|
===
|
2015-12-21 15:27:15 +00:00
|
|
|
IIO is the kernel's framework for supporting sensors.
|
2015-12-03 15:54:11 -08:00
|
|
|
## Using dummy_iio driver
|
2015-12-21 15:27:15 +00:00
|
|
|
For platforms without IIO hardware the iio_dummy driver can be used. You can
|
|
|
|
|
add the driver by either rebuilding the kernel with IIO component enabled or
|
|
|
|
|
just building the IIO modules and load them. You must add the following config
|
|
|
|
|
fragment. Known to work for kernel 3.19 and later.
|
2015-12-03 15:54:11 -08:00
|
|
|
<pre><code>
|
2015-11-16 18:43:07 +00:00
|
|
|
CONFIG_IIO_DUMMY_EVGEN=m
|
|
|
|
|
CONFIG_IIO_SIMPLE_DUMMY=m
|
|
|
|
|
CONFIG_IIO_SIMPLE_DUMMY_EVENTS=y
|
|
|
|
|
CONFIG_IIO_SIMPLE_DUMMY_BUFFER=y
|
2015-12-03 15:54:11 -08:00
|
|
|
</code></pre>
|
|
|
|
|
### Add driver to kernel
|
|
|
|
|
Boot with new kernel, then load modules
|
|
|
|
|
<pre><code>
|
|
|
|
|
$ modprobe iio_dummy
|
|
|
|
|
$ modprobe iio_dummy_evgen
|
|
|
|
|
</code></pre>
|
|
|
|
|
### Load kernel modules
|
|
|
|
|
Depending our your kernel config, some of these modules may already be loaded.
|
|
|
|
|
<pre><code>
|
|
|
|
|
$ insmod drivers/iio/industrialio.ko
|
|
|
|
|
$ insmod drivers/iio/kfifo_buf.ko
|
|
|
|
|
$ insmod drivers/staging/iio/iio_dummy_evgen.ko
|
|
|
|
|
$ insmod drivers/staging/iio/iio_dummy.ko
|
|
|
|
|
</code></pre>
|
2015-11-16 18:24:31 +00:00
|
|
|
## 'RAW' access
|
|
|
|
|
|
|
|
|
|
Mraa supports raw access
|
|
|
|
|
|
|
|
|
|
###Channels
|
|
|
|
|
|
|
|
|
|
###Attributes
|
|
|
|
|
|
|
|
|
|
###Events
|
|
|
|
|
|
|
|
|
|
###Triggers
|
|
|
|
|
|
2015-11-16 18:45:18 +00:00
|
|
|
Activate the trigger in /sys/class/iio
|
|
|
|
|
$ echo 1 > trigger0/trigger_now
|
|
|
|
|
|
2015-11-16 18:24:31 +00:00
|
|
|
|