/* Enable access to the embedded functions/sensor hub configuration registers.  */
int32_t lsm6dsl_mem_bank_set(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_set(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);
  if(ret == 0){
    func_cfg_access.func_cfg_en = (uint8_t) val;
    ret = lsm6dsl_write_reg(ctx, LSM6DSL_FUNC_CFG_ACCESS,
                            (uint8_t*)&func_cfg_access, 1);
  }
  return ret;
}