Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-drivers:iio-adc:ad7476a [08 Sep 2012 12:43] – [Specifying reference voltage via the regulator framework] Lars-Peter Clausenresources:tools-software:linux-drivers:iio-adc:ad7476a [11 Sep 2021 20:17] (current) – [Supported Devices] Robin Getz
Line 3: Line 3:
 ===== Supported Devices ===== ===== Supported Devices =====
  
 +
 +  * [[adi>AD7091R]]
   * [[adi>AD7273]]   * [[adi>AD7273]]
   * [[adi>AD7274]]   * [[adi>AD7274]]
Line 19: Line 21:
   * [[adi>AD7478A]]   * [[adi>AD7478A]]
   * [[adi>AD7495]]   * [[adi>AD7495]]
 +  * [[adi>AD7680]]
 +  * [[adi>AD7683]]
 +  * [[adi>AD7684]]
 +  * [[adi>AD7685]]
 +  * [[adi>AD7686]]
 +  * [[adi>AD7687]]
 +  * [[adi>AD7688]]
 +  * [[adi>AD7690]]
 +  * [[adi>AD7691]]
 +  * [[adi>AD7693]]
 +  * [[adi>AD7694]]
   * [[adi>AD7910]]   * [[adi>AD7910]]
   * [[adi>AD7920]]   * [[adi>AD7920]]
   * [[adi>AD7940]]   * [[adi>AD7940]]
 +  * [[adi>AD7942]]
 +  * [[adi>AD7946]]
 +  * [[adi>AD7980]]
 +  * [[adi>AD7982]]
 +  * [[adi>AD7984]]
 +  * [[adi>AD7985]]
 +  * [[adi>AD7988-1]]
 +  * [[adi>AD7988-5]]
 +  * [[adi>LTC2314-14]]
  
-===== Reference Circuit Notes =====+===== Reference Circuits =====
  
-  * [[adi>CN0008]]+  * [[adi>CN0104]] 
 +  * [[adi>CN0130]]
   * [[adi>CN0178]]   * [[adi>CN0178]]
-  * [[adi>CN0165]] +  * [[adi>CN0180]] 
 +  * [[adi>CN0194]] 
 +  * [[adi>CN0213]] 
 +  * [[adi>CN0225]] 
 +  * [[adi>CN0237]] 
 +  * [[adi>CN0241]] 
 +  * [[adi>CN0247]] 
 +  * [[adi>CN0255]] 
 +  * [[adi>CN0260]] 
 +  * [[adi>CN0261]] 
 +  * [[adi>CN0269]] 
 +  * [[adi>CN0305]] 
 +  * [[adi>CN0306]] 
 +  * [[adi>CN0335]] 
 +  * [[adi>CN0336]] 
 +  * [[adi>CN0337]] 
 +  * [[adi>CN0350]] 
 +  * [[adi>CN0366]]
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
  
-  * [[adi>EVAL-AD7466CBZ]] +  * [[adi>EVAL-AD7091RSDZ]] 
-  * [[adi>EVAL-AD7476ACBZ]] +  * [[adi>EVAL-AD7276SDZ]] 
-  * [[adi>EVAL-AD7476ACBZ]] +  * [[adi>EVAL-AD7466]] 
-  * [[adi>EVAL-AD7477CBZ]] +  * [[adi>EVAL-AD7476A]] 
-  * [[adi>EVAL-AD7941]]+  * [[adi>EVAL-AD7477]] 
 +  * [[adi>EVAL-AD7910]] 
 +  * [[adi>EVAL-AD7920]]
   * [[adi>EVAL-AD7942]]   * [[adi>EVAL-AD7942]]
-  * [[adi>EVAL-AD7940]] +  * [[adi>EVAL-AD7683SDZ]] 
 +  * [[adi>EVAL-AD7684SDZ]] 
 +  * [[adi>EVAL-AD7685SDZ]] 
 +  * [[adi>EVAL-AD7686SDZ]] 
 +  * [[adi>EVAL-AD7687SDZ]] 
 +  * [[adi>EVAL-AD7688SDZ]] 
 +  * [[adi>EVAL-AD7690SDZ]] 
 +  * [[adi>EVAL-AD7691SDZ]] 
 +  * [[adi>EVAL-AD7693SDZ]] 
 +  * [[adi>EVAL-AD7694SDZ]] 
 +  * [[adi>EVAL-AD7942SDZ]] 
 +  * [[adi>EVAL-AD7946SDZ]] 
 +  * [[adi>EVAL-AD7980SDZ]] 
 +  * [[adi>EVAL-AD7982SDZ]] 
 +  * [[adi>EVAL-AD7984SDZ]] 
 +  * [[adi>EVAL-AD7985EBZ]] 
 +  * [[adi>EVAL-AD7988-5SDZ]]
 ===== Description ===== ===== Description =====
  
Line 49: Line 105:
 ===== Status ===== ===== Status =====
  
- Source   Mainlined?  +^ Source ^ Mainlined? ^ 
-| [[git.linux.org>drivers/staging/iio/adc/ad7476_core.c|git]] |  [[git.linux.org>drivers/staging/iio/adc/ad7476_core.c|Yes]]  |+| [[git.linux.org>drivers/iio/adc/ad7476.c|git]] | [[git.linux.org>drivers/iio/adc/ad7476.c|Yes]] | 
 ===== Files ===== ===== Files =====
  
 ^ Function ^ File ^ ^ Function ^ File ^
-| driver  | [[git.linux.org>drivers/staging/iio/adc/ad7476_core.c]] | +| driver  | [[git.linux.org>drivers/iio/adc/ad7476.c]] |
-| driver  | [[git.linux.org>drivers/staging/iio/adc/ad7476_ring.c]] | +
-| include | [[git.linux.org>drivers/staging/iio/adc/ad7476.h]] |+
  
 ====== Example platform device initialization ====== ====== Example platform device initialization ======
Line 155: Line 210:
 </code> </code>
  
 +===== Devicetree =====
 +
 +Required devicetree properties:
 +  * compatible: Needs to be "adi," followed by the name of the device. E.g. "adi,ad7476a"
 +  * reg: The chipselect number used for the device
 +  * spi-max-frequency: Maximum SPI clock frequency.
 +  * spi-cpha: Needs to be set for the correct SPI mode
 +  * spi-cpol: Needs to be set for the correct SPI mode
 +  * vcc-supply: Phandle to the supply regulator
 +
 +<code>
 +       adc_supply: fixedregulator {
 +               compatible = "regulator-fixed";
 +               regulator-name = "fixed-supply";
 +               regulator-min-microvolt = <3300000>;
 +               regulator-max-microvolt = <3300000>;
 +       };
 +
 +       spi: spi@e0007000 {
 +               #address-cells = <1>;
 +               #size-cells = <0>;
 +               compatible = "xlnx,ps7-spi-1.00.a";
 +               ...
 +
 +               ad7476@0 {
 +                       compatible = "adi,ad7476a";
 +                       reg = <0>;
 +                       spi-max-frequency = <1000000>;
 +                       spi-cpha;
 +                       spi-cpol;
 +                       vcc-supply = <&adc_supply>;
 +               };
 +        };
 +</code>
 ====== Adding Linux driver support ====== ====== Adding Linux driver support ======
  
Line 160: Line 249:
 "make qconfig") "make qconfig")
  
-<note>+<WRAP round help>
 The AD7476 Driver depends on **CONFIG_SPI** The AD7476 Driver depends on **CONFIG_SPI**
-</note>+</WRAP>
  
 <code> <code>
 Linux Kernel Configuration Linux Kernel Configuration
- Device Drivers  ---> +    Device Drivers  ---> 
- [*] Staging drivers  ---> +        ... 
- <*>     Industrial I/O support ---> +        <*>     Industrial I/O support ---> 
-     --- Industrial I/O support +            --- Industrial I/O support 
-     -*-   Enable ring buffer support within IIO +            ... 
-     -*-     Industrial I/O lock free software ring +            Analog to digital converters  --- 
-     -*-   Enable triggered sampling support +                ... 
- +                <*>  Analog Devices AD7476 and similar 1-channel ADCs driver 
-           *** Analog to digital converters *** +                ... 
-     [--snip--] +            ... 
- +        ...
-     <*>   Analog Devices AD7475/6/7/8 AD7466/7/and AD7495 ADC driver +
- +
-     [--snip--] +
 </code> </code>
  
Line 190: Line 275:
 {{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/**
Line 200: Line 285:
  
 root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **ls -l** root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **ls -l**
-drwxr-xr-x    5 root     root             0 Jan  1 00:00 device0:buffer0 +drwxr-xr-x    5 root     root             0 Jan  1 00:00 buffer 
--r--r--r--    1 root     root          4096 Jan  1 00:00 in0_raw +-r--r--r--    1 root     root          4096 Jan  1 00:00 in_voltage0_raw 
--r--r--r--    1 root     root          4096 Jan  1 00:00 in_scale+-r--r--r--    1 root     root          4096 Jan  1 00:00 in_voltage_scale
 -r--r--r--    1 root     root          4096 Jan  1 00:00 name -r--r--r--    1 root     root          4096 Jan  1 00:00 name
 lrwxrwxrwx    1 root     root             0 Jan  1 00:00 subsystem -> ../../../../../bus/iio lrwxrwxrwx    1 root     root             0 Jan  1 00:00 subsystem -> ../../../../../bus/iio
 drwxr-xr-x    2 root     root             0 Jan  1 00:00 trigger drwxr-xr-x    2 root     root             0 Jan  1 00:00 trigger
 -rw-r--r--    1 root     root          4096 Jan  1 00:00 uevent -rw-r--r--    1 root     root          4096 Jan  1 00:00 uevent
-</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.3/device0> **cat name** root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **cat name**
 ad7476 ad7476
-</xterm></box>+</xterm></WRAP>
  
  
Line 223: Line 307:
  
 **Description:**\\ **Description:**\\
-scale to be applied to in0_raw in order to obtain the measured voltage in millivolts.+scale to be applied to in_voltage0_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.3/device0> **cat in_scale**+root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **cat in_voltage_scale**
 0.805 0.805
-</xterm></box>+</xterm></WRAP>
  
 === Show channel 0 measurement === === Show channel 0 measurement ===
Line 236: Line 320:
 Raw unscaled voltage measurement on channel 0 Raw unscaled voltage measurement on channel 0
  
-<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.3/device0> **cat in0_raw**+root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **cat in_voltage0_raw**
 2001 2001
-</xterm></box>+</xterm></WRAP>
  
-**U** = //in0_raw in_scale// = 2001 * 0.805 = **1610,805 //mV//**+**U** = //in_voltage0_raw in_voltage_scale// = 2001 * 0.805 = **1610,805 //mV//**
  
 ===== Trigger management ===== ===== Trigger management =====
Line 254: Line 338:
 ===== Buffer management ===== ===== Buffer management =====
  
-<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.3/device0/device0:buffer0> ls root:/sys/devices/platform/bfin-spi.0/spi0.3/device0/device0:buffer0> ls
Line 261: Line 345:
 device0:buffer0:event0   **scan_elements** device0:buffer0:event0   **scan_elements**
 root:/sys/devices/platform/bfin-spi.0/spi0.3/device0/device0:buffer0> root:/sys/devices/platform/bfin-spi.0/spi0.3/device0/device0:buffer0>
-</xterm></box>+</xterm></WRAP>
  
 {{page>software:linux:docs:iio:iio_snippets#Buffer management&noheader&firstseconly&noeditbtn}} {{page>software:linux:docs:iio:iio_snippets#Buffer management&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:/sys/devices/platform/bfin-spi.0/spi0.3/device0/device0:buffer0/scan_elements> ls root:/sys/devices/platform/bfin-spi.0/spi0.3/device0/device0:buffer0/scan_elements> ls
Line 271: Line 355:
 in0_index        timestamp_en     timestamp_type in0_index        timestamp_en     timestamp_type
 root:/sys/devices/platform/bfin-spi.0/spi0.3/device0/device0:buffer0/scan_elements> root:/sys/devices/platform/bfin-spi.0/spi0.3/device0/device0:buffer0/scan_elements>
-</xterm></box>+</xterm></WRAP>
  
 {{page>software:linux:docs:iio:iio_snippets#Typical ADC scan elements&noheader&firstseconly&noeditbtn}} {{page>software:linux:docs:iio:iio_snippets#Typical ADC scan elements&noheader&firstseconly&noeditbtn}}
resources/tools-software/linux-drivers/iio-adc/ad7476a.1347101038.txt.gz · Last modified: 08 Sep 2012 12:43 by Lars-Peter Clausen