/* Weight of 1 LSB of wakeup threshold. 0: 1 LSB =FS_XL / 64 1: 1 LSB = FS_XL / 256.  */
int32_t lsm6dso_wkup_ths_weight_set(stmdev_ctx_t *ctx, lsm6dso_wake_ths_w_t val)
/* Weight of 1 LSB of wakeup threshold. 0: 1 LSB =FS_XL / 64 1: 1 LSB = FS_XL / 256.  */
int32_t lsm6dso_wkup_ths_weight_set(stmdev_ctx_t *ctx, lsm6dso_wake_ths_w_t val)
{
  lsm6dso_wake_up_dur_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)&reg, 1);
  if (ret == 0) {
    reg.wake_ths_w = (uint8_t)val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)&reg, 1);
  }
  return ret;
}