Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

resources:tools-software:linux-drivers:iio-adc:ltc2499 [23 Sep 2022 15:22] – created Ciprian Regusresources:tools-software:linux-drivers:iio-adc:ltc2499 [23 Sep 2022 15:25] (current) Ciprian Regus
Line 110: Line 110:
 root@analog:/sys/bus/iio/devices/iio:device0# **cat in_voltage_scale** root@analog:/sys/bus/iio/devices/iio:device0# **cat in_voltage_scale**
 0.000074505 0.000074505
-</xterm></WRAP> 
- 
-=== Set sampling frequency === 
- 
-**Description:**\\ 
-Show available sampling frequencies and select one for channel 0. 
- 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0> **cat in_current0_sampling_frequency_available** 
-10 20 1200 4800 
-root:/sys/bus/iio/devices/iio:device0> **cat in_current0_sampling_frequency** 
-20 
-root:/sys/bus/iio/devices/iio:device0> **echo 4800 > in_current0_sampling_frequency** 
-root:/sys/bus/iio/devices/iio:device0> **cat in_current0_sampling_frequency** 
-4800 
-</xterm></WRAP> 
- 
-==== Buffer management ==== 
- 
-**Description:**\\ 
-The scan_elements directory contains interfaces for elements that will be captured for a single triggered sample set in the buffer 
- 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0> **cd scan_elements/** 
-root:/sys/bus/iio/devices/iio:device0/scan_elements> **ls -l** 
--rw-r--r-- 1 root root 4096 Aug 17 09:56 in_current0_en 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_current0_index 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_current0_type 
--rw-r--r-- 1 root root 4096 Aug 17 09:56 in_current3_en 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_current3_index 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_current3_type 
--rw-r--r-- 1 root root 4096 Aug 17 09:56 in_voltage1_en 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_voltage1_index 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_voltage1_type 
--rw-r--r-- 1 root root 4096 Aug 17 09:56 in_voltage2_en 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_voltage2_index 
--r--r--r-- 1 root root 4096 Aug 17 09:56 in_voltage2_type 
-</xterm></WRAP> 
- 
-Before enabling the buffer, a few steps need to be completed.  
-  * For example, if we want to capture all input channels, we need to enable the scan elements: 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0/scan_elements> **echo 1 > in_current0_en** 
-root:/sys/bus/iio/devices/iio:device0/scan_elements> **echo 1 > in_voltage1_en** 
-root:/sys/bus/iio/devices/iio:device0/scan_elements> **echo 1 > in_voltage2_en** 
-root:/sys/bus/iio/devices/iio:device0/scan_elements> **echo 1 > in_current3_en** 
-</xterm></WRAP> 
- 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0/scan_elements> **cd ../buffer/** 
-root:/sys/bus/iio/devices/iio:device0/buffer> ls -l 
--r--r--r-- 1 root root 4096 Aug 17 09:56 data_available 
--rw-r--r-- 1 root root 4096 Aug 17 09:56 enable 
--rw-r--r-- 1 root root 4096 Aug 17 09:56 length 
--rw-r--r-- 1 root root 4096 Aug 17 09:56 watermark 
-</xterm></WRAP> 
- 
-  * Set the buffer length: 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0/buffer> **echo 1024 > length** 
-</xterm></WRAP> 
- 
-  * Set the watermak: 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0/buffer> **echo 512 > watermark** 
-</xterm></WRAP> 
- 
-  * Enable the buffer: 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0/buffer> **echo 1 > enable** 
-</xterm></WRAP> 
- 
-  * Read the samples: 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/bus/iio/devices/iio:device0/buffer> **cat /dev/iio:device0** 
-</xterm></WRAP> 
- 
-====== Low level register access via debugfs (direct_reg_access) ====== 
- 
-Some IIO drivers feature an optional debug facility, allowing users to read or write registers directly. Special care needs to be taken when using this feature, since you can modify registers on the back of the driver. Accessing debugfs requires root privileges. 
- 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/> **/sys/kernel/debug/iio/iio:device0/** 
-root:/sys/kernel/debug/iio/iio:device0> ls direct_reg_access   
-direct_reg_access 
-</xterm></WRAP> 
- 
-Reading 
- 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root:/sys/kernel/debug/iio/iio:device0> echo 0x45 > direct_reg_access 
-root:/sys/kernel/debug/iio/iio:device0> cat direct_reg_access  
-0x00 
-</xterm></WRAP> 
- 
-Writing 
- 
-Write ADDRESS VALUE 
- 
-<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-<xterm> 
-root@analog:/sys/kernel/debug/iio/iio:device0> echo 0x45 0xADAD > direct_reg_access    
-root@analog:/sys/kernel/debug/iio/iio:device0> cat direct_reg_access  
-0xADAD 
 </xterm></WRAP> </xterm></WRAP>
  
resources/tools-software/linux-drivers/iio-adc/ltc2499.txt · Last modified: 23 Sep 2022 15:25 by Ciprian Regus