请使用过nor 的大侠帮忙看看,我在网上看到别人写的代码的也是那样, 为什么会与规格书里不一样? #define write(addr,data) *((volatile unsigned short *)(addr<<1))=(unsigned short)data (地址为什么左移) #define read(addr) (*((volatile unsigned short *)(addr<<1)))
unsigned int SST39VF160_CheckID(void) { unsigned short ManID,DevID; reset(); write(0x5555,0xaa); //以下命令参照data sheet. write(0x2aaa,0x55); write(0x5555,0x90); ManID=read(0x0000); reset(); return ((ManID<<16)+DevID); } |