/* Set when user wants to generate interrupt on count overflow event/every step..  */
int32_t lsm6dso_pedo_int_mode_set(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_set(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);
  if (ret == 0) {
    reg.carry_count_en = (uint8_t)val;
    ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_PEDO_CMD_REG,
                                   (uint8_t *)&reg);
  }
  return ret;
}