[an error occurred while processing this directive]
|
unsigned char twi_read_byte(unsigned char start_addr)
{
unsigned char temp;TWCR = (1<
while ((TWCR & (1< // if ((TWSR & 0xF8) != START)) ERROR(); //send slave_addr+W
TWDR = TWI_ADDR_DS1307_W;
TWCR = (1<while ((TWCR & (1< // if ((TWSR & 0xF8) != MT_SLA_ACK) ERROR(); TWDR = start_addr; //low 8 bits of addr
TWCR = (1<while ((TWCR & (1< // if ((TWSR & 0xF8) != MT_DATA_ACK) ERROR(); //---Next cycle(s): master receiver mode----
TWCR = (1<while ((TWCR & (1< //send slave_addr+R
TWDR = TWI_ADDR_DS1307_R;
TWCR = (1<while ((TWCR & (1< //twcr = (1< temp = (1< TWCR = temp; //clear int to start transmission
while ((TWCR & (1<TWCR = (1< return TWDR; }