Introduction to IIO data structures
The IIO framework is made of a few data structures among which is one representing the IIO device, another one describing this device, and the last one enumerating the channels exposed by the device. An IIO device is represented in the kernel as an instance of struct iio_dev
and described by a struct iio_info
structure. All the important IIO structures are defined in include/linux/iio/iio.h
.
Understanding the struct iio_dev structure
The struct iio_dev
structure represents the IIO device, describing the device and its driver. It tells us how many channels are available on the device and what modes the device can operate in (one-shot or triggered buffer, for example). Moreover, this data structure exposes some hooks to be provided by the driver.
This data structure has the following definition:
struct iio_dev { [...] int ...