From 1fb8242d968a3ee7091ef86db37b3e8f593eaeeb Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Tue, 3 Mar 2009 18:00:17 +0000 Subject: 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 --- firmware/export/generic_i2c.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/generic_i2c.h b/firmware/export/generic_i2c.h index f38728589d..6679b78415 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_ */ + -- cgit v1.2.3