/* Latch interrupt request on INT2_SRC (35h) register, with INT2_SRC (35h) register cleared by reading INT2_SRC(35h) itself..  */
int32_t lis2dh12_int2_pin_notification_mode_get(stmdev_ctx_t *ctx, lis2dh12_lir_int2_t *val)
/* Latch interrupt request on INT2_SRC (35h) register, with INT2_SRC (35h) register cleared by reading INT2_SRC(35h) itself..  */
int32_t lis2dh12_int2_pin_notification_mode_get(stmdev_ctx_t *ctx, lis2dh12_lir_int2_t *val)
{
  lis2dh12_ctrl_reg5_t ctrl_reg5;
  int32_t ret;
  ret = lis2dh12_read_reg(ctx, LIS2DH12_CTRL_REG5,
                          (uint8_t *)&ctrl_reg5, 1);
  switch (ctrl_reg5.lir_int2)
  {
    case LIS2DH12_INT2_PULSED:
      *val = LIS2DH12_INT2_PULSED;
      break;
    case LIS2DH12_INT2_LATCHED:
      *val = LIS2DH12_INT2_LATCHED;
      break;
    default:
      *val = LIS2DH12_INT2_PULSED;
      break;
  }
  return ret;
}