⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 icache270.c

📁 dm270 source code
💻 C
字号:
/*
    DM270 ARM Evaluation Software

    (c)Texas Instruments 2003
*/

/**
    \file icache270.c
    \brief Instruction Cache Related APIs
*/

#include <icache270.h>

/**
    \brief  Clear ICACHE

    \return if success, \c E_PASS, else error code

    \note  I-Cache will be disabled before clearing it. Need to enable it again if it was enabled before this API call.

*/
STATUS ICACHE_clear(){

  //Cache should be disabled when it is cleared
  ICACHE_FSET(ICAMODE, ICAENB, 0);
  ICACHE_FSET(ICAMODE, ICACLR, 1);
  while(ICACHE_FGET(ICAMODE,ICACLR) != 0);

  return E_PASS;
}

/**
    \brief  Enable ICACHE

    \param  enable  TRUE:Enable ICACHE, FALSE:Disable ICACHE
    \param  burstAccessEnable   TRUE:Enable 4 burst instruction read from SDRAM, FALSE:Disable 4 burst instruction read from SDRAM

    \return if success, \c E_PASS, else error code

*/
STATUS ICACHE_enable(BOOL enable, BOOL burstAccessEnable){

  if(enable == TRUE)
    ICACHE_FSET(ICAMODE,ICAENB,1);
  else
    ICACHE_FSET(ICAMODE,ICAENB,0);

  if(burstAccessEnable == TRUE)
    ICACHE_FSET(ICAMODE,REQ4W,1);
  else
    ICACHE_FSET(ICAMODE,REQ4W,0);

  return E_PASS;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -