/* Resets the internal counter of batching vents for a single sensor. This bit is automatically reset to zero if it was set to ‘1’..  */
int32_t lsm6dso_rst_batch_counter_set(stmdev_ctx_t *ctx, uint8_t val)
/* Resets the internal counter of batching vents for a single sensor. This bit is automatically reset to zero if it was set to ‘1’..  */
int32_t lsm6dso_rst_batch_counter_set(stmdev_ctx_t *ctx, uint8_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.rst_counter_bdr = val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_COUNTER_BDR_REG1,
                            (uint8_t *)&reg, 1);
  }
  return ret;
}