/* The maximum interval of time (1 LSB = 1/ODR) that can elapse after the end of the latency interval in which the click-detection procedure can start, in cases where the device is configured for double-click detection..  */
int32_t lis2dh12_double_tap_timeout_set(stmdev_ctx_t *ctx, uint8_t val)
/* The maximum interval of time (1 LSB = 1/ODR) that can elapse after the end of the latency interval in which the click-detection procedure can start, in cases where the device is configured for double-click detection..  */
int32_t lis2dh12_double_tap_timeout_set(stmdev_ctx_t *ctx, uint8_t val)
{
  lis2dh12_time_window_t time_window;
  int32_t ret;
  ret = lis2dh12_read_reg(ctx, LIS2DH12_TIME_WINDOW,
                          (uint8_t *)&time_window, 1);
  if (ret == 0)
  {
    time_window.tw = val;
    ret = lis2dh12_write_reg(ctx, LIS2DH12_TIME_WINDOW,
                             (uint8_t *)&time_window, 1);
  }
  return ret;
}