/* Weight of XL user offset bits of registers X_OFS_USR(73h), Y_OFS_USR(74h), Z_OFS_USR(75h)..  */
int32_t lsm6dsl_xl_offset_weight_get(stmdev_ctx_t *ctx, lsm6dsl_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 lsm6dsl_xl_offset_weight_get(stmdev_ctx_t *ctx, lsm6dsl_usr_off_w_t *val)
{
  lsm6dsl_ctrl6_c_t ctrl6_c;
  int32_t ret;
  ret = lsm6dsl_read_reg(ctx, LSM6DSL_CTRL6_C, (uint8_t*)&ctrl6_c, 1);
  switch (ctrl6_c.usr_off_w) {
    case LSM6DSL_LSb_1mg:
      *val = LSM6DSL_LSb_1mg;
      break;
    case LSM6DSL_LSb_16mg:
      *val = LSM6DSL_LSb_16mg;
      break;
    default:
      *val = LSM6DSL_WEIGHT_ND;
      break;
  }
  return ret;
}