This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
resources:tools-software:linux-drivers:iio-adc:ad7768 [05 Jul 2018 14:12] Stefan Popa Source Code |
resources:tools-software:linux-drivers:iio-adc:ad7768 [05 Jul 2018 15:07] (current) Stefan Popa More Information |
||
---|---|---|---|
Line 22: | Line 22: | ||
^ Source ^ Mainlined? ^ | ^ Source ^ Mainlined? ^ | ||
| [[linux.github>master/drivers/iio/adc/ad7768.c|git]] | [In progress...] | | | [[linux.github>master/drivers/iio/adc/ad7768.c|git]] | [In progress...] | | ||
+ | |||
+ | ===== Files ===== | ||
+ | |||
+ | ^ Function ^ File ^ | ||
+ | | driver | [[linux.github>master/drivers/iio/adc/ad7768.c]] | | ||
+ | | devicetree bindings | [[linux.github>master?Documentation/devicetree/bindings/iio/adc/adi,ad7768.txt | Documentation/devicetree/bindings/iio/adc/adi,ad7768.txt]] | | ||
+ | | hdl project | [[https://github.com/analogdevicesinc/hdl/tree/hdl_2017_r1/projects/ad7768evb | hdl]] | | ||
+ | |||
+ | ====== Example Linux Device-Tree Initialization ====== | ||
+ | |||
+ | Required properties: | ||
+ | * compatible: Must be one of "adi,ad7768". | ||
+ | * reg: SPI chip select number for the device. | ||
+ | * spi-max-frequency: See Documentation/devicetree/bindings/spi/spi-bus.txt. | ||
+ | * dmas: DMA specifier, consisting of a phandle to DMA controller node. | ||
+ | * dma-names: Must be "rx". | ||
+ | * vref-supply: phandle to the regulator for ADC reference voltage. | ||
+ | |||
+ | ^ Function ^ File ^ | ||
+ | | AD7768 Device Tree | [[linux.github>master?arch/arm/boot/dts/zynq-zed-adv7511-ad7768.dts | ||
+ | | zynq-zed-adv7511-ad7768.dts]] | | ||
+ | |||
+ | ====== Driver testing ====== | ||
+ | |||
+ | {{page>software:linux:docs:iio:iio_snippets#iio device files&noheader&firstseconly&noeditbtn}} | ||
+ | |||
+ | <WRAP top tip round box 60%>**TIP:** | ||
+ | An example program which uses the interface can be found here: | ||
+ | * [[resources:tools-software:linux-software:iio_oscilloscope|IIO Oscilloscope]] | ||
+ | </WRAP>\\ | ||
+ | |||
+ | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> | ||
+ | <xterm> | ||
+ | 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** | ||
+ | drwxrwxrwx 2 root root 0 Jan 1 00:02 buffer | ||
+ | -rw-rw-rw- 1 root root 4096 Jan 1 00:02 dev | ||
+ | -rw-rw-rw- 1 root root 4096 Jan 1 00:02 in_voltage_scale | ||
+ | -rw-rw-rw- 1 root root 4096 Jan 1 00:02 name | ||
+ | lrwxrwxrwx 1 root root 0 Jan 1 00:02 of_node -> ../../../../../../../../firmware/devicetree/base/amba/spi@e0006000/adc@0 | ||
+ | drwxrwxrwx 2 root root 0 Jan 1 00:02 power | ||
+ | drwxrwxrwx 2 root root 0 Jan 1 00:02 scan_elements | ||
+ | lrwxrwxrwx 1 root root 0 Jan 1 00:02 subsystem -> ../../../../../../../../bus/iio | ||
+ | -rw-rw-rw- 1 root root 4096 Jan 1 00:02 uevent | ||
+ | </xterm></WRAP> | ||
+ | |||
+ | === Show device name === | ||
+ | |||
+ | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> | ||
+ | <xterm> | ||
+ | root:/sys/bus/iio/devices/iio:device0> **cat name** | ||
+ | ad7768 | ||
+ | </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}} |