/* The interrupt block recognition checks data after/before the hard-iron correction to discover the interrupt..  */
int32_t lis2mdl_offset_int_conf_get(stmdev_ctx_t *ctx, lis2mdl_int_on_dataoff_t *val)
/* The interrupt block recognition checks data after/before the hard-iron correction to discover the interrupt..  */
int32_t lis2mdl_offset_int_conf_get(stmdev_ctx_t *ctx, lis2mdl_int_on_dataoff_t *val)
{
  lis2mdl_cfg_reg_b_t reg;
  int32_t ret;
  ret = lis2mdl_read_reg(ctx, LIS2MDL_CFG_REG_B, (uint8_t*)&reg, 1);
  switch (reg.int_on_dataoff){
    case LIS2MDL_CHECK_BEFORE:
      *val = LIS2MDL_CHECK_BEFORE;
      break;
    case LIS2MDL_CHECK_AFTER:
      *val = LIS2MDL_CHECK_AFTER;
      break;
    default:
      *val = LIS2MDL_CHECK_BEFORE;
      break;
  }
  return ret;
}