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
Next revisionBoth sides next revision
resources:tools-software:linux-drivers:iio-dac:ad5593r [23 Feb 2016 13:37] – [Description] Michael Hennerichresources:tools-software:linux-drivers:iio-dac:ad5593r [07 Jun 2016 16:36] – [Status] Michael Hennerich
Line 32: Line 32:
  
 ^ Source ^ Mainlined? ^ ^ Source ^ Mainlined? ^
-| [[linux.github>xcomm_zynq?drivers/iio/dac/ad5592r-base.c|git]] | WIP |+| [[git.linux.org>drivers/iio/dac/ad5592r-base.c|git]] | [[git.linux.org>drivers/iio/dac/ad5592r-base.c|Yes]] |
  
 ===== Files ===== ===== Files =====
Line 181: Line 181:
  
 </code> </code>
 +=== IIO sysfs interface ===
 +
 +<code>
 +root@linaro-ubuntu-desktop:/sys/bus/iio/devices/iio:device2# ls -al
 +total 0
 +drwxr-xr-x 3 root root    0 Jan  1  1970 .
 +drwxr-xr-x 5 root root    0 Jan  1  1970 ..
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 dev
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_temp_offset
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_temp_raw
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_temp_scale
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_voltage1_raw
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_voltage2_raw
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_voltage3_raw
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_voltage_scale
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 in_voltage_scale_available
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 name
 +lrwxrwxrwx 1 root root    0 Jan  1  1970 of_node -> ../../../../../../../firmware/devicetree/base/amba/i2c@e0004000/ad5593r@10
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 out_voltage0_raw
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 out_voltage2_raw
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 out_voltage3_raw
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 out_voltage_scale
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 out_voltage_scale_available
 +drwxrwxrwx 2 root root    0 Jan  1  1970 power
 +lrwxrwxrwx 1 root root    0 Jan  1  1970 subsystem -> ../../../../../../../bus/iio
 +-rw-rw-rw- 1 root root 4096 Jan  1  1970 uevent
 +root@linaro-ubuntu-desktop:/sys/bus/iio/devices/iio:device2# 
 +</code>
 +
 +<code>
 +root@linaro-ubuntu-desktop:/sys/bus/iio/devices/iio:device2# grep "" *
 +dev:252:2
 +in_temp_offset:-753
 +in_temp_raw:810
 +in_temp_scale:376.789750000
 +in_voltage1_raw:0
 +in_voltage2_raw:0
 +in_voltage3_raw:0
 +in_voltage_scale:0.610351562
 +in_voltage_scale_available:0.610351562 1.220703124
 +name:ad5592r
 +out_voltage0_raw:0
 +out_voltage2_raw:0
 +out_voltage3_raw:0
 +out_voltage_scale:0.610351562
 +out_voltage_scale_available:0.610351562 1.220703124
 +uevent:MINOR=2
 +uevent:DEVNAME=iio:device2
 +uevent:DEVTYPE=iio_device
 +uevent:OF_NAME=ad5593r
 +uevent:OF_FULLNAME=/amba/i2c@e0004000/ad5593r@10
 +uevent:OF_COMPATIBLE_0=adi,ad5593r
 +uevent:OF_COMPATIBLE_N=1
 +</code>
 +
 +== Example obtaining the temperature in °C ==
 +
 +
 +
 +T =  ( in_temp_raw + in_temp_offset ) * in_temp_scale
 +
 +T = ( 810 - 753 ) * 376.78975 =  21477 mdeg C = 21.5 °C
 +
 +For more information see also here: [[git.linux.org>Documentation/ABI/testing/sysfs-bus-iio | IIO Kernel Documentation]]
  
 === GPIO Testing  === === GPIO Testing  ===
Line 186: Line 250:
 The GPIO sysfs interface allows users to manipulate any GPIO from userspace. Userspace utilizes a sysfs control interface to dynamically request and release individual GPIOs. Once a GPIO has been requested, writing to the newly created path allows you to control the direction and the data while reading from it returns the GPIO data (which usually corresponds to a 0 or 1 which represents the signal level). The GPIO sysfs interface allows users to manipulate any GPIO from userspace. Userspace utilizes a sysfs control interface to dynamically request and release individual GPIOs. Once a GPIO has been requested, writing to the newly created path allows you to control the direction and the data while reading from it returns the GPIO data (which usually corresponds to a 0 or 1 which represents the signal level).
  
-For more information see also here: [[git.linux.org>Documentation/gpio.txt | GPIO Kernel Documentation]]+For more information see also here: [[git.linux.org>Documentation/gpio/sysfs.txt | GPIO Kernel Documentation]]
  
 <code> <code>
resources/tools-software/linux-drivers/iio-dac/ad5593r.txt · Last modified: 19 Jan 2018 10:12 by Alexandru Ardelean