/* This API sets the register access on MAG_IF, MAG_IF, MAG_IF in the sensor. This implies that the DATA registers are not updated with Mag values automatically.  */
uint16_t bma4_set_mag_manual_enable(uint8_t mag_manual, struct bma4_dev *dev)
/* This API sets the register access on MAG_IF, MAG_IF, MAG_IF in the sensor. This implies that the DATA registers are not updated with Mag values automatically.  */
uint16_t bma4_set_mag_manual_enable(uint8_t mag_manual, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        rslt |= bma4_read_regs(BMA4_AUX_IF_CONF_ADDR, &data, 1, dev);
        dev->delay(BMA4_GEN_READ_WRITE_DELAY);
        if (rslt == BMA4_OK) {
            data = BMA4_SET_BITSLICE(data, BMA4_MAG_MANUAL_ENABLE, mag_manual);
            rslt |= bma4_write_regs(BMA4_AUX_IF_CONF_ADDR, &data, 1, dev);
            if (rslt == BMA4_OK)
                dev->aux_config.manual_enable = (uint8_t)mag_manual;
        } else {
            dev->aux_config.manual_enable = 0;
        }
    }
    return rslt;
}