/* This API sets the I2C device address of auxiliary sensor.  */
uint16_t bma4_set_i2c_device_addr(struct bma4_dev *dev)
/* This API sets the I2C device address of auxiliary sensor.  */
uint16_t bma4_set_i2c_device_addr(struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data = 0, dev_id = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        rslt |= bma4_read_regs(BMA4_AUX_DEV_ID_ADDR, &data, 1, dev);
        if (rslt == BMA4_OK) {
            dev_id = BMA4_SET_BITSLICE(data, BMA4_I2C_DEVICE_ADDR, dev->aux_config.aux_dev_addr);
            rslt |= bma4_write_regs(BMA4_AUX_DEV_ID_ADDR, &dev_id, 1, dev);
        }
    }
    return rslt;
}