Well, temperature measurement seems to work, and so does pressure measurement.
My guess is, that the humidity should be around 30%. (0x5295 / 0xFFFF * 100% = 32.26%)
And I already listed the compensation parameters for humidity:
"The compensation constants read from the chip are:
digH int32_t 75
digH int32_t 397
digH int32_t 0
digH int32_t 783
digH int32_t 50
digH int32_t 30"
A-ha, digH was formed the wrong way. Reg 0xE4 contains the high part, not the low part.
In the case of digH, the "endianness" is different from others.
But now I'm getting 100%. I think I should be getting about 70%.
The raw value divided by 0xFFFF and multiplied by 100% goesn't go even close. The compensation is obviously quite complex.
You can follow the formula get from the API and re-write your code.
The formula in the API are tested and working properly.
If the relative humidity is still wrong, you need go back to check each calibration parameters are get correctly (not only the register content, also how to assembly to parameters like unsign or sign value) .
How about the temperature value read from sensor? Humidity calculation will also use temperature value from sensor. So both need to be checked.
Hmm, I don't use any OS, and the driver in https://github.com/BoschSensortec/BME280_driver seems to use Linux kernel definitions, like U8_C(x) (defined in linux/include/asm-generic/int-ll64.h).