I would like to ask if when I changed the power mode of the 4c register of BMM150 to forced mode, I immediately read after writing 01, but the result I read was 11. When I want to change to normal mode (when writing 00), I can correctly read it as 00. According to the data manual, after writing 01, a single measurement will be performed, and then it will immediately return to sleep mode. In other words, after writing 01, I cannot read the register value to determine if I am writing correctly, right?
modify_reg(mag_spi_dev, BMM150_OP_MODE, BMM150_FORCED_MODE)
static rt_err_t modify_reg(rt_device_t spi_device, rt_uint8_t reg, reg_val_t reg_val)
{
uint8_t value;
RT_TRY(spi_read_reg8(spi_device, reg, &value));
value &= ~reg_val.clearbits;
value |= reg_val.setbits;
RT_TRY(spi_write_then_read_reg8(spi_device, reg, value));
return RT_EOK;
}