/* This API is used to configure the down sampling ratios of the accel and gyro data for FIFO.Also, it configures filtered or pre-filtered data for accel and gyro.  */
int8_t bmi160_set_fifo_down(uint8_t fifo_down, const struct bmi160_dev *dev)
/* This API is used to configure the down sampling ratios of the accel and gyro data for FIFO.Also, it configures filtered or pre-filtered data for accel and gyro.  */
int8_t bmi160_set_fifo_down(uint8_t fifo_down, const struct bmi160_dev *dev)
{
    int8_t rslt = 0;
    uint8_t data = 0;
    uint8_t reg_addr = BMI160_FIFO_DOWN_ADDR;
    if (dev == NULL)
    {
        rslt = BMI160_E_NULL_PTR;
    }
    else
    {
        rslt = bmi160_get_regs(reg_addr, &data, BMI160_ONE, dev);
        if (rslt == BMI160_OK)
        {
            data = data | fifo_down;
            rslt = bmi160_set_regs(reg_addr, &data, BMI160_ONE, dev);
        }
    }
    return rslt;
}