4 #define I2C_BUFSIZE 128
6 extern char I2CReset(void);
7 extern char I2CStart(void);
8 extern char I2CStop(void);
9 extern char I2CSendStop(char addr, char count,
11 extern char I2CReceive(char addr, char count);
12 extern char I2CSendReceive(char addr, char tx_count, char rx_count);
13 extern char I2CByteOut(char);
14 extern void I2CDumpError(char);
15 extern void I2CDelay(volatile long);
18 * Macro for normal send transfer ending with a stop condition
21 #define I2CSend(addr, count) I2CSendStop(addr, count, 1)
24 * Global variables in i2clole.c
27 extern char i2cTransmitBuffer[]; /* Transmit buffer */
28 extern char i2cReceiveBuffer[]; /* Receive buffer */
29 extern char i2cError; /* Set to last error value, see below */
35 #define I2CERR_OK 0 /* No error */
36 #define I2CERR_NAK 1 /* No ACK from slave */
37 #define I2CERR_LOST 2 /* Arbitration lost */
38 #define I2CERR_BUS 3 /* Bus is stuck (not used yet) */
39 #define I2CERR_TIMEOUT 4 /* Timeout on bus */