Wiki

This version is outdated by a newer approved version.DiffThis version (18 Jul 2018 14:52) is a draft.
Approvals: 0/1

This is an old revision of the document!


AD5770R IIO DAC Linux Driver

Supported Devices

This driver supports the

Evaluation Boards

Description

This is a Linux industrial I/O (IIO) subsystem driver, targeting multi-channel serial interface DACs. 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.

Source Code

Status

Source Mainlined?
git [No]

Devicetree

Required devicetree properties for the AD5770R:

  • compatible: Must be “adi,ad5770r”
  • reg: SPI chip select number for the device
  • spi-max-frequency: Max SPI frequency to use (< 10000000)
  • child nodes: Each child node represents one channel.

Optional properties:

  • vref: Specify the voltage of the external reference used.
  • reset-gpios: GPIO spec for the RESET pin. If specified, it will be asserted during driver probe.
        ad5770r@0 {                                                              
                  compatible = "ad5770r";                                          
                  reg = <0>;                                                       
                  spi-max-frequency = <1000000>;                                   
                  vref-supply = <&vref>;                                           
                                                                                   
                  reset-gpios = <&gpio 22 0>;                                      
                                                                                   
                  channel@0 {                                                      
                          num = <0>;                                               
                          adi,range-microamp = <0 300000>;                         
                  };                                                               
                                                                                   
                  channel@1 {                                                      
                          num = <1>;                                               
                          adi,range-microamp = <0 140000>;                         
                  };                                                               
                                                                                   
                  channel@2 {                                                      
                          num = <2>;                                               
                          adi,range-microamp = <0 55000>;                          
                  };                                                               
                                                                                   
                  channel@3 {                                                      
                          num = <3>;                                               
                          adi,range-microamp = <0 45000>;                          
                  };                                                               
                                                                                   
                  channel@4 {                                                      
                          num = <4>;                                               
                          adi,range-microamp = <0 45000>;                          
                  };                                                               
                                                                                   
                  channel@5 {                                                      
                          num = <5>;                                               
                          adi,range-microamp = <0 45000>;                          
                  };                                                               
         };
         
         vref: fixedregulator@0 {                                                 
                  compatible = "regulator-fixed";                                  
                  regulator-name = "fixed-supply";                                 
                  regulator-min-microvolt = <1250000>;                             
                  regulator-max-microvolt = <1250000>;                             
         };  

Adding Linux driver support

Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)

Linux Kernel Configuration
    Device Drivers  --->
        ...
        <*>     Industrial I/O support --->
            --- Industrial I/O support
            ...
            Digital to analog converters  ---> 
                ...
                <*> Analog Devices AD5770R IDAC driver
                ...
            ...
        ...

Driver testing

Each and every IIO device, typically a hardware chip, has a device folder under /sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under every of these directory folders reside a set of files, depending on the characteristics and features of the hardware device in question. These files are consistently generalized and documented in the IIO ABI documentation. In order to determine which IIO deviceX corresponds to which hardware device, the user can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the sequence in which the iio device drivers are loaded/registered is constant, the numbering is constant and may be known in advance.

02 Mar 2011 15:16

This specifies any shell prompt running on the target

pi@raspberrypi:/sys/bus/iio/devices/iio:device0 $ cd /sys/bus/iio/devices/
pi@raspberrypi:/sys/bus/iio/devices $ ls
iio:device0  iio:device1
pi@raspberrypi:/sys/bus/iio/devices $ cd iio\:device0
pi@raspberrypi:/sys/bus/iio/devices/iio:device0 $ cat name
ad5770r
pi@raspberrypi:/sys/bus/iio/devices/iio:device0 $ ls -l
total 0
-r--r--r-- 1 root root 4096 Jul 18 12:12 dev
-r--r--r-- 1 root root 4096 Jul 18 12:12 name
lrwxrwxrwx 1 root root    0 Jul 18 12:12 of_node -> ../../../../../../../../firmware/devicetree/base/soc/spi@7e204000/ad5770r@0
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current0_filter_low_pass_3db_frequency
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current0_powerdown
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current0_raw
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current0_scale
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current1_filter_low_pass_3db_frequency
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current1_powerdown
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current1_raw
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current1_scale
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current2_filter_low_pass_3db_frequency
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current2_powerdown
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current2_raw
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current2_scale
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current3_filter_low_pass_3db_frequency
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current3_powerdown
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current3_raw
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current3_scale
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current4_filter_low_pass_3db_frequency
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current4_powerdown
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current4_raw
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current4_scale
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current5_filter_low_pass_3db_frequency
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current5_powerdown
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current5_raw
-rw-r--r-- 1 root root 4096 Jul 18 12:12 out_current5_scale
-r--r--r-- 1 root root 4096 Jul 18 12:12 out_current_filter_low_pass_3db_frequency_available
drwxr-xr-x 2 root root    0 Jul 18 12:12 power
lrwxrwxrwx 1 root root    0 Jul 18 12:12 subsystem -> ../../../../../../../../bus/iio
-rw-r--r-- 1 root root 4096 Jul 18 12:12 uevent

More Information

resources/tools-software/linux-drivers/iio-dac/ad5770r.1531918340.txt.gz · Last modified: 18 Jul 2018 14:52 by Mircea Caprioru