I have been trying to set the presence threshold value to a number bigger than 255 but it seems to truncate the new setting value to just one byte (> 256 decimal). The sths34pf80_presence_threshold_set takes a 16 bit unsigned value (which must be 15 bits or less).
If I set the presence threshold to 400 (0x0190) and then read (get) the presence threshold it returns 144 (0x0090). It would appear that the device only accepts or stores the low byte of the set value.
The ST documentation states that the PRESENCE_THS register takes two bytes, first byte is bits 7 - 0 and the second byte is bits 14 - 8, for a total of 15 bits unsigned.
I get the same results with the other two threshold set functions, namely motion_set and ambient_shock_set.
Has anyone else tried setting the thresholds to a value greater than 255? Just wondering if I am doing something wrong.