/* Selects Batching Data Rate (writing frequency in FIFO) for accelerometer data..  */
int32_t lsm6dso_fifo_xl_batch_set(stmdev_ctx_t *ctx, lsm6dso_bdr_xl_t val)
/* Selects Batching Data Rate (writing frequency in FIFO) for accelerometer data..  */
int32_t lsm6dso_fifo_xl_batch_set(stmdev_ctx_t *ctx, lsm6dso_bdr_xl_t val)
{
  lsm6dso_fifo_ctrl3_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)&reg, 1);
  if (ret == 0) {
    reg.bdr_xl = (uint8_t)val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)&reg, 1);
  }
  return ret;
}