This shows you the differences between two versions of the page.
resources:tools-software:linux-drivers:iio-adc:ltc2499 [23 Sep 2022 15:22] – created Ciprian Regus | resources:tools-software:linux-drivers:iio-adc:ltc2499 [23 Sep 2022 15:25] (current) – Ciprian Regus | ||
---|---|---|---|
Line 110: | Line 110: | ||
root@analog:/ | root@analog:/ | ||
0.000074505 | 0.000074505 | ||
- | </ | ||
- | |||
- | === Set sampling frequency === | ||
- | |||
- | **Description: | ||
- | Show available sampling frequencies and select one for channel 0. | ||
- | |||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root:/ | ||
- | 10 20 1200 4800 | ||
- | root:/ | ||
- | 20 | ||
- | root:/ | ||
- | root:/ | ||
- | 4800 | ||
- | </ | ||
- | |||
- | ==== 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>< | ||
- | < | ||
- | root:/ | ||
- | root:/ | ||
- | -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 | ||
- | </ | ||
- | |||
- | 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>< | ||
- | < | ||
- | root:/ | ||
- | root:/ | ||
- | root:/ | ||
- | root:/ | ||
- | </ | ||
- | |||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root:/ | ||
- | root:/ | ||
- | -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 | ||
- | </ | ||
- | |||
- | * Set the buffer length: | ||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root:/ | ||
- | </ | ||
- | |||
- | * Set the watermak: | ||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root:/ | ||
- | </ | ||
- | |||
- | * Enable the buffer: | ||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root:/ | ||
- | </ | ||
- | |||
- | * Read the samples: | ||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root:/ | ||
- | </ | ||
- | |||
- | ====== 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>< | ||
- | < | ||
- | root:/> **/ | ||
- | root:/ | ||
- | direct_reg_access | ||
- | </ | ||
- | |||
- | Reading | ||
- | |||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root:/ | ||
- | root:/ | ||
- | 0x00 | ||
- | </ | ||
- | |||
- | Writing | ||
- | |||
- | Write ADDRESS VALUE | ||
- | |||
- | <WRAP box bggreen>< | ||
- | < | ||
- | root@analog:/ | ||
- | root@analog:/ | ||
- | 0xADAD | ||
</ | </ | ||