This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:linux-drivers:iio-accelerometer:adxl372 [20 Nov 2018 16:52] – Updated links with upstream version Stefan Popa | resources:tools-software:linux-drivers:iio-accelerometer:adxl372 [16 Sep 2019 16:09] (current) – Updated Set the fifo watermak subchapter Stefan Popa | ||
---|---|---|---|
Line 25: | Line 25: | ||
^ Function ^ File ^ | ^ Function ^ File ^ | ||
- | | core driver | [[git.linux.org> | + | | core driver | [[linux.github>master? |
- | | spi driver | [[git.linux.org> | + | | spi driver | [[linux.github>master? |
- | | i2c driver | [[git.linux.org> | + | | i2c driver | [[linux.github>master? |
- | | header | [[git.linux.org> | + | | header | [[linux.github>master?drivers/iio/ |
+ | | Documentation | [[linux.github> | ||
+ | | ABI documentation| [[linux.github> | ||
- | ===== Devicetree | + | Example device tree |
+ | |||
+ | ^ Function ^ File ^ | ||
+ | | dts | [[linux.github> | ||
+ | |||
+ | ====== Example platform device initialization ====== | ||
Required devicetree properties: | Required devicetree properties: | ||
Line 94: | Line 101: | ||
-r--r--r-- 1 root root 4096 Oct 25 04:25 name | -r--r--r-- 1 root root 4096 Oct 25 04:25 name | ||
lrwxrwxrwx 1 root root 0 Oct 25 04:25 of_node -> ../ | lrwxrwxrwx 1 root root 0 Oct 25 04:25 of_node -> ../ | ||
+ | -r--r--r-- 1 root root 4096 Oct 25 04:25 peak_fifo_mode_enable | ||
drwxr-xr-x 2 root root 0 Oct 25 04:25 power | drwxr-xr-x 2 root root 0 Oct 25 04:25 power | ||
-r--r--r-- 1 root root 4096 Oct 25 04:25 sampling_frequency_available | -r--r--r-- 1 root root 4096 Oct 25 04:25 sampling_frequency_available | ||
Line 175: | Line 183: | ||
</ | </ | ||
- | ===== Trigger management ===== | + | ===== Using the FIFO Buffer ===== |
+ | |||
+ | **Description: | ||
+ | The ADXL372 includes a deep, 512 sample FIFO buffer. The 512 FIFO samples can be allotted in several ways, such as the following: | ||
+ | * 170 sample sets of concurrent 3-axis data | ||
+ | * 256 sample sets of concurrent 2-axis data (user selectable) | ||
+ | * 512 sample sets of single-axis data | ||
+ | * 170 sets of impact event peak (x, y, z) | ||
+ | |||
+ | ==== Trigger management ==== | ||
+ | |||
+ | **Description: | ||
+ | The FIFO is configured in **Stream Mode** and **FIFO_FULL** interrupt is enabled. The interrupt will be triggered when the FIFO watermark is reached. | ||
<WRAP box bggreen>< | <WRAP box bggreen>< | ||
Line 183: | Line 203: | ||
</ | </ | ||
- | ===== Buffer management | + | ==== Buffer management ==== |
**Description: | **Description: | ||
Line 207: | Line 227: | ||
Before enabling the buffer, a few steps need to be completed. | Before enabling the buffer, a few steps need to be completed. | ||
- | * First, the axis that we want to read data from need to be enabled: | + | * For example, if we want the FIFO to store sample sets of concurrent 3-axis |
<WRAP box bggreen>< | <WRAP box bggreen>< | ||
< | < | ||
Line 229: | Line 249: | ||
* Set the fifo watermak: | * Set the fifo watermak: | ||
+ | Because we enabled all three channels, then the watermark can be set to a maximum of 170 sample sets. | ||
<WRAP box bggreen>< | <WRAP box bggreen>< | ||
< | < | ||
root:/ | root:/ | ||
</ | </ | ||
+ | |||
+ | The FIFO can also be configured to store peak acceleration (x, y, and z) for every over-threshold event. This can be done by writing 1 to the **peak_fifo_mode_enable** attribute: | ||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root:/ | ||
+ | </ | ||
+ | Note that this mode can work only if all three axis are enabled. | ||
* Enable the buffer: | * Enable the buffer: |