/* Maximum duration is the maximum time of an over threshold signal detection to be recognized as a tap event. The default value of these bits is 00b which corresponds to 4*ODR_XL time. If the SHOCK bits are set to a different value, 1LSB corresponds to 8*ODR_XL time..  */
int32_t lsm6dso_tap_shock_set(stmdev_ctx_t *ctx, uint8_t val)
/* Maximum duration is the maximum time of an over threshold signal detection to be recognized as a tap event. The default value of these bits is 00b which corresponds to 4*ODR_XL time. If the SHOCK bits are set to a different value, 1LSB corresponds to 8*ODR_XL time..  */
int32_t lsm6dso_tap_shock_set(stmdev_ctx_t *ctx, uint8_t val)
{
  lsm6dso_int_dur2_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)&reg, 1);
  if (ret == 0) {
    reg.shock = val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)&reg, 1);
  }
  return ret;
}