老师让写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初始化成功!\r\n");
udpsendtopc((unsigned char*)s,strlen(s));
}
else
{
sprintf(s,"EEPROM初始化失败!\r\n");
udpsendtopc((unsigned char*)s,strlen(s));
return;
}
EEPROMIntClear(ROM_INT_PROGRAM);
EEPROMIntEnable(ROM_INT_PROGRAM);
} |