可以通过当前地址读或顺序读开启,然后读就行了
void eeprom_sequential_read(unsigned char adress,unsigned char *data,unsigned char num) //写一个数据给这个地址
{
I2CStart();
I2CSendByte(0xa0);
I2CWaitAck();
I2CSendByte(adress);
I2CWaitAck();
I2CStart();
I2CSendByte(0xa1);
I2CWaitAck();
while(num--)
{
*data++=I2CReceiveByte();
if(num)
I2CSendAck();
else
I2CSendNotAck();
}
I2CStop();
}
|