The offset of ADXL345/ADXL346 can be calibrated by OFSX, OFSY, OFSZ registers. Then, is the threshold for interrupts get applied to the offset corrected data or the raw samples?
Since the offset is applied up-stream from the activity/inactivity/freefall threshold functions (and orientation in ADXL346) you can simulate motion on the accelerometer by applying changes on the user offsets and observing the result on the outputs and motion detection functions.
It is compared with the offset corrected data.
James is correct. You can do the experiment to verify it. Eg:
1. Enable Activity Interrupt, DC mode, Z axis enable, set the threshold to 2g.
2. Put the board on table stably, Z axis output should be 1g, no activity interrupt triggered.
3. Set the Z axis offset to 1.56g by writting 0x64 to OFSZ register.
4. Put the board on table stably, activity interrupt is triggered since the Z axis output is 2.56g now, over the 2g threshold.
That means the threshold is compared with offset corrected data. The root cause is as James explained:
the offset is applied up-stream from the activity/inactivity/freefall threshold functions (and orientation in ADXL346).
Retrieving data ...