This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
resources:tools-software:linux-drivers:iio-dac:ad5593r [22 Feb 2016 17:52] – [Device tree example] Michael Hennerich | resources:tools-software:linux-drivers:iio-dac:ad5593r [23 Feb 2016 13:25] – [Driver testing] Michael Hennerich | ||
---|---|---|---|
Line 164: | Line 164: | ||
attr 2: scale value: 452.147700000 | attr 2: scale value: 452.147700000 | ||
+ | </ | ||
+ | |||
+ | === GPIO Testing | ||
+ | |||
+ | 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: | ||
+ | |||
+ | < | ||
+ | root@linaro-ubuntu-desktop: | ||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | export | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | total 0 | ||
+ | drwxr-xr-x 3 root root 0 Jan 1 1970 . | ||
+ | drwxr-xr-x 3 root root 0 Jan 1 1970 .. | ||
+ | -r--r--r-- 1 root root 4096 Feb 23 08:06 base | ||
+ | lrwxrwxrwx 1 root root 0 Feb 23 08:06 device -> ../ | ||
+ | -r--r--r-- 1 root root 4096 Feb 23 08:06 label | ||
+ | -r--r--r-- 1 root root 4096 Feb 23 08:06 ngpio | ||
+ | drwxr-xr-x 2 root root 0 Feb 23 08:06 power | ||
+ | lrwxrwxrwx 1 root root 0 Jan 1 1970 subsystem -> ../ | ||
+ | -rw-r--r-- 1 root root 4096 Jan 1 1970 uevent | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | base:890 | ||
+ | label: | ||
+ | ngpio:8 | ||
+ | |||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | total 0 | ||
+ | drwxr-xr-x 3 root root 0 Feb 23 08:06 . | ||
+ | drwxr-xr-x 4 root root 0 Feb 23 08:06 .. | ||
+ | -rw-r--r-- 1 root root 4096 Feb 23 08:06 active_low | ||
+ | lrwxrwxrwx 1 root root 0 Feb 23 08:06 device -> ../ | ||
+ | -rw-r--r-- 1 root root 4096 Feb 23 08:06 direction | ||
+ | drwxr-xr-x 2 root root 0 Feb 23 08:06 power | ||
+ | lrwxrwxrwx 1 root root 0 Feb 23 08:06 subsystem -> ../ | ||
+ | -rw-r--r-- 1 root root 4096 Feb 23 08:06 uevent | ||
+ | -rw-r--r-- 1 root root 4096 Feb 23 08:06 value | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | in | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | 0 | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | out | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | 0 | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | |||
+ | root@linaro-ubuntu-desktop:/ | ||
+ | 1 | ||
</ | </ |