/* Offset for hard-iron compensation register(r/w). The value is expressed as a 16-bit word in two’s complement..  */
int32_t lsm6dsl_mag_offset_get(stmdev_ctx_t *ctx, uint8_t *buff)
/* Offset for hard-iron compensation register(r/w). The value is expressed as a 16-bit word in two’s complement..  */
int32_t lsm6dsl_mag_offset_get(stmdev_ctx_t *ctx, uint8_t *buff)
{
  int32_t ret;
  ret = lsm6dsl_mem_bank_set(ctx, LSM6DSL_BANK_A);
  if(ret == 0){
    ret = lsm6dsl_read_reg(ctx, LSM6DSL_MAG_OFFX_L, buff, 6);
    if(ret == 0){
      ret = lsm6dsl_mem_bank_set(ctx, LSM6DSL_USER_BANK);
    }
  }
  return ret;
}