Questions tagged [iio]

Industrial I/O is a Linux kernel framework that provides uniform access to sensors and other ADC/DAC-based devices.

The main purpose of the Industrial I/O subsystem (IIO) is to provide support for devices that in some sense perform either analog-to-digital conversion (ADC) or digital-to-analog conversion (DAC) or both. The aim is to fill the gap between the somewhat similar hwmon and input subsystems. Hwmon is directed at low sample rate sensors used to monitor and control the system itself, like fan speed control or temperature measurement. Input is, as its name suggests, focused on human interaction input devices (keyboard, mouse, touchscreen). In some cases there is considerable overlap between these and IIO.

Devices that fall into this category include:

  • analog to digital converters (ADCs)
  • accelerometers
  • capacitance to digital converters (CDCs)
  • digital to analog converters (DACs)
  • gyroscopes
  • inertial measurement units (IMUs)
  • color and light sensors
  • magnetometers
  • pressure sensors
  • proximity sensors
  • temperature sensors

Usually these sensors are connected via SPI or I2C. A common use case of the sensors devices is to have combined functionality (e.g. light plus proximity sensor).

Links:

  1. https://wiki.analog.com/software/linux/docs/iio/iio

  2. https://www.kernel.org/doc/htmldocs/iio/

73 questions
6
votes
0 answers

Detect Lid Rotation - Lenovo Thinkpad Yoga 15

I just picked up the Lenovo Thinkpad Yoga 15 (20DQ001KUS) for $799. Here is a link: http://shop.lenovo.com/us/en/laptops/thinkpad/yoga-series/yoga-15/#tab-tech_specs I'd really like to get the tablet features working in Linux Mint 17.2. I have…
Corey O.
  • 466
  • 9
  • 19
4
votes
1 answer

Are ctxless functions worse or better to use in libgpiod

Is there anyone out there familiar with libgpiod who could answer this question: Are there any draw backs to using ctxless function rather than calling individual function to manipulate chip lines (or in general)? For example, to turn on a line, I…
DaveR
  • 1,295
  • 1
  • 13
  • 35
4
votes
1 answer

IIO device buffer always null

I am using an IMU sensor called LSM6DSL with the iio drivers. They work fine if I display the raw values with the command: cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw Then I decided to use the libiio so I can read all these values from a C…
user7581609
4
votes
2 answers

IIO Linux : How to know when the buffer is full?

I am using IIO drivers from userspace to read the value of an ADC (AD7924). I have all steps to get a triggered acquisition working ( create a trigger, assign it, enable the ADC channels, set the dimension of the buffer, and enable it). Here is the…
dudu721
  • 342
  • 1
  • 3
  • 13
3
votes
0 answers

How to use the BH1750 support in Linux kernel?

I'm writing code in Raspberry Pi, trying to communicate BH1750 ambient light sensor connected in a I2C port. Most working ways are using Python SMBus library but I'm writing C++ code. After some search, I found that: The well-known wiringPi library…
jiandingzhe
  • 1,881
  • 15
  • 35
3
votes
1 answer

Linux IIO accelerometer motion dectection events

I have a MMA8563 accelerometer in an imx6ul board and am using the mma8452.c Linux IIO driver. I can access x, y, z raw values fine through /sys/bus/iio/devices/iio:device0. However, I am unsure of how to use IIO events. I have configured motion…
Justin_B
  • 31
  • 1
3
votes
1 answer

How to read data from LSM330 in /dev/iio:deviceX?

I am trying to interface a LSM330 accelerometer/gyroscope module on an i.MX6 board. The module is connected to an I2C bus, the relevant parts of the device tree file are as follows: &i2c1 { clock-frequency = <100000>; pinctrl-names =…
2
votes
0 answers

IIO buffer refill time out

I would like to read the values of an IMU sensor from a C project. The device in question is the LSM6DSL, and I am using the IIO kernel drivers. They are working correctly because I am able to read the values by using the command : cat…
user7581609
2
votes
1 answer

No output from IIO (character) device output - IIO buffer

I'm working on a Linux driver for ADC ADS1243 and use the IIO framework. I want to add a feature to read and store data from the ADC to the IIO buffer. I added iio_triggered_buffer_setup() to probe the function of the driver. ret =…
o_ndra
  • 87
  • 7
2
votes
1 answer

freescale imx6 with mpu9250

I am trying to interface freescale imx6 SoC with mpu92/65 sensor device. I have taken mpu92/65 device driver from android (https://github.com/NoelMacwan/Kernel-10.4.1.B.0.101/tree/master/drivers/staging/iio/imu ) and have done necessary…
Vamsee
  • 55
  • 1
  • 6
2
votes
1 answer

Reading an input (4096) from a directory to use in C

I'm trying to read an ADC (12 bit which is 0 - 4095) input from my AIN0 channel, and using that as an "int" so I could use it in a math function. Is this possible? The directory I'm referring to is "sys/bus/iio/devices/iio:device0/in_voltage0_raw"…
loco_tums
  • 23
  • 4
2
votes
2 answers

Reading analog inputs fast in beaglebone black

I need to read all 7 analog pins in the BBB every 5 milliseconds. I'm doing so with the following C code: void main(){ char value_str[7]; long int value_int = 0; FILE* f0 = fopen("/sys/bus/iio/devices/iio:device0/in_voltage0_raw",…
Rafael Vega
  • 4,575
  • 4
  • 32
  • 50
1
vote
1 answer

modprobe: FATAL: Module industrialio-sw-device not found in directory /lib/modules/5.15.56-v8+ error while trying to modprobe a module on RPI

I am trying the dummy-iiostream.c script from this repo. Few commands were mentioned at beginning of the script to execute. I mentioned them below : sudo modprobe industrialio sudo modprobe industrialio-configfs sudo modprobe…
DeLorean
  • 186
  • 13
1
vote
0 answers

Reading a sensor register using SMBus / I2C

I have a problem while reading the my lsm9ds1 accelerator sensor registers. It always displays the same values. My setup is a Raspberry Pi 4 and the Sense HAT which has this sensor integrated. I don't want to use the Sense HAT library but use the…
Xenoshell
  • 91
  • 2
  • 13
1
vote
1 answer

I2C read() lost 1 bit

I try to use I2C to read data from ADS1110, the address of ADS1110 is seven bits, which is 1001 000. Writing data can only change the configuration register, which is done in the form of address + configuration. Reading data returns 3 bytes of data,…
Chroluma
  • 59
  • 1
  • 5
1
2 3 4 5