/* This API sets the FIFO watermark level in the sensor.  */
uint16_t bma4_set_fifo_wm(uint16_t fifo_wm, struct bma4_dev *dev)
/* This API sets the FIFO watermark level in the sensor.  */
uint16_t bma4_set_fifo_wm(uint16_t fifo_wm, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data[2] = {0, 0};
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        data[0] = BMA4_GET_LSB(fifo_wm);
        data[1] = BMA4_GET_MSB(fifo_wm);
        rslt |= bma4_write_regs(BMA4_FIFO_WTM_0_ADDR, &data[0], 1, dev);
        dev->delay(BMA4_GEN_READ_WRITE_DELAY);
        rslt |= bma4_write_regs((BMA4_FIFO_WTM_0_ADDR + 1), &data[1], 1, dev);
    }
    return rslt;
}