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-dac:ad5360 [21 Nov 2011 14:28] – [Driver testing] Fix typo Lars-Peter Clausenresources:tools-software:linux-drivers:iio-dac:ad5360 [29 Jan 2024 13:00] (current) – [Example device tree] Avoid error message "debugfs: Directory 'fixed-supply' with parent 'regulator' already present!" Ilario Gelmetti
Line 11: Line 11:
   * [[adi>AD5372]]   * [[adi>AD5372]]
   * [[adi>AD5373]]   * [[adi>AD5373]]
- 
- 
-===== Reference Circuits ===== 
- 
-  * [[adi>CN0123]] 
-  * [[adi>CN0131]] 
-  * [[adi>CN0149]] 
  
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
Line 39: Line 32:
 ===== Status ===== ===== Status =====
  
- Source   Mainlined?  +^ Source ^ Mainlined? ^ 
-| [[bfgit>linux-kernel?drivers/staging/iio/dac/ad5360.c|git]] |  [[git.linux.org>drivers/staging/iio/dac/ad5360.c|Inprogress]]  |+| [[git.linux.org>drivers/iio/dac/ad5360.c|git]] | [[git.linux.org>drivers/iio/dac/ad5360.c|Yes]] |
 ===== Files ===== ===== Files =====
  
 ^ Function ^ File ^ ^ Function ^ File ^
-| driver  | [[git.linux.org>drivers/staging/iio/dac/ad5360.c]] |+| driver  | [[git.linux.org>drivers/iio/dac/ad5360.c]] | 
 + 
 +====== Example device tree ====== 
 +<code c> 
 + fragment@0 { 
 + target-path = "/"; 
 + __overlay__ { 
 + vref0: fixedregulator@0 { 
 + compatible = "regulator-fixed"; 
 + regulator-name = "fixed-supply0"; 
 + regulator-min-microvolt = <3000000>; 
 + regulator-max-microvolt = <3000000>; 
 + regulator-boot-on; 
 + }; 
 + vref1: fixedregulator@1 { 
 + compatible = "regulator-fixed"; 
 + regulator-name = "fixed-supply1"; 
 + regulator-min-microvolt = <3000000>; 
 + regulator-max-microvolt = <3000000>; 
 + regulator-boot-on; 
 + }; 
 + }; 
 + }; 
 + 
 + fragment@1 { 
 + target = <&spi0>; 
 + __overlay__ { 
 + #address-cells = <1>; 
 + #size-cells = <0>; 
 + status = "okay"; 
 + 
 + ad5370@0{ 
 + compatible = "adi,ad5370"; 
 + reg = <0>; 
 + spi-max-frequency = <1000000>; 
 + spi-cpha; 
 + vref0-supply = <&vref0>; 
 + vref1-supply = <&vref1>; 
 + }; 
 + }; 
 + }; 
 +}; 
 +</code>
  
 ====== Example platform device initialization ====== ====== Example platform device initialization ======
Line 153: Line 188:
 "make qconfig") "make qconfig")
  
-<note>+<WRAP round help>
 The AD5360 Driver depends on **CONFIG_SPI** The AD5360 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 Analog Devices AD5360/61/62/63/70/71/73 DAC driver 
-           *** Digital to analog convertors *** +                ... 
-     [--snip--] +            ... 
- +        ...
-     <*>  Analog Devices Analog Devices AD5360/61/62/63/70/71/73 DAC driver +
- +
-     [--snip--] +
 </code> </code>
- 
 ====== Hardware configuration ====== ====== Hardware configuration ======
  
Line 183: Line 213:
 {{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 209: Line 239:
 lrwxrwxrwx    1 root     root             0 Jan  2 21:54 subsystem -> ../../../../../bus/iio lrwxrwxrwx    1 root     root             0 Jan  2 21:54 subsystem -> ../../../../../bus/iio
 -rw-r--r--    1 root     root          4096 Jan  2 21:54 uevent -rw-r--r--    1 root     root          4096 Jan  2 21:54 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**
 ad5360 ad5360
-</xterm></box>+</xterm></WRAP>
  
 === Show scale === === Show scale ===
Line 225: Line 255:
 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_voltage0_scale** root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage0_scale**
 0.038140 0.038140
-</xterm></box>+</xterm></WRAP>
  
 === Set channel Y output voltage === === Set channel Y output voltage ===
Line 239: Line 269:
 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 10000 > out_voltage0_raw** root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **echo 10000 > out_voltage0_raw**
-</xterm></box>+</xterm></WRAP>
  
 **U** = //out_voltage0_raw * out_voltage0_scale// = 10000 * 0,038140 //mV// = **381,14 //mV//** **U** = //out_voltage0_raw * out_voltage0_scale// = 10000 * 0,038140 //mV// = **381,14 //mV//**
Line 253: Line 283:
 Each channel has an adjustable gain which can be used to calibrate the channel's scale and compensate for full-scale errors. The default value is 65535. Each channel has an adjustable gain which can be used to calibrate the channel's scale and compensate for full-scale errors. The default value is 65535.
  
-If scale calibration is used the following formula can be used calculate the output voltage: +If scale calibration is used the following formula can be used calculate the output voltage:
 **U** = //( ( out_voltageY_raw * ( out_voltageY_calibscale + 1 ) ) / 2^16 - out_voltageY_calibbias ) *  out_voltageY_scale// **U** = //( ( out_voltageY_raw * ( out_voltageY_calibscale + 1 ) ) / 2^16 - out_voltageY_calibbias ) *  out_voltageY_scale//
  
Line 263: Line 293:
 Each channel has an adjustable offset which can be used to calibrate the channel's offset and compensate for zero-scale errors. The default value is 0. Each channel has an adjustable offset which can be used to calibrate the channel's offset and compensate for zero-scale errors. The default value is 0.
  
-If offset calibration is used the following formula can be used calculate the output voltage: +If offset calibration is used the following formula can be used calculate the output voltage:
 **U** = //( ( out_voltageY_raw * ( out_voltageY_calibscale + 1 ) ) / 2^16 - out_voltageY_calibbias ) *  out_voltageY_scale// **U** = //( ( out_voltageY_raw * ( out_voltageY_calibscale + 1 ) ) / 2^16 - out_voltageY_calibbias ) *  out_voltageY_scale//
  
Line 274: Line 304:
 normal operation. normal operation.
  
-<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_voltage_powerdown** root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **echo 1 > out_voltage_powerdown**
Line 282: Line 312:
 root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage_powerdown** root:/sys/devices/platform/bfin-spi.0/spi0.3/iio:device0> **cat out_voltage_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}}
resources/tools-software/linux-drivers/iio-dac/ad5360.1321882088.txt.gz · Last modified: 21 Nov 2011 14:28 by Lars-Peter Clausen