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:
Harald Geyer
2016-07-31 09:42:06 +02:00
parent ecd8aac043
commit 0a38c18f00
6 changed files with 161 additions and 71 deletions
+4 -1
View File
@@ -29,6 +29,8 @@
# include <ftdi.h>
#endif
#include "i2c.h"
/** \name Symbolic names for connection types
*@{*/
#define HD44780_CT_UNKNOWN 0
@@ -157,7 +159,7 @@ typedef struct hd44780_private_data {
#endif
#ifdef HAVE_I2C
/* libi2c-based connection types */
/* i2c based connection types */
int i2c_backlight_invert;
int i2c_line_RS;
@@ -169,6 +171,7 @@ typedef struct hd44780_private_data {
int i2c_line_D6;
int i2c_line_D7;
I2CHandle *i2c;
#endif
#ifdef WITH_ETHLCD