LTC2387

LTC2387 SAR ADC IIO.

Supported Devices

Evaluation Boards

Description

This is a Linux industrial I/O (Linux Industrial I/O Subsystem) subsystem driver, targeting single-channel differential SAR ADCs with a serial LVDS data interface. The industrial I/O subsystem provides a unified framework for drivers for many different types of converters and sensors using a number of different physical interfaces (i2c, spi, etc). See Linux Industrial I/O Subsystem for more information.

Source Code

Status

Source

Mainlined?

git

[No]

Files

Driver testing

Each and every IIO device, typically a hardware chip, has a device folder under /sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under every of these directory folders reside a set of files, depending on the characteristics and features of the hardware device in question. These files are consistently generalized and documented in the IIO ABI documentation. In order to determine which IIO deviceX corresponds to which hardware device, the user can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the sequence in which the iio device drivers are loaded/registered is constant, the numbering is constant and may be known in advance.

root@analog:/# cd /sys/bus/iio/devices/
root@analog:/sys/bus/iio/devices# ls
iio:device0         trigger0

root@analog:/sys/bus/iio/devices# cd iio:device0

root@analog:/sys/bus/iio/devices/iio:device0> ls -l
drwxr-xr-x 2 root root    0 May 17 14:36 buffer
drwxr-xr-x 2 root root    0 May 17 14:36 buffer0
-r--r--r-- 1 root root 4096 May 17 14:36 dev
-r--r--r-- 1 root root 4096 May 17 14:36 name
lrwxrwxrwx 1 root root    0 May 17 14:36 of_node -> ../../../../../firmware/devicetree/base/fpga-axi@0/ltc2387@0
drwxr-xr-x 2 root root    0 May 17 14:36 power
-rw-r--r-- 1 root root 4096 May 17 14:36 sampling_frequency
drwxr-xr-x 2 root root    0 May 17 14:36 scan_elements
lrwxrwxrwx 1 root root    0 May 17 14:36 subsystem -> ../../../../../bus/iio
-rw-r--r-- 1 root root 4096 May 17 14:36 uevent

root@analog:/sys/bus/iio/devices/iio:device0#

Identify the device

root@analog:/sys/bus/iio/devices/iio:device0# cat name
ltc2387

Get/Set sampling frequency

The attribute reports the requested rate; the actual rate is quantized to the PWM reference clock.

root@analog:/sys/bus/iio/devices/iio:device0# cat sampling_frequency
15000000
root@analog:/sys/bus/iio/devices/iio:device3# echo 10000000 > sampling_frequency
root@analog:/sys/bus/iio/devices/iio:device3# cat sampling_frequency
10000000