LSM9DS1 - how to set up interrupts for the magnetometer? Datasheet description of the INT_THS_L and INT_THS_H registers unclear.
The description of the threshold registers says: "The value is expressed in 15-bit unsigned. Even if the threshold is expressed in absolute value, the device detects both positive and negative thresholds.".
There is only one threshold to be set, despite the magnetometer having three axes.
I found a potentially matching explanation in an application note for the LSM303AGR magnetometer (AN4825):
"The interrupt threshold can be programmed using the [INT_THS_L]* and [INT_THS_H]* registers. When magnetic data exceeds the positive or the negative threshold, the interrupt signal is generated and the information about the type of interrupt is stored in the [INT_SRC_M]* register. In particular, when magnetic data exceeds the positive threshold, the [PTH_axis]* bit is set to '1', while if data exceeds the negative threshold, the [NTH_axis]* bit is set to '1'. If magnetic data lay between the positive and the negative thresholds, no interrupt signal is released."
*I replaced the register names with those of LSM9DS1
Is that also true for LSM9DS1? In other words:
- there is only one threshold value that can be set
- one or more axes can be selected in INT_CFG_M register as the axis where interrupt will be generated (but the threshold is always the same for all of them anyway)
- whatever the threshold value is, if the measured value is below it then it's "negative", and if it's above then "positive"
- the actual threshold value in mG is the threshold setting multiplied by the currently selected sensitivity, e.g. if the scale is set to +/- 4G, and the threshold value is decimal 1000, the actual value will be 0.14 * 1000
Could anyone confirm this? I haven't found a similar application note for LSM9DS1, and sometimes the datasheets are a bit vague, or they assume prior knowledge of a similar sensor maybe.
