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
playground:playground [21 Jan 2021 19:46] – Reset Playground Robin Getzplayground:playground [05 Apr 2024 13:03] (current) – Edit Tinaco Mariel
Line 1: Line 1:
-====== Playground for first time editors ======+====== AD8460 IIO DAC Linux Driver ======
  
-Wiki pages are written in a simple, plain-text [[wiki:syntax]] that is extended with a few [[wiki:more_syntax|more plugins]] and a [[wiki:math|Math formulas]], that allows structuring the page and pleasant formatting while retaining high readability of the page source. When you edit a page and save your changes, the previous content will not be lost. Instead it will be saved as an old revision of the page and can still be viewed or even restored.+===== Supported Devices =====
  
-Before you edit your first "real" page in the wiki, you should try out the possibilities here, in the [[playground:playground]]. The playground is provided so that users can test things and play around to their heart's content.  (A playground is created when installing DokuWiki, in the "playground" namespace.  This page is periodically cleared, so you can make any changes you want.+  * [[adi>AD8460]]
  
-===== Suggestions for first time editors ===== +===== Evaluation Boards =====
-  * use [[wiki/syntax#interwiki]] links. Links that can be replaced with the interwiki links will be. +
-  * use [[:wiki:syntax#internal]] links. Links that can be replaced with internal links will be. +
-  * think about your document structure before you start writing it. +
-  * Multi-page documents need to be structured and thought out before you start.+
  
 +  * [[adi>EVAL-AD8460SDZ]]
 +
 +===== Description =====
 +
 +This is a Linux industrial I/O (IIO) subsystem driver, targeting single channel DAC. 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 IIO for more information.
 +
 +See [[software:linux:docs:iio:iio|IIO]] for more information.
 +
 +{{ :software:driver:linux:ad8460-fbl.png}}
 +
 +
 +====== Source Code ======
 +
 +===== Status =====
 +
 +^ Source ^ Mainlined? ^
 +| [[git.linux.org>drivers/iio/dac/ad8460.c|git]] | [No] |
 +
 +===== Files =====
 +
 +^ Function ^ File ^
 +| driver  | [[linux.github>master?drivers/iio/dac/ad8460.c | drivers/iio/dac/ad8460.c]] |
 +| include  | [[linux.github>master?include/dt-bindings/iio/adi,ad8460.h | include/dt-bindings/iio/adi,ad8460.h]] |
 +| Documentation  | [[linux.github>master?Documentation/devicetree/bindings/iio/dac/ad8460.txt | Documentation/devicetree/bindings/iio/dac/ad8460.txt]] |
 +
 +
 +====== Hardware configuration ======
 +
 +==== Device tree example ====
 +
 +The following example instantiates the ad8460 driver for an AD8460 device connected on the SPI bus to the chip-select line 0.
 +
 +<code>
 +#include <dt-bindings/iio/adi,ad8460.h>
 +#include "zynq-zed.dtsi"
 +#include "zynq-zed-adv7511.dtsi"
 +
 +/ {
 + clocks {
 + sync_ext_clk: ext-clk {
 + #clock-cells = <0x0>;
 + compatible = "fixed-clock";
 + clock-frequency = <500000>;
 + clock-output-names = "sync_ext_clk";
 + };
 + };
 +};
 +
 +&fpga_axi {
 +
 + tx_dma: tx_dmac@44000000 {
 + compatible = "adi,axi-dmac-1.00.a";
 + reg = <0x44000000 0x1000>;
 + interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
 + clocks = <&clkc 15>;
 + #dma-cells = <1>;
 +
 + adi,channels {
 + #size-cells = <0>;
 + #address-cells = <1>;
 +
 + dma-channel@0 {
 + reg = <0>;
 + adi,source-bus-width = <64>;
 + adi,source-bus-type = <0>;
 + adi,destination-bus-width = <32>;
 + adi,destination-bus-type = <2>;
 + adi,cyclic;
 + };
 + };
 + };
 +};
 +
 +&spi0 {
 + status = "okay";
 +
 + ad8460: dac@0 {
 + compatible = "adi,ad8460";
 + reg = <0>;
 + spi-max-frequency = <8000000>;
 + adi,rset-ohms = <2000>;
 + adi,ilim-microamp = <100000 100000>;
 + adi,vlim-microvolt = <(-40000000) 40000000>;
 + adi,temp-lim-millicelsius = <40000>;
 +
 + clocks = <&sync_ext_clk>;
 + clock-names = "sync_clk";
 +
 + dma-names = "tx";
 + dmas = <&tx_dma 0>;
 + };
 +};
 +
 +</code>
 +
 +====== Driver testing ======
 +
 +If the driver correctly detected the device, the "iio_info" program should inform us about the available channels:
 +
 +<code>
 +root@linaro-ubuntu-desktop:~# iio_info 
 +Library version: 0.24 (git tag: accb7b5)
 +Compiled with backends: local xml ip usb serial
 +IIO context created with local backend.
 +Backend version: 0.24 (git tag: accb7b5)
 +Backend description string: Linux analog 6.1.0-271638-g3dfbf1932ce9-dirty #348 SMP PREEMPT Fri Apr  5 16:48:16 CST 2024 armv7l
 +IIO context has 9 attributes:
 +        hdl_system_id: [ad8460] on [zed] git branch [master] git [ea29a37eae8a1daeaadb79281b3085709aaedb1c] clean [2024-01-29 03:51:24] UTC
 +        hw_model: AD8460-FMC-EVAL-BZ on Xilinx Zynq ZED
 +        hw_carrier: Xilinx Zynq ZED
 +        hw_mezzanine: AD8460-FMC-EVAL-BZ
 +        hw_name: AD8460-EVAL-RevB
 +        hw_vendor: Analog Devices
 +        hw_serial: AD8460-FMC-EVAL-BZ
 +        local,kernel: 6.1.0-271638-g3dfbf1932ce9-dirty
 +        uri: local:
 +IIO context has 4 devices:
 +        hwmon0: e000b000ethernetffffffff00
 +                1 channels found:
 +                        temp1:  (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: crit value: 100000
 +                                attr  1: input value: 16000
 +                                attr  2: max_alarm value: 0
 +                No trigger on this device
 +        iio:device0: xadc
 +                9 channels found:
 +                        voltage5: vccoddr (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vccoddr
 +                                attr  1: raw value: 2048
 +                                attr  2: scale value: 0.732421875
 +                        voltage0: vccint (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vccint
 +                                attr  1: raw value: 1382
 +                                attr  2: scale value: 0.732421875
 +                        voltage4: vccpaux (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vccpaux
 +                                attr  1: raw value: 2454
 +                                attr  2: scale value: 0.732421875
 +                        temp0:  (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: offset value: -2219
 +                                attr  1: raw value: 2534
 +                                attr  2: scale value: 123.040771484
 +                        voltage7: vrefn (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vrefn
 +                                attr  1: raw value: -4
 +                                attr  2: scale value: 0.732421875
 +                        voltage1: vccaux (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vccaux
 +                                attr  1: raw value: 2452
 +                                attr  2: scale value: 0.732421875
 +                        voltage2: vccbram (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vccbram
 +                                attr  1: raw value: 1381
 +                                attr  2: scale value: 0.732421875
 +                        voltage3: vccpint (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vccpint
 +                                attr  1: raw value: 1376
 +                                attr  2: scale value: 0.732421875
 +                        voltage6: vrefp (input)
 +                        3 channel-specific attributes found:
 +                                attr  0: label value: vrefp
 +                                attr  1: raw value: 1702
 +                                attr  2: scale value: 0.732421875
 +                2 device-specific attributes found:
 +                                attr  0: sampling_frequency value: 961538
 +                                attr  1: waiting_for_supplier value: 0
 +                No trigger on this device
 +        iio:device1: ad8460
 +                1 channels found:
 +                        altvoltage0:  (output)
 +                        2 channel-specific attributes found:
 +                                attr  0: powerdown value: 0
 +                                attr  1: sampling_frequency value: 500000
 +                2 device-specific attributes found:
 +                                attr  0: scale value: 80
 +                                attr  1: waiting_for_supplier value: 0
 +                5 debug attributes found:
 +                                debug attr  0: apg_pattern_memory value: 0 0x2000
 +                                debug attr  1: shutdown_flag value: 0
 +                                debug attr  2: apg_pattern_depth value: 3
 +                                debug attr  3: apg_mode_enable value: 0
 +                                debug attr  4: direct_reg_access value: 0x10
 +                No trigger on this device
 +        iio_sysfs_trigger:
 +                0 channels found:
 +                2 device-specific attributes found:
 +                                attr  0: add_trigger ERROR: Permission denied (13)
 +                                attr  1: remove_trigger ERROR: Permission denied (13)
 +                No trigger on this device
 +</code>
playground/playground.1611254804.txt.gz · Last modified: 21 Jan 2021 19:46 by Robin Getz