/* Enable access to the embedded functions/sensor hub configuration registers..  */
int32_t lsm6dso_mem_bank_get(stmdev_ctx_t *ctx, lsm6dso_reg_access_t *val)
/* Enable access to the embedded functions/sensor hub configuration registers..  */
int32_t lsm6dso_mem_bank_get(stmdev_ctx_t *ctx, lsm6dso_reg_access_t *val)
{
  lsm6dso_func_cfg_access_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)&reg,
                         1);
  switch (reg.reg_access) {
    case LSM6DSO_USER_BANK:
      *val = LSM6DSO_USER_BANK;
      break;
    case LSM6DSO_SENSOR_HUB_BANK:
      *val = LSM6DSO_SENSOR_HUB_BANK;
      break;
    case LSM6DSO_EMBEDDED_FUNC_BANK:
      *val = LSM6DSO_EMBEDDED_FUNC_BANK;
      break;
    default:
      *val = LSM6DSO_USER_BANK;
      break;
  }
  return ret;
}