/* User-defined threshold value for Tap/Double Tap event. 1 LSB = full scale/128.  */
int32_t lis2dh12_tap_threshold_get(stmdev_ctx_t *ctx, uint8_t *val)
/* User-defined threshold value for Tap/Double Tap event. 1 LSB = full scale/128.  */
int32_t lis2dh12_tap_threshold_get(stmdev_ctx_t *ctx, uint8_t *val)
{
  lis2dh12_click_ths_t click_ths;
  int32_t ret;
  ret = lis2dh12_read_reg(ctx, LIS2DH12_CLICK_THS,
                          (uint8_t *)&click_ths, 1);
  *val = (uint8_t)click_ths.ths;
  return ret;
}