diff options
| author | Bertrik Sikken <bertrik@sikken.nl> | 2009-03-03 18:00:17 +0000 |
|---|---|---|
| committer | Bertrik Sikken <bertrik@sikken.nl> | 2009-03-03 18:00:17 +0000 |
| commit | 1fb8242d968a3ee7091ef86db37b3e8f593eaeeb (patch) | |
| tree | 886690cbfe9ec3294989c9d1da9b29a1da0a93d9 /firmware/export/generic_i2c.h | |
| parent | 527b2dd270edebc7fcff1fe10e784a14e5046d7b (diff) | |
| download | rockbox-1fb8242d968a3ee7091ef86db37b3e8f593eaeeb.zip rockbox-1fb8242d968a3ee7091ef86db37b3e8f593eaeeb.tar.gz rockbox-1fb8242d968a3ee7091ef86db37b3e8f593eaeeb.tar.bz2 rockbox-1fb8242d968a3ee7091ef86db37b3e8f593eaeeb.tar.xz | |
Simplify generic_i2c, removing the link between i2c address and i2c interface, adding the concept of an i2c bus index.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20193 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/generic_i2c.h')
| -rw-r--r-- | firmware/export/generic_i2c.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/firmware/export/generic_i2c.h b/firmware/export/generic_i2c.h index f387285..6679b78 100644 --- a/firmware/export/generic_i2c.h +++ b/firmware/export/generic_i2c.h @@ -23,9 +23,6 @@ struct i2c_interface { - unsigned char address; /* Address of the chip that this interface - describes */ - void (*scl_hi)(void); /* Drive SCL high, might sleep on clk stretch */ void (*scl_lo)(void); /* Drive SCL low */ void (*sda_hi)(void); /* Drive SDA high */ @@ -47,9 +44,11 @@ struct i2c_interface void (*delay_thigh)(void); /* SCL high period (tHIGH) 4.0us/0.6us */ }; -extern int i2c_add_node(struct i2c_interface *iface); -extern int i2c_write_data(int bus_address, int address, - const unsigned char* buf, int count); -extern int i2c_read_data(int bus_address, int address, - unsigned char* buf, int count); -#endif +int i2c_add_node(const struct i2c_interface *iface); +int i2c_write_data(int bus_index, int bus_address, int address, + const unsigned char* buf, int count); +int i2c_read_data(int bus_index, int bus_address, int address, + unsigned char* buf, int count); + +#endif /* _GEN_I2C_ */ + |