//********************************************** read a byte
unsigned char Read24c02(unsigned char address)
{
STA();
WRBYT(0xa0);
CACK();
WRBYT(address);
CACK();
STA();
WRBYT(0xa1); // slar
CACK();
address = RDBYT();
MNACK();
STOP();
return(address);
}
void Write24c02(unsigned char address,unsigned char dat)
{
STA();
WRBYT(0xa0);//SLAW
CACK();
WRBYT(address);// Wordadr
CACK();
WRBYT(dat);
CACK();
STOP();
}
文章评论(0条评论)
登录后参与讨论