Hi,
The problem I have now with the BMM150 is that when I set it to forced mode it only reads once, then stops reading the data. I do the configuration the same way that I can see in the GitHub example.
settings.pwr_mode = BMM150_FORCED_MODE;
rslt = bmm150_set_op_mode(&settings, dev);
settings.preset_mode = BMM150_PRESETMODE_REGULAR;
rslt = bmm150_set_presetmode(&settings, dev);
I realized in the datasheet that every time the forced mode is done, the sensor goes to sleep, so I don't fully understand how this sensor works. The sensor works in conjunction with another Bosch sensor, the BMI088, this other sensor is reading at 200 Hz. So I've tried to do the following.
settings.pwr_mode = BMM150_POWERMODE_FORCED;
rslt = bmm150_set_op_mode(&settings, &bmm150dev);
rslt = bmm150_read_mag_data(&mag_data, &bmm150dev);
Every time there is an interrupt for the BMI088 data ready, I reconfigure the forced mode of the BMM150 sensor then read the data. This way it always reads the data on every interrupt, but I think I'm not working properly with forced mode.
Is there an example of how to work with forced mode? Also, Is there a way to read in forced mode without having to set the mode every time I'm going to read?