/* Magnetometer X-axis coordinates rotation (to be aligned to accelerometer/gyroscope axes orientation)..  */
int32_t lsm6dso_mag_x_orient_set(lsm6dso_ctx_t *ctx, lsm6dso_mag_x_axis_t val)
/* Magnetometer X-axis coordinates rotation (to be aligned to accelerometer/gyroscope axes orientation)..  */
int32_t lsm6dso_mag_x_orient_set(lsm6dso_ctx_t *ctx, lsm6dso_mag_x_axis_t val)
{
  lsm6dso_mag_cfg_b_t reg;
  int32_t ret;
  ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_CFG_B, (uint8_t*)&reg);
  if (ret == 0) {
    reg.mag_x_axis = (uint8_t)val;
    ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_CFG_B, (uint8_t*)&reg);
  }
  return ret;
}