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:mux:adgs1408 [18 Jul 2018 12:50] – [Adding Linux driver support] Mircea Caprioruresources:tools-software:linux-drivers:mux:adgs1408 [18 Jul 2018 13:56] (current) – Use wiki links for links to github Lars-Peter Clausen
Line 20: Line 20:
  
 ^ Source ^ Mainlined? ^ ^ Source ^ Mainlined? ^
-| [[https://github.com/analogdevicesinc/linux/blob/rpi-4.14.y/drivers/mux/adgs140x.c|git]] | [No] |+| [[linux.github>rpi-4.14.y?drivers/mux/adgs140x.c|git]] | [No] |
  
 ===== Files ===== ===== Files =====
  
 ^ Function ^ File ^ ^ Function ^ File ^
-| driver  | [[https://github.com/analogdevicesinc/linux/blob/rpi-4.14.y/drivers/mux/adgs140x.c]] |+| driver  | [[linux.github>rpi-4.14.y?drivers/mux/adgs140x.c|drivers/mux/adgs140x.c]] |
  
 ===== Devicetree ===== ===== Devicetree =====
Line 108: Line 108:
  
 ====== Hardware configuration ====== ====== Hardware configuration ======
 +
 +====== Driver testing ======
 +Since we are using an IIO ADC (AD7298) then our mux will have an IIO device folder in /sys/bus/iio/devices/iio:deviceX with the name adc-mux@3.
 +
 +{{page>software:linux:docs:iio:iio_snippets#iio device files&noheader&firstseconly&noeditbtn}}
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@raspberrypi:/sys/bus/iio/devices/iio:device1# ls -l
 +total 0
 +-r--r--r-- 1 root root 4096 Jul 17 13:21 dev
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage0_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage0_scale
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage1_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage1_scale
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage2_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage2_scale
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage3_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage3_scale
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage4_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage4_scale
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage5_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage5_scale
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage6_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage6_scale
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage7_raw
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 in_voltage7_scale
 +-r--r--r-- 1 root root 4096 Jul 17 13:21 name
 +lrwxrwxrwx 1 root root    0 Jul 17 13:21 of_node -> ../../../../firmware/devicetree/base/adc-mux@3
 +drwxr-xr-x 2 root root    0 Jul 17 13:21 power
 +lrwxrwxrwx 1 root root    0 Jul 17 13:21 subsystem -> ../../../../bus/iio
 +-rw-r--r-- 1 root root 4096 Jul 17 13:21 uevent
 +</xterm>
 +
 +=== Show device name ===
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@raspberrypi:/sys/bus/iio/devices/iio:device1# cat name
 +adc-mux@3
 +</xterm></WRAP>
 +
 +=== Get Voltage on channel Y ===
 +
 +**Description:**\\ /sys/bus/iio/devices/iio:deviceX/in_voltageY_raw \\
 +
 +This will select channel Y of the multiplexer and feed it to the input channel of the ADC that is physically connected to the mux.
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@raspberrypi:/sys/bus/iio/devices/iio:device1# cat in_voltage0_raw 
 +4095
 +</xterm></WRAP>
 +
 +<wrap info>The other attributes correspond to the ADC and can be viewed from here.</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/mux/adgs1408.1531911008.txt.gz · Last modified: 18 Jul 2018 12:50 by Mircea Caprioru