EEPROM 存储电台PLL子程序
*************************/void EEPROM_Save_PLL(uchar Index,uint Udata){uchar Temp_H;uchar Temp_L; //PLL转换缓存uchar EEPROM_H;uchar EEPROM_L; //EEPROM读取缓存Temp_H=Udata>>8;Temp_L=Udata%256;switch (Index){case 1:EEPROM_H=EEPROM_Read_Byte(0x00,0x02); //暂存N0.8电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x00,0x03); //暂存N0.8电台PLL高位EEPROM_Earse(0x00,0x00); //擦除第1扇区EEPROM_Write_Byte(Temp_H,0x00,0x00); //写入N0.1电台PLL高位EEPROM_Write_Byte(Temp_L,0x00,0x01); //写入N0.1电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x00,0x02); //写入N0.8电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x00,0x03); //写入N0.8电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 2:EEPROM_H=EEPROM_Read_Byte(0x02,0x02); //暂存N0.9电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x02,0x03); //暂存N0.9电台PLL高位EEPROM_Earse(0x02,0x00); //擦除第2扇区EEPROM_Write_Byte(Temp_H,0x02,0x00); //写入N0.2电台PLL高位EEPROM_Write_Byte(Temp_L,0x02,0x01); //写入N0.2电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x02,0x02); //写入N0.9电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x02,0x03); //写入N0.9电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 3:EEPROM_H=EEPROM_Read_Byte(0x04,0x02); //暂存N0.10电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x04,0x03); //暂存N0.10电台PLL高位EEPROM_Earse(0x04,0x00); //擦除第3扇区EEPROM_Write_Byte(Temp_H,0x04,0x00); //写入N0.3电台PLL高位EEPROM_Write_Byte(Temp_L,0x04,0x01); //写入N0.3电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x04,0x02); //写入N0.10电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x04,0x03); //写入N0.10电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 4:EEPROM_H=EEPROM_Read_Byte(0x06,0x02); //暂存N0.11电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x06,0x03); //暂存N0.11电台PLL高位EEPROM_Earse(0x06,0x00); //擦除第4扇区EEPROM_Write_Byte(Temp_H,0x06,0x00); //写入N0.4电台PLL高位EEPROM_Write_Byte(Temp_L,0x06,0x01); //写入N0.4电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x06,0x02); //写入N0.11电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x06,0x03); //写入N0.11电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 5:EEPROM_H=EEPROM_Read_Byte(0x08,0x02); //暂存N0.12电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x08,0x03); //暂存N0.12电台PLL高位EEPROM_Earse(0x08,0x00); //擦除第5扇区EEPROM_Write_Byte(Temp_H,0x08,0x00); //写入N0.5电台PLL高位EEPROM_Write_Byte(Temp_L,0x08,0x01); //写入N0.5电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x08,0x02); //写入N0.12电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x08,0x03); //写入N0.12电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 6:EEPROM_H=EEPROM_Read_Byte(0x0a,0x02); //暂存N0.13电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x0a,0x03); //暂存N0.13电台PLL高位EEPROM_Earse(0x0a,0x00); //擦除第6扇区EEPROM_Write_Byte(Temp_H,0x0a,0x00); //写入N0.6电台PLL高位EEPROM_Write_Byte(Temp_L,0x0a,0x01); //写入N0.6电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x0a,0x02); //写入N0.13电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x0a,0x03); //写入N0.13电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 7:EEPROM_H=EEPROM_Read_Byte(0x0c,0x02); //暂存N0.14电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x0c,0x03); //暂存N0.14电台PLL高位EEPROM_Earse(0
EEPROM存储电台PL 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)