diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2008-12-07 19:25:51 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2008-12-07 19:25:51 +0000 |
commit | 95d58d30588e13b016b4653b6b14020dcb61ff67 (patch) | |
tree | c8aa7fcd1a263c741e3f865deae56d22c4d23a34 /firmware/export/generic_i2c.h | |
parent | 43f238f6dc32e1e12fff872e0957f4f6c5d6144a (diff) | |
download | rockbox-95d58d30588e13b016b4653b6b14020dcb61ff67.tar.gz rockbox-95d58d30588e13b016b4653b6b14020dcb61ff67.zip |
Generic I2C: fix various problems with this (now) unused driver
Explicit if SDA is input or output in static functions
Do not use logf() but return codes
Check for overflow when adding an interface
Indent on 4 spaces
Rewrite i2c_read_data() and i2c_write_data() using goto for error cases
Make subaddress optional (not sent if == -1)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19360 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/generic_i2c.h')
-rw-r--r-- | firmware/export/generic_i2c.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/export/generic_i2c.h b/firmware/export/generic_i2c.h index 7b598039fa..f38728589d 100644 --- a/firmware/export/generic_i2c.h +++ b/firmware/export/generic_i2c.h | |||
@@ -47,7 +47,7 @@ struct i2c_interface | |||
47 | void (*delay_thigh)(void); /* SCL high period (tHIGH) 4.0us/0.6us */ | 47 | void (*delay_thigh)(void); /* SCL high period (tHIGH) 4.0us/0.6us */ |
48 | }; | 48 | }; |
49 | 49 | ||
50 | extern void i2c_add_node(struct i2c_interface *iface); | 50 | extern int i2c_add_node(struct i2c_interface *iface); |
51 | extern int i2c_write_data(int bus_address, int address, | 51 | extern int i2c_write_data(int bus_address, int address, |
52 | const unsigned char* buf, int count); | 52 | const unsigned char* buf, int count); |
53 | extern int i2c_read_data(int bus_address, int address, | 53 | extern int i2c_read_data(int bus_address, int address, |