老师让写eeprom的程序,完成初始化和数据的读写,之前没接触过只是参考了TM4C的数据手册
void eeprom_Init() //eeprom初始化
{
char s[100];
SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0);
unsigned char ret1="EEPROM_INIT_OK";
unsigned char ret2=EEPROMInt();
if(strcmp(ret1,ret2)==0)
{
sprintf(s,"EEPROM初始化成功!
");
udpsendtopc((unsigned char*)s,strlen(s));
}
else
{
sprintf(s,"EEPROM初始化失败!
");
udpsendtopc((unsigned char*)s,strlen(s));
return;
}
EEPROMIntClear(ROM_INT_PROGRAM);
EEPROMIntEnable(ROM_INT_PROGRAM);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
楼主想初始化,再写了void eeprom_read(unsigned char *pui32Data,unsigned int Addr,unsigned int len)
和void eeprom_write(unsigned char *pui32Data,unsigned int Addr,unsigned int len); 但是初始化都不知正确否?
一周热门 更多>