@o_o wrote:
**PS: Handytech's code incorrectly sets the burst length to 1 byte, it should be 8 bytes.
To shortly comment about this::
In Setup Mode (or manual mode) of the Magnetometer interface:
The number of data bytes in each (burst) read transaction on the bus is indeed defined by aux_rd_burst_len. But in case the number of bytes requested is larger than aux_rd_burst_len, I believe the sensor API handles that and generates the necessary amout of smaller transactions.
The number of data bytes in each write transaction is always 1 (i.e. no burst write is supported, regardless of aux_rd_burst_len).
In Data Mode of the Magnetometer interface:
Reading of the data is always done in a single I2C burst read operation with a fixed length of 8 bytes (for the BMM150/BMX160 this corresponds to MAG_[X-Z] and RHALL registers).
Based on the above, one could reduce the amount of transactions to the magnetometer during the initialization by setting aux_rd_burst_len to 8 bytes, but I believe my code snippet using the official sensor API should work anyhow?
... View more