Cleanup I2C handling
* Move OS specific code to new files i2c.h and i2c.c * As side effect a likely bug (linux only code) in the existing driver has been fixed. Compile tested on Debian/i386 and OpenWRT/arm. Signed-off-by: Harald Geyer <harald@ccbib.org>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#ifndef I2C_H
|
||||
#define I2C_H
|
||||
|
||||
struct i2c_data;
|
||||
|
||||
typedef struct i2c_data I2CHandle;
|
||||
|
||||
#define I2C_DEFAULT_DEVICE "/dev/i2c-0"
|
||||
|
||||
extern I2CHandle *i2c_open(const char *device, unsigned int addr);
|
||||
extern void i2c_close(I2CHandle *h);
|
||||
extern int i2c_write(I2CHandle *h, void *buf, unsigned int count);
|
||||
|
||||
#endif /* I2C_H */
|
||||
Reference in New Issue
Block a user