/* This API sets the condition of Accel FIFO data either to filtered or unfiltered mode.  */
uint16_t bma4_set_accel_fifo_filter_data(uint8_t accel_fifo_filter, struct bma4_dev *dev)
/* This API sets the condition of Accel FIFO data either to filtered or unfiltered mode.  */
uint16_t bma4_set_accel_fifo_filter_data(uint8_t accel_fifo_filter, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        if (accel_fifo_filter <= BMA4_MAX_VALUE_FIFO_FILTER) {
            rslt |= bma4_read_regs(BMA4_FIFO_DOWN_ADDR, &data, 1, dev);
            if (rslt == BMA4_OK) {
                data = BMA4_SET_BITSLICE(data, BMA4_FIFO_FILTER_ACCEL, accel_fifo_filter);
                rslt |= bma4_write_regs(BMA4_FIFO_DOWN_ADDR, &data, 1, dev);
            }
        } else {
            rslt |= BMA4_E_OUT_OF_RANGE;
        }
    }
    return rslt;
}