This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:linux-drivers:iio-adc:ad7192 [09 Nov 2011 10:25] – [Reference Circuits] Michael Hennerich | resources:tools-software:linux-drivers:iio-adc:ad7192 [08 Feb 2019 14:51] (current) – [Device tree support] Mircea Caprioru | ||
---|---|---|---|
Line 5: | Line 5: | ||
* [[adi> | * [[adi> | ||
* [[adi> | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
* [[adi> | * [[adi> | ||
- | |||
- | |||
===== Reference Circuits ===== | ===== Reference Circuits ===== | ||
* [[adi> | * [[adi> | ||
+ | * [[adi> | ||
* [[adi> | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
===== Evaluation Boards ===== | ===== Evaluation Boards ===== | ||
Line 17: | Line 22: | ||
* [[adi> | * [[adi> | ||
* [[adi> | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
* [[adi> | * [[adi> | ||
===== Description ===== | ===== Description ===== | ||
Line 23: | Line 30: | ||
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). | 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 [[software: | See [[software: | ||
- | |||
- | ==== AD7190 ==== | ||
- | |||
- | {{scrape> | ||
- | |||
- | ==== AD7192 ==== | ||
- | |||
- | {{scrape> | ||
- | |||
- | ==== AD7195 ==== | ||
- | |||
- | {{scrape> | ||
====== Source Code ====== | ====== Source Code ====== | ||
Line 40: | Line 35: | ||
===== Status ===== | ===== Status ===== | ||
- | ^ Source | + | ^ Source ^ Mainlined? ^ |
- | | [[bfgit>linux-kernel?drivers/ | + | | [[git.linux.org>drivers/ |
===== Files ===== | ===== Files ===== | ||
Line 138: | Line 133: | ||
</ | </ | ||
+ | ====== Device tree support ====== | ||
+ | Device tree is the new method for describing non-discoverable hardware in Linux. This replaces former structure based method. For configuring a device using this drivers please follow the example bellow: | ||
+ | |||
+ | < | ||
+ | /dts-v1/; | ||
+ | /plugin/; | ||
+ | |||
+ | / { | ||
+ | |||
+ | fragment@0 { | ||
+ | target-path = "/"; | ||
+ | dvdd: fixedregulator@0 { | ||
+ | compatible = " | ||
+ | regulator-name = " | ||
+ | regulator-min-microvolt = < | ||
+ | regulator-max-microvolt = < | ||
+ | regulator-boot-on; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | fragment@1 { | ||
+ | target-path = "/"; | ||
+ | avdd: fixedregulator@1 { | ||
+ | compatible = " | ||
+ | regulator-name = " | ||
+ | regulator-min-microvolt = < | ||
+ | regulator-max-microvolt = < | ||
+ | regulator-boot-on; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | fragment@3 { | ||
+ | target = <& | ||
+ | # | ||
+ | # | ||
+ | status = " | ||
+ | |||
+ | ad7190@0 { | ||
+ | compatible = " | ||
+ | reg = <0>; | ||
+ | spi-max-frequency = < | ||
+ | spi-cpol; | ||
+ | spi-cpha; | ||
+ | # | ||
+ | interrupts = <25 0x2>; | ||
+ | interrupt-parent = <& | ||
+ | dvdd-supply = <& | ||
+ | avdd-supply = <& | ||
+ | |||
+ | adi, | ||
+ | adi, | ||
+ | adi, | ||
+ | adi, | ||
+ | adi, | ||
+ | adi, | ||
+ | adi, | ||
+ | adi, | ||
+ | adi, | ||
+ | }; | ||
+ | }; | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | <note important> | ||
+ | </ | ||
====== Adding Linux driver support ====== | ====== Adding Linux driver support ====== | ||
Line 143: | Line 203: | ||
"make qconfig" | "make qconfig" | ||
- | <note> | + | <WRAP round help> |
The AD7192 Driver depends on **CONFIG_SPI** | The AD7192 Driver depends on **CONFIG_SPI** | ||
- | </note> | + | </WRAP> |
< | < | ||
Line 165: | Line 225: | ||
</ | </ | ||
+ | |||
====== Hardware configuration ====== | ====== Hardware configuration ====== | ||
Line 173: | Line 234: | ||
{{page> | {{page> | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **cd / | root:/> **cd / | ||
root:/ | root:/ | ||
- | device0 | + | iio:device0 |
- | root:/ | + | root:/ |
- | root:/ | + | root:/ |
-rw-r--r-- | -rw-r--r-- | ||
- | drwxr-xr-x | + | drwxr-xr-x |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
-r--r--r-- | -r--r--r-- | ||
drwxr-xr-x | drwxr-xr-x | ||
-rw-r--r-- | -rw-r--r-- | ||
lrwxrwxrwx | lrwxrwxrwx | ||
- | -r--r--r-- | + | -r--r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
drwxr-xr-x | drwxr-xr-x | ||
-rw-r--r-- | -rw-r--r-- | ||
- | root:/ | + | root:/ |
- | </ | + | </ |
=== Show device name === | === Show device name === | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
ad7192 | ad7192 | ||
- | </ | + | </ |
=== Set sampling frequency / update rate === | === Set sampling frequency / update rate === | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
10 | 10 | ||
- | root:/ | + | root:/ |
- | root:/ | + | root:/ |
50 | 50 | ||
- | root:/ | + | root:/ |
- | </ | + | </ |
=== Show available scales for differential input channels === | === Show available scales for differential input channels === | ||
Line 230: | Line 291: | ||
Lists all available scales for the differential input pairs: | Lists all available scales for the differential input pairs: | ||
^ ADC Input Pair ^ Channel name ^ | ^ ADC Input Pair ^ Channel name ^ | ||
- | | AIN1(+) - AIN2(-) | in1-in2_raw | + | | AIN1(+) - AIN2(-) | in_voltage1-in_voltage2_raw |
- | | AIN3(+) - AIN4(-) | in3-in4_raw | + | | AIN3(+) - AIN4(-) | in_voltage3-in_voltage4_raw |
- | | AIN2(-) - AIN2(-) | in2-in2_shorted_raw | + | | AIN2(-) - AIN2(-) | in_voltage2-in_voltage2_shorted_raw |
Setting these directly influences the ADC input range, by altering the GAIN amplifier. | Setting these directly influences the ADC input range, by altering the GAIN amplifier. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070 | 0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070 | ||
- | </ | + | </ |
=== Show available scales for pseudo-differential input channels === | === Show available scales for pseudo-differential input channels === | ||
Line 246: | Line 307: | ||
Lists all available scales for the differential input pairs: | Lists all available scales for the differential input pairs: | ||
^ ADC Input Pair ^ Channel name ^ | ^ ADC Input Pair ^ Channel name ^ | ||
- | | AIN1 - AINCOM | in1_raw | + | | AIN1 - AINCOM | in_voltage1_raw |
- | | AIN2 - AINCOM | in2_raw | + | | AIN2 - AINCOM | in_voltage2_raw |
- | | AIN3 - AINCOM | in3_raw | + | | AIN3 - AINCOM | in_voltage3_raw |
- | | AIN4 - AINCOM | in4_raw | + | | AIN4 - AINCOM | in_voltage4_raw |
Setting these directly influences the ADC input range, by altering the GAIN amplifier. | Setting these directly influences the ADC input range, by altering the GAIN amplifier. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070 | 0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070 | ||
- | </ | + | </ |
=== Set scale for differential input channels === | === Set scale for differential input channels === | ||
Line 265: | Line 326: | ||
If the written scale differs from the current scale. The driver performs full and zero offset calibration on all differential input channels. | If the written scale differs from the current scale. The driver performs full and zero offset calibration on all differential input channels. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
0.000393390 | 0.000393390 | ||
- | root:/ | + | root:/ |
- | root:/ | + | root:/ |
0.000196690 | 0.000196690 | ||
- | root:/ | + | </ |
- | </ | + | |
- | === Show channel | + | === Show channel |
**Description: | **Description: | ||
- | Raw unscaled voltage measurement on channel | + | Raw unscaled voltage measurement on channel |
^ ADC Input Pair ^ Channel name ^ | ^ ADC Input Pair ^ Channel name ^ | ||
- | | AIN1(+) - AIN2(-) | in1-in2_raw | + | | AIN1(+) - AIN2(-) | in_voltage1-in_voltage2_raw |
- | | AIN3(+) - AIN4(-) | in3-in4_raw | + | | AIN3(+) - AIN4(-) | in_voltage3-in_voltage4_raw |
- | | AIN2(-) - AIN2(-) | in2-in2_shorted_raw | + | | AIN2(-) - AIN2(-) | in_voltage2-in_voltage2_shorted_raw |
- | | AIN1 - AINCOM | in1_raw | + | | AIN1 - AINCOM | in_voltage1_raw |
- | | AIN2 - AINCOM | in2_raw | + | | AIN2 - AINCOM | in_voltage2_raw |
- | | AIN3 - AINCOM | in3_raw | + | | AIN3 - AINCOM | in_voltage3_raw |
- | | AIN4 - AINCOM | in4_raw | + | | AIN4 - AINCOM | in_voltage4_raw |
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
-1 | -1 | ||
- | </ | + | </ |
- | **U** = //in1_raw | + | **U** = //in_voltage1_raw |
- | === Show channel | + | === Show channel |
**Description: | **Description: | ||
- | Raw unscaled voltage measurement on channel | + | Raw unscaled voltage measurement on channel |
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
-1 | -1 | ||
- | </ | + | </ |
- | **U** = //in1-in3_raw | + | **U** = //in_voltage1-in_voltage3_raw |
=== Show internal temperature === | === Show internal temperature === | ||
- | **__Description: | + | **__Description: |
Shows raw unscaled temperature. | Shows raw unscaled temperature. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
-175 | -175 | ||
- | </ | + | </ |
=== Bride power-down switch control === | === Bride power-down switch control === | ||
Line 327: | Line 387: | ||
Writing 1 closes the bridge switch. | Writing 1 closes the bridge switch. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
- | root:/ | + | root:/ |
1 | 1 | ||
- | root:/ | + | root:/ |
- | </ | + | </ |
=== AC excitation control (AD7195 only) === | === AC excitation control (AD7195 only) === | ||
Line 340: | Line 400: | ||
Writing 1 enables AC excitation on the AD7195 ACX strobes. | Writing 1 enables AC excitation on the AD7195 ACX strobes. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
- | root:/ | + | root:/ |
1 | 1 | ||
- | root:/ | + | root:/ |
- | </ | + | </ |
===== Trigger management ===== | ===== Trigger management ===== | ||
- | <note> | + | <WRAP round help> |
This driver only supports it's own default trigger source **ad7192-dev0** | This driver only supports it's own default trigger source **ad7192-dev0** | ||
- | </note> | + | </WRAP> |
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
ad7192-dev0 | ad7192-dev0 | ||
- | </ | + | </ |
===== Buffer management ===== | ===== Buffer management ===== | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
- | **bytes_per_datum** | + | enable |
- | dev **length** | + | </ |
- | root:/ | + | |
- | </ | + | |
{{page> | {{page> | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/ | + | root:/ |
- | in1-in2_en | + | in_voltage1-in_voltage2_en |
- | in1-in2_index | + | in_voltage1-in_voltage2_index |
- | in1-in2_type | + | in_voltage1-in_voltage2_type |
- | in1_en | + | in_voltage1_en |
- | in1_index | + | in_voltage1_index |
- | in1_type | + | in_voltage1_type |
- | in2-in2_shorted_en | + | in_voltage2-in_voltage2_shorted_en |
- | in2-in2_shorted_index | + | in_voltage2-in_voltage2_shorted_index |
- | in2-in2_shorted_type | + | in_voltage2-in_voltage2_shorted_type |
- | root:/ | + | root:/ |
- | </ | + | </ |
{{page> | {{page> | ||
- | |||
====== More Information ====== | ====== More Information ====== | ||
{{page> | {{page> |