?? flashrom.c
字號:
#include "flashrom.h"
#include "..\Target\def.h"
int SST39VF160_CheckBlank(INT32U addr,INT32U WordSize)
{
INT32U i,temp;
for (i=addr;i<(addr+WordSize);i++)
{
temp=*((volatile INT16U *)(i<<1));
if(temp!=0xffff)
return 0;
}
return 1;
}
int Waitfor_endofprg(void) //Check if the bit6 toggle ends.
{
volatile INT16U flashStatus,old;
old=*((volatile INT16U *)0x0);
while(1)
{
flashStatus=*((volatile INT16U *)0x0);
if( (old&0x40) == (flashStatus&0x40) )
break;
else
old=flashStatus;
}
return 1;
}
int SST39VF160_WordProg (INT32U addr,INT16U dat)
{
Writeflash (0x5555,0xAA);
Writeflash (0x2AAA,0x55);
Writeflash (0x5555,0xA0);
Writeflash (addr,dat);
return(Waitfor_endofprg());
}
void SST39VF160_SectorErase(INT32U SAaddr)
{
Writeflash(0x5555,0xAA);
Writeflash(0x2AAA,0x55);
Writeflash(0x5555,0x80);
Writeflash(0x5555,0xAA);
Writeflash(0x2AAA,0x55);
Writeflash(SAaddr,0x30);
Waitfor_endofprg();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -