小弟最近学习i2c总线,对以下程序不太明白,请大侠做一些解释。
其中 read_add()从at24co2中读出数据,write_byte()写字节,read_byte()读字节,respons()应答,
uchar read_add(uchar address)//从AT24C02 中读出数据
{
uchar date;
start();
write_byte(0xa0);
respons();
write_byte(address);
respons();
start(); //why
write_byte(0xa1); //why
respons();
date=read_byte();
stop();
return date;
} |