This is an old revision of the document!
This is a Linux industrial I/O (IIO) subsystem driver, targeting single channel serial interface ADCs. 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 IIO for more information.
Function | File |
---|---|
driver | drivers/iio/adc/ad7124.c |
devicetree bindings | Documentation/devicetree/bindings/iio/adc/adi,ad7124.txt |
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.
TIP: An example program which uses the interface can be found here:
This specifies any shell prompt running on the target
root:/> cd /sys/bus/iio/devices/ root:/sys/bus/iio/devices> ls iio:device0 root:/sys/bus/iio/devices> cd iio\:device0 root:/sys/bus/iio/devices/iio:device0> ls -l drwxr-xr-x 2 root root 0 Jun 23 21:46 buffer -r--r--r-- 1 root root 4096 Jun 23 21:46 dev -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage0-voltage1_offset -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage0-voltage1_raw -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage0-voltage1_sampling_frequency -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage0-voltage1_scale -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage2-voltage3_offset -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage2-voltage3_raw -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage2-voltage3_sampling_frequency -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage2-voltage3_scale -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage4-voltage5_offset -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage4-voltage5_raw -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage4-voltage5_sampling_frequency -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage4-voltage5_scale -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage6-voltage7_offset -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage6-voltage7_raw -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage6-voltage7_sampling_frequency -rw-r--r-- 1 root root 4096 Jun 23 21:46 in_voltage6-voltage7_scale -r--r--r-- 1 root root 4096 Jun 23 21:46 name lrwxrwxrwx 1 root root 0 Jun 23 21:46 of_node -> ../../../../../../../../firmware/devicetree/base/soc/spi@7e204000/ad7124-4@0 drwxr-xr-x 2 root root 0 Jun 23 21:46 power drwxr-xr-x 2 root root 0 Jun 23 21:46 scan_elements lrwxrwxrwx 1 root root 0 Jun 23 21:46 subsystem -> ../../../../../../../../bus/iio drwxr-xr-x 2 root root 0 Jun 23 21:46 trigger -rw-r--r-- 1 root root 4096 Jun 23 21:46 uevent
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> cat name ad7124-4
Description:
Scales and offsets to be applied to in_voltagex_voltagey_raw in order to obdatin the measured voltage in millivolts
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> cat in_voltage0-voltage1_scale 0.000149011 root:/sys/bus/iio/devices/iio:device0> cat in_voltage0-voltage1_offset 0 root:/sys/bus/iio/devices/iio:device0> cat in_voltage0-voltage1_raw 2679470
Description:
Channel Ainp0-Ainm1 is configured as unipolar, with a gain of 1
U = in_voltage0-voltage1_raw * in_voltage0-voltage1_scale - in_voltage0-voltage1_offset = 2679470 * 0.000149011 - 0 = 399.27 mV
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> cat in_voltage2-voltage3_scale 0.000298023 root:/sys/bus/iio/devices/iio:device0> cat in_voltage2-voltage3_offset -2500 root:/sys/bus/iio/devices/iio:device0> cat in_voltage2-voltage3_raw 9716211
Description:
Channel Ainp2-Ainm3 is configured as bipolar, with a gain of 1
U = in_voltage2-voltage3_raw * in_voltage2-voltage3_scale - in_voltage2-voltage3_offset = 9716211* 0.000298023 - 2500= 395.65 mV
Description:
The output data rate depends on the master clock frequency (fclk) which in turn determines the power mode:
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> cat in_voltage0-voltage1_sampling_frequency 10 root:/sys/bus/iio/devices/iio:device0> cat in_voltage2-voltage3_sampling_frequency 960 root:/sys/bus/iio/devices/iio:device0> echo 2400 > in_voltage0-voltage1_sampling_frequency root:/sys/bus/iio/devices/iio:device0> cat in_voltage0-voltage1_sampling_frequency 2400 root:/sys/bus/iio/devices/iio:device0> echo 5000 > in_voltage2-voltage3_sampling_frequency root:/sys/bus/iio/devices/iio:device0> cat in_voltage2-voltage3_sampling_frequency 4800
小肝癌是什么意思 | 医生代表什么生肖 | 梓什么意思 | 什么植物最老实 | 肺火吃什么中成药 |
拉屎出血是什么原因 | 3岁小孩说话结巴是什么原因 | 释怀和释然有什么区别 | 史迪仔是什么动物 | 什么情况会胎停 |
游泳要带什么东西 | 主理人是什么意思 | 上什么环最好最安全伤害小 | 夕颜是什么意思 | 夜晚尿频尿多是什么原因 |
唇周围长痘痘是什么原因 | 旦上面加一横是什么字 | 尿不尽挂什么科 | 尿白细胞阳性是什么意思 | 瓒字取名有什么寓意 |
什么是偏印yanzhenzixun.com | bpo是什么hcv7jop6ns4r.cn | 小螃蟹吃什么hcv9jop7ns0r.cn | 女性睾酮低说明什么hcv8jop0ns4r.cn | 什么是嘌呤食物hcv9jop1ns8r.cn |
中午饭吃什么hcv8jop2ns1r.cn | 早上口干口苦是什么原因hcv7jop6ns9r.cn | 身上为什么会长小肉球hcv9jop2ns2r.cn | 什么各异hcv8jop1ns1r.cn | rf是什么意思hlguo.com |
左是什么意思hcv8jop9ns7r.cn | 不作为是什么意思hcv9jop5ns7r.cn | 什么叫近视hcv9jop7ns2r.cn | 百依百顺是什么生肖hcv8jop6ns3r.cn | 什么的鹿角hcv8jop8ns8r.cn |
欲什么意思hcv8jop4ns7r.cn | 菜板买什么材质的好hcv8jop2ns0r.cn | 水鱼什么意思hcv8jop7ns0r.cn | 晦气是什么意思hcv9jop2ns4r.cn | 直率是什么意思hcv9jop4ns6r.cn |