();Р scl=1;Р delay1();Р sda=0;Р delay1();Р}Рvoid stop()//停止函数Р{Р sda=0;Р delay1();Р scl=1;Р delay1();Р sda=1;Р delay1();Р}Рvoid respons()//应答Р{Р uchar i;Р sda=1;Р delay1();Р scl=1;Р while(sda==1&&i<250) i++;Р scl=0;Р delay1();Р}Рvoid write_byterom(uchar date)//向eeprom中写一字节数据Р{Р uchar i;Р for(i=0;i<8;i++)Р {Р date=date<<1;Р scl=0;Р delay1();Р sda=CY;Р delay1();Р scl=1;Р delay1();Р } Р scl=0;Р delay1();Р}Рuchar read_byterom()//从eeprom中读一字节数据Р{Р uchar i,temp;Р scl=0;Р delay1();Р for(i=0;i<8;i++)Р {Р scl=1;Р delay1();Р temp<<=1;Р temp|=sda;Р scl=0;Р delay1();Р }Р return temp;Р}Рvoid write_add(uchar add,uchar date)//指定地址写数据Р{Р start();Р write_byterom(0xa0);Р respons();Р write_byterom(add);Р respons();Р write_byterom(date);Р respons();Р stop();Р}Рuchar read_add(uchar add)//指定地址读数据Р{