This goes into humidity_calib[3] and humidity_calib[4], which in the Bosch data sheet are told as signed quantities. Unpacking like above results in decoding them as unsigned quantities. So this line should be:
0xE4 / 0xE5[3:0] dig_H4 [11:4] / [3:0] signed short
0xE5[7:4] / 0xE6 dig_H5 [3:0] / [11:4] signed short
I have no device where the sign bit is set, so I can only simulate the behavior.
Note: I came along these lines when considering to carry over the very elegant conversion of similar data from the BME680 driver. There, the sign is considered.
In line 197 of the driver, the calibration constants are unpacked with
This goes into humidity_calib[3] and humidity_calib[4], which in the Bosch data sheet are told as signed quantities. Unpacking like above results in decoding them as unsigned quantities. So this line should be:
From the data sheet:
I have no device where the sign bit is set, so I can only simulate the behavior.
Note: I came along these lines when considering to carry over the very elegant conversion of similar data from the BME680 driver. There, the sign is considered.