Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
resources:tools-software:linux-drivers:iio-dac:ad5791 [16 Nov 2012 13:50] – [Reference Circuits] Add missing CN Lars-Peter Clausen | resources:tools-software:linux-drivers:iio-dac:ad5791 [18 Feb 2013 14:56] – [Adding Linux driver support] The driver is no longer in staging Lars-Peter Clausen |
---|
</code> | </code> |
| |
<note tip> | <WRAP tip> |
This driver supports also an alternative way of specifying the reference voltage, by using the Linux regulator framework. | This driver supports also an alternative way of specifying the reference voltage, by using the Linux regulator framework. |
</note> | </WRAP> |
| |
===== Specifying reference voltage via the regulator framework ===== | ===== Specifying reference voltage via the regulator framework ===== |
"make qconfig") | "make qconfig") |
| |
<note> | <WRAP round help> |
The AD5791 Driver depends on **CONFIG_SPI** | The AD5791 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 | Digital to analog converters ---> |
-*- Enable triggered sampling support | ... |
| <*> Analog Devices AD5760/AD5780/AD5781/AD5790/AD5791 DAC SPI driver |
*** Digital to analog convertors *** | ... |
[--snip--] | ... |
| ... |
<*> Analog Devices AD5791/AD5781 DAC spi driver | |
| |
[--snip--] | |
| |
</code> | </code> |
| |
====== Hardware configuration ====== | ====== Hardware configuration ====== |
| |
{{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/** |
lrwxrwxrwx 1 root root 0 Jan 4 12:28 subsystem -> ../../../../../bus/iio | lrwxrwxrwx 1 root root 0 Jan 4 12:28 subsystem -> ../../../../../bus/iio |
-rw-r--r-- 1 root root 4096 Jan 4 12:28 uevent | -rw-r--r-- 1 root root 4096 Jan 4 12:28 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/iio:device0> **cat name** | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat name** |
ad5791 | ad5791 |
</xterm></box> | </xterm></WRAP> |
| |
=== Show scale === | === Show scale === |
scale to be applied to out_voltage0_raw in order to obtain the measured voltage in millivolts. | scale to be applied to out_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/iio:device0> **cat out_voltage_scale** | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage_scale** |
0.019 | 0.019 |
</xterm></box> | </xterm></WRAP> |
| |
=== Set channel Y output voltage === | === Set channel Y output voltage === |
channel Y. | channel Y. |
| |
<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/iio:device0> echo 131579 > out_voltage0_raw | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> echo 131579 > out_voltage0_raw |
</xterm></box> | </xterm></WRAP> |
| |
**U** = //out_voltage0_raw * out_voltage_scale// = 131579 * 0.019 = **2500.001 //mV//** | **U** = //out_voltage0_raw * out_voltage_scale// = 131579 * 0.019 = **2500.001 //mV//** |
| |
<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/iio:device0> echo -131579 > out_voltage0_raw | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> echo -131579 > out_voltage0_raw |
</xterm></box> | </xterm></WRAP> |
| |
**U** = //out_voltage0_raw * out_voltage_scale// = -131579 * 0.019 = **-2500.001 //mV//** | **U** = //out_voltage0_raw * out_voltage_scale// = -131579 * 0.019 = **-2500.001 //mV//** |
Lists all available output power down modes. | Lists all available output power down modes. |
| |
<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/iio:device0> **cat out_voltage_powerdown_mode_available** | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage_powerdown_mode_available** |
6kohm_to_gnd three_state | 6kohm_to_gnd three_state |
</xterm></box> | </xterm></WRAP> |
| |
=== Set power down mode === | === Set power down mode === |
| |
| |
<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/iio:device0> **echo three_state > out_voltage_powerdown_mode** | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **echo three_state > out_voltage_powerdown_mode** |
root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage_powerdown_mode** | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage_powerdown_mode** |
three_state | three_state |
</xterm></box> | </xterm></WRAP> |
| |
=== Enable power down mode on output Y === | === Enable power down mode on output Y === |
controlled together. | controlled together. |
| |
<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/iio:device0> **echo 1 > out_voltage0_powerdown** | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **echo 1 > out_voltage0_powerdown** |
root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage0_powerdown** | root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage0_powerdown** |
0 | 0 |
</xterm></box> | </xterm></WRAP> |
| |
====== More Information ====== | ====== More Information ====== |
| |
{{page>software:linux:docs:iio:iio_snippets#iio pointers&noheader&firstseconly&noeditbtn}} | {{page>software:linux:docs:iio:iio_snippets#iio pointers&noheader&firstseconly&noeditbtn}} |