/* Selects the trigger for the internal counter of batching events between XL and gyro..  */
int32_t lsm6dso_fifo_cnt_event_batch_set(lsm6dso_ctx_t *ctx, lsm6dso_trig_counter_bdr_t val)
/* Selects the trigger for the internal counter of batching events between XL and gyro..  */
int32_t lsm6dso_fifo_cnt_event_batch_set(lsm6dso_ctx_t *ctx, lsm6dso_trig_counter_bdr_t val)
{
  lsm6dso_counter_bdr_reg1_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t*)&reg, 1);
  if (ret == 0) {
    reg.trig_counter_bdr = (uint8_t)val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t*)&reg, 1);
  }
  return ret;
}