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:ad7768 [05 Jul 2018 14:38] – Show device name Stefan Poparesources:tools-software:linux-drivers:iio-adc:ad7768 [06 Nov 2023 11:41] (current) – Add note about adi,datalines property Ana-Maria Cusco
Line 5: Line 5:
 This driver supports the This driver supports the
   * [[adi>AD7768]]   * [[adi>AD7768]]
 +  * [[adi>AD7768-4]]
  
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
  
   * [[adi>EVAL-AD7768]]   * [[adi>EVAL-AD7768]]
 +  * [[adi>EVAL-AD7768-4]]
  
 ===== Description ===== ===== Description =====
Line 27: Line 29:
 ^ Function ^ File ^ ^ Function ^ File ^
 | driver  | [[linux.github>master/drivers/iio/adc/ad7768.c]] | | driver  | [[linux.github>master/drivers/iio/adc/ad7768.c]] |
 +| devicetree bindings | [[linux.github>master?Documentation/devicetree/bindings/iio/adc/adi,ad7768.yaml | Documentation/devicetree/bindings/iio/adc/adi,ad7768.yaml]] |
 +| hdl project | [[https://github.com/analogdevicesinc/hdl/tree/hdl_2017_r1/projects/ad7768evb | hdl]] |
  
 ====== Example Linux Device-Tree Initialization ====== ====== Example Linux Device-Tree Initialization ======
  
 Required properties: Required properties:
-  * compatible: Must be one of "adi,ad7768".+  * compatible: Must be one of "adi,ad7768", "adi,ad7768-4".
   * reg: SPI chip select number for the device.   * reg: SPI chip select number for the device.
 +  * clocks: phandle to master clock of the device.
 +  * clock-names: Must be "mclk".
   * spi-max-frequency: See Documentation/devicetree/bindings/spi/spi-bus.txt.   * spi-max-frequency: See Documentation/devicetree/bindings/spi/spi-bus.txt.
   * dmas: DMA specifier, consisting of a phandle to DMA controller node.   * dmas: DMA specifier, consisting of a phandle to DMA controller node.
   * dma-names: Must be "rx".   * dma-names: Must be "rx".
   * vref-supply: phandle to the regulator for ADC reference voltage.   * vref-supply: phandle to the regulator for ADC reference voltage.
 +Optional properties:
 +  * reset-gpios: Reset GPIO.
 +  * adi,data-lines: Number of DOUTx pins channels data is output on. Default value: 1.
  
 +**NOTE:** The //adi,data-lines// value is determined by the configuration of the AD7768/AD7768-4 chip's FORMATx pins. These pins are read on power-up and dictate the number of data lines (DOUTx) on which the ADC conversions are output. 
 ^ Function ^ File ^ ^ Function ^ File ^
 | AD7768 Device Tree  | [[linux.github>master?arch/arm/boot/dts/zynq-zed-adv7511-ad7768.dts | AD7768 Device Tree  | [[linux.github>master?arch/arm/boot/dts/zynq-zed-adv7511-ad7768.dts
Line 60: Line 70:
  
 root:/sys/bus/iio/devices/iio:device0> **ls -l** root:/sys/bus/iio/devices/iio:device0> **ls -l**
-drwxrwxrwx 2 root root    0 Jan  1 00:02 buffer +total 0 
--rw-rw-rw- 1 root root 4096 Jan  1 00:02 dev +drwxr-xr-x 2 root root    0 Apr  2 21:43 buffer 
--rw-rw-rw- 1 root root 4096 Jan  00:02 in_voltage_scale +drwxr-xr-x 2 root root    0 Apr  2 21:43 buffer0 
--rw-rw-rw- 1 root root 4096 Jan  00:02 name +-r--r--r-- 1 root root 4096 Apr  2 21:43 dev 
-lrwxrwxrwx 1 root root    0 Jan  1 00:02 of_node -> ../../../../../../../../firmware/devicetree/base/amba/spi@e0006000/adc@0 +-rw-r--r-- 1 root root 4096 Apr  2 21:43 filter_type 
-drwxrwxrwx 2 root root    0 Jan  1 00:02 power +-r--r--r-- root root 4096 Apr  2 21:43 filter_type_available 
-drwxrwxrwx 2 root root    0 Jan  1 00:02 scan_elements +-rw-r--r-- 1 root root 4096 Apr  2 21:43 in_voltage_scale 
-lrwxrwxrwx 1 root root    0 Jan  1 00:02 subsystem -> ../../../../../../../../bus/iio +-r--r--r-- root root 4096 Apr  2 21:43 name 
--rw-rw-rw- 1 root root 4096 Jan  1 00:02 uevent+lrwxrwxrwx 1 root root    0 Apr  2 21:43 of_node -> ../../../../../../../../firmware/devicetree/base/axi/spi@e0006000/adc@0 
 +drwxr-xr-x 2 root root    0 Apr  2 21:43 power 
 +-rw-r--r-- 1 root root 4096 Apr  2 21:43 power_mode 
 +-r--r--r-- 1 root root 4096 Apr  2 21:43 power_mode_available 
 +-rw-r--r-- 1 root root 4096 Apr  2 21:43 sampling_frequency 
 +-r--r--r-- 1 root root 4096 Apr  2 21:43 sampling_frequency_available 
 +drwxr-xr-x 2 root root    0 Apr  2 21:42 scan_elements 
 +lrwxrwxrwx 1 root root    0 Apr  2 21:42 subsystem -> ../../../../../../../../bus/iio 
 +-rw-r--r-- 1 root root 4096 Apr  2 21:42 uevent
 </xterm></WRAP> </xterm></WRAP>
  
Line 79: Line 97:
 </xterm></WRAP> </xterm></WRAP>
  
 +=== Show scale ===
 +
 +**Description:**\\
 +scale to be applied to in_voltage0_raw in order to obtain the measured voltage in millivolts.
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/sys/bus/iio/devices/iio:device0> **cat in_voltage_scale **
 +0.000488281
 +</xterm></WRAP>
 +
 +====== More Information ======
 +
 +{{page>software:linux:docs:iio:iio_snippets#iio pointers&noheader&firstseconly&noeditbtn}}
resources/tools-software/linux-drivers/iio-adc/ad7768.1530794281.txt.gz · Last modified: 05 Jul 2018 14:38 by Stefan Popa