The unified diff between revisions [7ac10cd3..] and [056a532c..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'i2c.h'
# # old_revision [7ac10cd34167baa43683a09e9e9e6778e691171d] # new_revision [056a532c92301bcb224e1f786c5f6720e8acf3eb] # # add_file "i2c.h" # content [2712fc89825bdda63fbe762367461fcd3919ce39] # ============================================================ --- /dev/null +++ i2c.h 2712fc89825bdda63fbe762367461fcd3919ce39 @@ -0,0 +1,28 @@ +#ifndef __I2C_H +#define __I2C_H + +#include "types.h" + +#define I2C_IN_PROGRESS 0 +#define I2C_SUCCESS 1 +#define I2C_FAIL 2 + +typedef int i2c_result; + +struct i2c_transaction { + int address; /* i2c first byte, including address and r/w flag */ + int bytes; /* number of bytes to read or write */ + unsigned char *data; /* pointer to the data */ + i2c_result *result; /* pointer to store the result */ + unsigned int event; /* Which event to set when complete */ + struct i2c_transaction *next; /* NULL or next transaction */ +}; + + +void init_i2c(void); +int i2c_conreg(void); +int i2c_statreg(void); +bool i2c_start_transaction(struct i2c_transaction *t); +bool i2c_busy(void); + +#endif /* __I2C_H */