void I2C_Init() //
{
SDA = 1;
SCL = 1;
}
void I2C_Start() // start I2C
{
SDA = 0;
SCL = 0;
}
I2C_write() // send data to Ds1307
{
I2C_write(0xD0); // address of the DS1307 )
I2C_write(0x00); // address of seconds register
I2C_write(0x10); // 10 data as 10 second
}
void I2C_Ack()
{
SDA = 0;
SCL = 1;
SCL = 0;
SDA = 1;
void I2C_Stop() // stop I2C
{
SCL = 0;
SDA = 0;
SCL = 1;
SDA = 1;
}
void I2C_Start()
{
SDA = 0;
SCL = 0;
}
I2C_read()
{
I2C_write(0xD1); // address of the DS1307 )
I2C_write(0x00); // address of seconds register
I2C_write(0x10); // 10 data as 10 second
}
void I2C_Nak()
{
SDA = 1;
SCL = 1;
SCL = 0;
SDA = 1;
}
void I2C_Stop() // stop I2C
{
SCL = 0;
SDA = 0;
SCL = 1;
SDA = 1;
}