/* Enable access to the embedded functions/sensor hub configuration registers.  */
int32_t lsm6dsl_mem_bank_get(stmdev_ctx_t *ctx, lsm6dsl_func_cfg_en_t *val)
/* Enable access to the embedded functions/sensor hub configuration registers.  */
int32_t lsm6dsl_mem_bank_get(stmdev_ctx_t *ctx, lsm6dsl_func_cfg_en_t *val)
{
  lsm6dsl_func_cfg_access_t func_cfg_access;
  int32_t ret;
  ret = lsm6dsl_read_reg(ctx, LSM6DSL_FUNC_CFG_ACCESS,
                         (uint8_t*)&func_cfg_access, 1);
  switch (func_cfg_access.func_cfg_en) {
    case LSM6DSL_USER_BANK:
      *val = LSM6DSL_USER_BANK;
      break;
    case LSM6DSL_BANK_B:
      *val = LSM6DSL_BANK_B;
      break;
    default:
      *val = LSM6DSL_BANK_ND;
      break;
  }
  return ret;
}