adafruit / Adafruit_LIS3DH

Arduino Library for Adafruit LIS3DH breakout board
Other
72 stars 57 forks source link

FIFO mode is not available #29

Open matthewfcarlson opened 4 years ago

matthewfcarlson commented 4 years ago

Thank you for opening an issue on an Adafruit Arduino library repository. To improve the speed of resolution please review the following guidelines and common troubleshooting steps below before creating the issue:

If you're sure this issue is a defect in the code and checked the steps above please fill in the following fields to provide enough troubleshooting information. You may delete the guideline and text above to just leave the following details:

From the docs:

The LIS3DH embeds a 32-level FIFO for each of the three output channels, X, Y and Z.
This allows consistent power saving for the system, since the host processor does not need
to continuously poll data from the sensor, but it can wake up only when needed and burst
the significant data out from the FIFO.
In order to enable the FIFO buffer, the FIFO_EN bit in CTRL_REG5 (24h) must be set to ‘1’.
This buffer can work according to the following different modes: Bypass mode, FIFO mode,
Stream mode and Stream-to-FIFO mode. Each mode is selected by the FM [1:0] bits in
FIFO_CTRL_REG (2Eh). Programmable FIFO watermark level, FIFO empty or FIFO
overrun events can be enabled to generate dedicated interrupts on the INT1 pin
(configuration through CTRL_REG3 (22h)).
In the FIFO_SRC_REG (2Fh) register the EMPTY bit is equal to ‘1’ when all FIFO samples
are ready and FIFO is empty.
In the FIFO_SRC_REG (2Fh) register the WTM bit goes to ‘1’ if new data is written in the
buffer and FIFO_SRC_REG (2Fh) (FSS [4:0]) is greater than or equal to FIFO_CTRL_REG
(2Eh) (FTH [4:0]). FIFO_SRC_REG (2Fh) (WTM) goes to ‘0’ if reading an X, Y, Z data slot
from FIFO and FIFO_SRC_REG (2Fh) (FSS [4:0]) is less than or equal to
FIFO_CTRL_REG (2Eh) (FTH [4:0]).
In the FIFO_SRC_REG (2Fh) register the OVRN_FIFO bit is equal to ‘1’ if the FIFO slot is
overwritten.

Would y'all be open to a PR?

ladyada commented 4 years ago

yep we welcome PRs :)

siddacious commented 4 years ago

yes please :)

matthewfcarlson commented 4 years ago

Okay- I have it working and added an example. I'll clean it up and post a PR tomorrow ish?