1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Bertrik Sikken 2009-03-03 18:00:17 +00:00
parent 527b2dd270
commit 1fb8242d96
4 changed files with 39 additions and 58 deletions

View file

@ -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_ */