/* 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_set(lsm6dso_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_set(lsm6dso_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);
  if (ret == 0) {
    reg.usr_off_w = (uint8_t)val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t*)&reg, 1);
  }
  return ret;
}