* 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>
15 lines
315 B
C
15 lines
315 B
C
#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 */
|