icache270.c
来自「dm270 source code」· C语言 代码 · 共 56 行
C
56 行
/*
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 + =
减小字号Ctrl + -
显示快捷键?