Hello,
You can't directly use Mag register value. Please use my example code.
Technically, if you want to read Mag data from BMX160, you need to follow 2.4.3 Data processing Magnetometer.
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmx160-ds0001.pdf
If you are testing your own board, the mag data value can be affected by your environment.
To verify it, one of easiest way is to convert the mag data to heading value, and check it.
Therefore, it's difficult to verify your mag data.
... View more