#ifndef __I2CSIG_C #define __I2CSIG_C #include "i2csig.h" void i2csig_init() { I2CSIG_SCL_HI; //internal pullups also activ ??????? I2CSIG_SDA_HI; //internal pullups also activ ??????? sbi( SCLSIGDIRPORT, SCLSIG); // set SCLSIG as output sbi( SDASIGDIRPORT, SDASIG); // set SDASIG as output I2CSIG_SCL_HI; I2CSIG_SDA_HI; } #define I2CSIG_START { I2CSIG_SDA_LO; \ I2CSIGQDEL; \ I2CSIG_SCL_LO; \ } #define I2CSIG_STOP { I2CSIG_SDA_LO; \ NOP; \ I2CSIGQDEL; \ I2CSIG_SCL_HI; \ I2CSIGQDEL; \ I2CSIG_SDA_HI; \ I2CSIGQDEL; \ } BYTE _i2csig_putbyte(BYTE val) { int i; BYTE ack,b; //first sending address of device //bit-data is set on middle of low-clock-period b = val; for (i=7;i>=0;i--) { I2CSIGQDEL; if ( b & (1<=0;i--) { I2CSIGQDEL; I2CSIG_SCL_HI; I2CSIGQDEL; I2CSIGQDEL; //we read bit at end of high-clock-period c = inp(SDASIGREADPORT) & (1<