Hello parkescape,
Here is the my example project based on Arduino.
What you have to do is to change i2c write read functions and delay function in your own.
(bmx160_hal_i2c_bus_read, bmx160_hal_i2c_bus_write bmx160_delay_usec functions. )
Currently, my example is FIFO, but you can find other output method in github.
https://github.com/BoschSensortec/BMI160_driver
I recommend github API, because BMX160 is actually BMI160 + BMM150 inside.
So, for magnetometer sensor BMM150, you need to configure inside interface like this.
/* Auxiliary function definitions */ int8_t bmm150_aux_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t length, void *intf_ptr) { return bmi160_aux_read(reg_addr, reg_data, length, &bmi160dev); }
int8_t bmm150_aux_write(uint8_t reg_addr, uint8_t *reg_data, uint32_t length, void *intf_ptr) { return bmi160_aux_write(reg_addr, reg_data, length, &bmi160dev); }
I don't think you did it.
Thanks,
... View more