2017-12-05 07:41 AM
Hello,
We have added LSM9DS1 to our design. We used linux 4.4.19 and we have added drivers got from
https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers
We use SPI, modules are loaded fine and LSM9DS1 is detected (both accel/gyro and magnetometer chip selects).
My questions is, is there any public API or example program for linux user space, for reading data or changing LSM9DS1 configuration?
Thanks a lot for your help.
Best regards
Angel
2017-12-11 04:19 AM
On public repository there are libraries (most popular is
https://github.com/torvalds/linux/tree/master/tools/iio
) that allowaccess to iio sensor device through sysfs. A very simple example on how to use that library is iio_generic_buffer tool.
Another interesting library developed by Intel under Apache License is
https://github.com/01org/android-iio-sensors-hal
, it usesAndroid sensor HAL.
In any case from linux user space is possible to access to iio sensors data and configuration through sysfs in a very simple fashion
by using file exported by linux device driver (see more in
).