|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
|
#define NO_ACK 0
#define ACK 1
bit EEPROM_sequential_read(uchar *block, uchar address,
uchar size)
{
bit status;
status = 0; /* failure by default */
start();
if (!write(EEPROM)) /* write operation */
if (!write(address)) /* initial address */
{
start();
if (!write(EEPROM | 0x01)) /* read operation */
{
while(size--)
*block++ = read(size ? ACK : NO_ACK);
status = 1; /* success */
}
}
stop();
return(status);
}
|
|||||||||||||||||||||||||||||||||
|
Copyright © 2003 ChipCenter-QuestLink About ChipCenter-Questlink |
||||||||||||||||||||||||||||||||||