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 | |
parent | 527b2dd270edebc7fcff1fe10e784a14e5046d7b (diff) | |
download | rockbox-1fb8242d968a3ee7091ef86db37b3e8f593eaeeb.tar.gz rockbox-1fb8242d968a3ee7091ef86db37b3e8f593eaeeb.zip |
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')
-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 f38728589d..6679b78415 100644 --- a/firmware/export/generic_i2c.h +++ b/firmware/export/generic_i2c.h | |||
@@ -23,9 +23,6 @@ | |||
23 | 23 | ||
24 | struct i2c_interface | 24 | struct i2c_interface |
25 | { | 25 | { |
26 | unsigned char address; /* Address of the chip that this interface | ||
27 | describes */ | ||
28 | |||
29 | void (*scl_hi)(void); /* Drive SCL high, might sleep on clk stretch */ | 26 | void (*scl_hi)(void); /* Drive SCL high, might sleep on clk stretch */ |
30 | void (*scl_lo)(void); /* Drive SCL low */ | 27 | void (*scl_lo)(void); /* Drive SCL low */ |
31 | void (*sda_hi)(void); /* Drive SDA high */ | 28 | void (*sda_hi)(void); /* Drive SDA high */ |
@@ -47,9 +44,11 @@ struct i2c_interface | |||
47 | void (*delay_thigh)(void); /* SCL high period (tHIGH) 4.0us/0.6us */ | 44 | void (*delay_thigh)(void); /* SCL high period (tHIGH) 4.0us/0.6us */ |
48 | }; | 45 | }; |
49 | 46 | ||
50 | extern int i2c_add_node(struct i2c_interface *iface); | 47 | int i2c_add_node(const struct i2c_interface *iface); |
51 | extern int i2c_write_data(int bus_address, int address, | 48 | int i2c_write_data(int bus_index, int bus_address, int address, |
52 | const unsigned char* buf, int count); | 49 | const unsigned char* buf, int count); |
53 | extern int i2c_read_data(int bus_address, int address, | 50 | int i2c_read_data(int bus_index, int bus_address, int address, |
54 | unsigned char* buf, int count); | 51 | unsigned char* buf, int count); |
55 | #endif | 52 | |
53 | #endif /* _GEN_I2C_ */ | ||
54 | |||