/* This API is used to configure the offset enable bits in the sensor.  */
static int8_t configure_offset_enable(const struct bmi160_foc_conf *foc_conf, struct bmi160_dev const *dev)
/* This API is used to configure the offset enable bits in the sensor.  */
static int8_t configure_offset_enable(const struct bmi160_foc_conf *foc_conf, struct bmi160_dev const *dev)
{
    int8_t rslt;
    uint8_t data;
    rslt = null_ptr_check(dev);
    if (rslt != BMI160_OK)
    {
        rslt = BMI160_E_NULL_PTR;
    }
    else
    {
        rslt = bmi160_get_regs(BMI160_OFFSET_CONF_ADDR, &data, 1, dev);
        if (rslt == BMI160_OK)
        {
            data = BMI160_SET_BITS(data, BMI160_GYRO_OFFSET_EN, foc_conf->gyro_off_en);
            data = BMI160_SET_BITS(data, BMI160_ACCEL_OFFSET_EN, foc_conf->acc_off_en);
            rslt = bmi160_set_regs(BMI160_OFFSET_CONF_ADDR, &data, 1, dev);
        }
    }
    return rslt;
}