2022-11-28 10:36 AM
I'm trying to understand the way the interrupt thresholds are supposed to be set for this sensors, as we're working on a driver in Rust and wanted to add the interrupts as a feature. Let me explain what I mean:
Accelerometer: each axis uses one full byte, meanwhile the accelerometer data is two bytes/axis. Does it mean that the threshold setting has a lower resolution, i.e. can only have 256 possible values (signed, -128 to 127) while the data read from the sensor is more fine-grained?
Gyroscope: "the value is expressed as a 15-bit word in two’s complement" for each axis, but it's a 16-bit word for the output registers. Does it mean that in this case the threshold has a 15-bit resolution (signed, -32768 to 32767) while the output has 16 bits?
Magnetometer: "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." - in this case it's 15 bits, but unsigned (0-32767) and with the sensor detecting both positive and negative thresholds it is as if it actually had the threshold set up between -32768 and 32767?
In other words: it would seem as if the magnetometer threshold had the highest resolution, and the accelerometer the lowest (which must be taken into account by the getter/setter functions)?
Thank you very much in advance for shedding some light on this!