/* Weight of XL user offset bits of registers X_OFS_USR (73h), Y_OFS_USR (74h), Z_OFS_USR (75h)..  */
int32_t lsm6dso_xl_offset_weight_get(stmdev_ctx_t *ctx, lsm6dso_usr_off_w_t *val)
/* Weight of XL user offset bits of registers X_OFS_USR (73h), Y_OFS_USR (74h), Z_OFS_USR (75h)..  */
int32_t lsm6dso_xl_offset_weight_get(stmdev_ctx_t *ctx, lsm6dso_usr_off_w_t *val)
{
  lsm6dso_ctrl6_c_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)&reg, 1);
  switch (reg.usr_off_w) {
    case LSM6DSO_LSb_1mg:
      *val = LSM6DSO_LSb_1mg;
      break;
    case LSM6DSO_LSb_16mg:
      *val = LSM6DSO_LSb_16mg;
      break;
    default:
      *val = LSM6DSO_LSb_1mg;
      break;
  }
  return ret;
}