October 2017
Intermediate to advanced
586 pages
14h 8m
English
You may find yourself in trouble when there are multiple data channels per channel type. The dilemma would be how to identify them. There are two solutions for that: indexes and modifiers.
Using indexes: Given an ADC device with one channel line, indexing is not needed. Its channel definition would be:
static const struct iio_chan_spec adc_channels[] = {
{
.type = IIO_VOLTAGE,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
},
}
The attribute name resulting from the preceding channel would be in_voltage_raw:
/sys/bus/iio/iio:deviceX/in_voltage_raw
Now, let's say the converter has four or even eight channels. How do we identify them? The solution is to use indexes. Setting the .indexed field to 1 will mangle the channel ...
Read now
Unlock full access