Both sides previous revisionPrevious revisionNext revision | Previous revision |
resources:tools-software:linux-drivers:iio-adc:ad7280a [16 Nov 2012 11:46] – [Reference Circuits] Add missing CN Lars-Peter Clausen | resources:tools-software:linux-drivers:iio-adc:ad7280a [11 Feb 2016 20:44] (current) – [Status] Lars-Peter Clausen |
---|
===== Status ===== | ===== Status ===== |
| |
^ Source ^ Mainlined? ^ | ^ Source ^ Mainlined? ^ |
| [[staging.kernel.org>drivers/staging/iio/adc/ad7280a.c|git]] | [[staging.kernel.org>drivers/staging/iio/adc/ad7280a.c|I Yes ]] | | | [[staging.kernel.org>drivers/staging/iio/adc/ad7280a.c|git]] | [[staging.kernel.org>drivers/staging/iio/adc/ad7280a.c|Yes]] | |
===== Files ===== | ===== Files ===== |
| |
</code> | </code> |
| |
<note tip> | <WRAP tip> |
In case platform_data is not present or set to NULL, the driver will use following defaults:\\ | In case platform_data is not present or set to NULL, the driver will use following defaults:\\ |
<code c> | <code c> |
}; | }; |
</code> | </code> |
</note> | </WRAP> |
| |
{{page>software/linux/docs/platform_and_bus_model#Declaring SPI slave devices&firstseconly&noeditbtn}} | {{page>software/linux/docs/platform_and_bus_model#Declaring SPI slave devices&firstseconly&noeditbtn}} |
"make qconfig") | "make qconfig") |
| |
<note> | <WRAP round help> |
The AD7280A Driver depends on **CONFIG_SPI** | The AD7280A Driver depends on **CONFIG_SPI** |
</note> | </WRAP> |
| |
<code> | <code> |
{{page>software:linux:docs:iio:iio_snippets#iio device files&noheader&firstseconly&noeditbtn}} | {{page>software:linux:docs:iio:iio_snippets#iio device files&noheader&firstseconly&noeditbtn}} |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/> **cd /sys/bus/iio/devices/** | root:/> **cd /sys/bus/iio/devices/** |
-rw-r--r-- 1 root root 4096 Mar 14 11:16 uevent | -rw-r--r-- 1 root root 4096 Mar 14 11:16 uevent |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> |
</xterm></box> | </xterm></WRAP> |
| |
| |
=== Show device name === | === Show device name === |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat name** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat name** |
ad7280a | ad7280a |
</xterm></box> | </xterm></WRAP> |
| |
=== Show cell channel scale === | === Show cell channel scale === |
scale to be applied to inX-inY_raw in order to obtain the measured voltage in millivolts. | scale to be applied to inX-inY_raw in order to obtain the measured voltage in millivolts. |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat in-in_scale** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat in-in_scale** |
0.976000 | 0.976000 |
</xterm></box> | </xterm></WRAP> |
| |
=== Show channel 0-1 measurement === | === Show channel 0-1 measurement === |
Raw unscaled voltage measurement on cell channel in0-in1_raw | Raw unscaled voltage measurement on cell channel in0-in1_raw |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat in0-in1_raw** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat in0-in1_raw** |
2254 | 2254 |
</xterm></box> | </xterm></WRAP> |
| |
**U** = //in0-in1_raw * in-in_scale + offset// = 2254 * 0.976000 + 1000 = **3199.904 //mV//** | **U** = //in0-in1_raw * in-in_scale + offset// = 2254 * 0.976000 + 1000 = **3199.904 //mV//** |
Raw unscaled voltage measurement on all cell channel in0-inX_raw | Raw unscaled voltage measurement on all cell channel in0-inX_raw |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat in0-in12_raw** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat in0-in12_raw** |
27048 | 27048 |
</xterm></box> | </xterm></WRAP> |
| |
**U** = //in0-in1_raw * in-in_scale + (cell_num * offset)// = 27048 * 0.976000 + (12 * 1000) = **38398.848 //mV//** | **U** = //in0-in1_raw * in-in_scale + (cell_num * offset)// = 27048 * 0.976000 + (12 * 1000) = **38398.848 //mV//** |
scale to be applied to tempX_raw in order to obtain the measured voltage in millivolts. | scale to be applied to tempX_raw in order to obtain the measured voltage in millivolts. |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat temp_scale** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat temp_scale** |
1.220000 | 1.220000 |
</xterm></box> | </xterm></WRAP> |
| |
=== Show auxiliary/temperature channel measurement === | === Show auxiliary/temperature channel measurement === |
Shows high accuracy band gap temperature sensor temperature in milli degrees Celsius. | Shows high accuracy band gap temperature sensor temperature in milli degrees Celsius. |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat temp0_raw** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **cat temp0_raw** |
2096 | 2096 |
</xterm></box> | </xterm></WRAP> |
| |
**U** = //temp0_raw * temp_scale// = 2096 * 1.220000 = **2557.12 //mV//** | **U** = //temp0_raw * temp_scale// = 2096 * 1.220000 = **2557.12 //mV//** |
automatically disables.\\ | automatically disables.\\ |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **echo 1 > in4-in5_balance_switch_en** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **echo 1 > in4-in5_balance_switch_en** |
0 | 0 |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> |
</xterm></box> | </xterm></WRAP> |
| |
| |
outputs are controlled only by inY-inZ_balance_switch_en.\\ | outputs are controlled only by inY-inZ_balance_switch_en.\\ |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **echo 150000 > in4-in5_balance_timer** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> **echo 150000 > in4-in5_balance_timer** |
143000 | 143000 |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0> |
</xterm></box> | </xterm></WRAP> |
| |
=== Enabling cell and auxiliary/temperature channel threshold events === | === Enabling cell and auxiliary/temperature channel threshold events === |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/> **cd /sys/bus/iio/devices/** | root:/> **cd /sys/bus/iio/devices/** |
-rw-r--r-- 1 root root 4096 Mar 14 13:37 uevent | -rw-r--r-- 1 root root 4096 Mar 14 13:37 uevent |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/device0:event0> | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/device0:event0> |
</xterm></box> | </xterm></WRAP> |
| |
The AD7280A includes a dynamic alert function that can detect whether | The AD7280A includes a dynamic alert function that can detect whether |
Specifies the value of threshold (_high|_low) that the device is comparing against. | Specifies the value of threshold (_high|_low) that the device is comparing against. |
| |
<box 100% green|shell prompt running on the target> | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/device0:event0> **echo 2300 > in-in_thresh_low_value** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/device0:event0> **echo 2300 > in-in_thresh_low_value** |
root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/device0:event0> **cat in-in_thresh_high_value** | root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/device0:event0> **cat in-in_thresh_high_value** |
3994 | 3994 |
</xterm></box> | </xterm></WRAP> |
| |
| |