/* Selects the trigger for the internal counter of batching events between XL and gyro..  */
int32_t lsm6dso_fifo_cnt_event_batch_get(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_get(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);
  switch (reg.trig_counter_bdr) {
    case LSM6DSO_XL_BATCH_EVENT:
      *val = LSM6DSO_XL_BATCH_EVENT;
      break;
    case LSM6DSO_GYRO_BATCH_EVENT:
      *val = LSM6DSO_GYRO_BATCH_EVENT;
      break;
    default:
      *val = LSM6DSO_XL_BATCH_EVENT;
      break;
  }
  return ret;
}