/* Set when user wants to generate interrupt on count overflow event/every step..  */
int32_t lsm6dso_pedo_int_mode_get(stmdev_ctx_t *ctx, lsm6dso_carry_count_en_t *val)
/* Set when user wants to generate interrupt on count overflow event/every step..  */
int32_t lsm6dso_pedo_int_mode_get(stmdev_ctx_t *ctx, lsm6dso_carry_count_en_t *val)
{
  lsm6dso_pedo_cmd_reg_t reg;
  int32_t ret;
  ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_CMD_REG,
                                (uint8_t *)&reg);
  switch (reg.carry_count_en) {
    case LSM6DSO_EVERY_STEP:
      *val = LSM6DSO_EVERY_STEP;
      break;
    case LSM6DSO_COUNT_OVERFLOW:
      *val = LSM6DSO_COUNT_OVERFLOW;
      break;
    default:
      *val = LSM6DSO_EVERY_STEP;
      break;
  }
  return ret;
}