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-dac:ad5758 [23 May 2018 10:46] – Description Stefan Popa | resources:tools-software:linux-drivers:iio-dac:ad5758 [15 Oct 2018 16:25] (current) – adc->dac Stefan Popa | ||
---|---|---|---|
Line 15: | Line 15: | ||
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: | ||
+ | |||
+ | ====== Source Code ====== | ||
+ | |||
+ | ===== Status ===== | ||
+ | |||
+ | ^ Source ^ Mainlined? ^ | ||
+ | | [[git.linux.org> | ||
+ | |||
+ | ===== Files ===== | ||
+ | |||
+ | ^ Function ^ File ^ | ||
+ | | driver | ||
+ | |||
+ | ===== Devicetree ===== | ||
+ | |||
+ | Required properties for the AD5758: | ||
+ | * compatible: Must be " | ||
+ | * reg: SPI chip select number for the device | ||
+ | * spi-max-frequency: | ||
+ | * spi-cpha: is the only mode that is supported | ||
+ | |||
+ | Optional properties: | ||
+ | |||
+ | * reset-gpios : GPIO spec for the RESET pin. If specified, it will be asserted during driver probe. | ||
+ | * adi, | ||
+ | * adi, | ||
+ | * adi,slew: Array of slewrate settings should contain 3 fields: | ||
+ | * adi,range: The output range | ||
+ | |||
+ | < | ||
+ | # | ||
+ | # | ||
+ | status = " | ||
+ | |||
+ | ad5758@0 { | ||
+ | compatible = " | ||
+ | reg = <0>; | ||
+ | spi-max-frequency = < | ||
+ | spi-cpha; | ||
+ | |||
+ | reset-gpios = <& | ||
+ | |||
+ | adi, | ||
+ | adi, | ||
+ | adi,slew = <1 200000 12>; | ||
+ | adi,range = <1>; | ||
+ | </ | ||
+ | |||
+ | ====== Driver testing ====== | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root:/> **cd / | ||
+ | root:/ | ||
+ | iio:device0 | ||
+ | |||
+ | root:/ | ||
+ | |||
+ | root:/ | ||
+ | -r--r--r-- 1 root root 4096 May 23 09:14 dev | ||
+ | -rw-r--r-- 1 root root 4096 May 23 09:14 out_voltage0_powerdown | ||
+ | -rw-r--r-- 1 root root 4096 May 23 09:14 out_voltage0_raw | ||
+ | -rw-r--r-- 1 root root 4096 May 23 09:14 out_voltage_scale | ||
+ | -r--r--r-- 1 root root 4096 May 23 09:14 name | ||
+ | drwxr-xr-x 2 root root 0 May 23 09:14 power | ||
+ | lrwxrwxrwx 1 root root 0 May 23 09:14 subsystem -> ../ | ||
+ | -rw-r--r-- 1 root root 4096 May 23 09:14 uevent | ||
+ | </ | ||
+ | |||
+ | === Show device name === | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root:/ | ||
+ | ad5758 | ||
+ | </ | ||
+ | |||
+ | === Show scale === | ||
+ | |||
+ | **Description: | ||
+ | scale to be applied to in_voltage0_raw in order to obtain the measured voltage in millivolts. | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root:/ | ||
+ | 0.152587890 | ||
+ | </ | ||
+ | |||
+ | === Set channel 0 output voltage === | ||
+ | |||
+ | **Description: | ||
+ | / | ||
+ | |||
+ | Raw (unscaled, no bias etc.) output voltage for | ||
+ | channel 0. | ||
+ | |||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root:/ | ||
+ | </ | ||
+ | |||
+ | **U** = // | ||
+ | |||
+ | === Enable power down mode on output 0 === | ||
+ | |||
+ | / | ||
+ | |||
+ | **Description: | ||
+ | Writing 1 causes output 0 to enter the power down mode. Clearing returns to | ||
+ | normal operation. | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root:/ | ||
+ | root:/ | ||
+ | 1 | ||
+ | root:/ | ||
+ | root:/ | ||
+ | 0 | ||
+ | </ | ||
+ | |||
+ | ====== More Information ====== | ||
+ | |||
+ | {{page> | ||
+ |