/* This API checks the invalid settings for ODR & Bw for Accel and Gyro.  */
static int8_t check_invalid_settg(const struct bmi160_dev *dev)
/* This API checks the invalid settings for ODR & Bw for Accel and Gyro.  */
static int8_t check_invalid_settg(const struct bmi160_dev *dev)
{
    int8_t rslt;
    uint8_t data = 0;
    rslt = bmi160_get_regs(BMI160_ERROR_REG_ADDR, &data, 1, dev);
    data = data >> 1;
    data = data & BMI160_ERR_REG_MASK;
    if (data == 1)
    {
        rslt = BMI160_E_ACCEL_ODR_BW_INVALID;
    }
    else if (data == 2)
    {
        rslt = BMI160_E_GYRO_ODR_BW_INVALID;
    }
    else if (data == 3)
    {
        rslt = BMI160_E_LWP_PRE_FLTR_INT_INVALID;
    }
    else if (data == 7)
    {
        rslt = BMI160_E_LWP_PRE_FLTR_INVALID;
    }
    return rslt;
}