/* 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_get(lsm6dso_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_get(lsm6dso_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);
  switch (reg.wake_ths_w) {
    case LSM6DSO_LSb_FS_DIV_64:
      *val = LSM6DSO_LSb_FS_DIV_64;
      break;
    case LSM6DSO_LSb_FS_DIV_256:
      *val = LSM6DSO_LSb_FS_DIV_256;
      break;
    default:
      *val = LSM6DSO_LSb_FS_DIV_64;
      break;
  }
  return ret;
}