/* Accelerometer full-scale management between UI chain and OIS chain. When XL UI is on, the full scale is the same between UI/OIS and is chosen by the UI CTRL registers; when XL UI is in PD, the OIS can choose the FS. Full scales are independent between the UI/OIS chain but both bound to 8 g..  */
int32_t lsm6dso_aux_xl_fs_mode_set(lsm6dso_ctx_t *ctx, lsm6dso_xl_fs_mode_t val)
/* Accelerometer full-scale management between UI chain and OIS chain. When XL UI is on, the full scale is the same between UI/OIS and is chosen by the UI CTRL registers; when XL UI is in PD, the OIS can choose the FS. Full scales are independent between the UI/OIS chain but both bound to 8 g..  */
int32_t lsm6dso_aux_xl_fs_mode_set(lsm6dso_ctx_t *ctx, lsm6dso_xl_fs_mode_t val)
{
  lsm6dso_ctrl8_xl_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t*)&reg, 1);
  if (ret == 0) {
    reg.xl_fs_mode = (uint8_t)val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t*)&reg, 1);
  }
  return ret;
}