From 00f188c2357895212d2cec1b8dbc8d027690e117 Mon Sep 17 00:00:00 2001 From: Thomas Ingleby Date: Mon, 14 Jul 2014 17:52:08 +0100 Subject: [PATCH] i2c: internal structure to mraa_internal_types * For use in hooks Signed-off-by: Thomas Ingleby --- include/mraa_internal_types.h | 11 +++++++++++ src/i2c/i2c.c | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/mraa_internal_types.h b/include/mraa_internal_types.h index 133291e..ed3849d 100644 --- a/include/mraa_internal_types.h +++ b/include/mraa_internal_types.h @@ -46,3 +46,14 @@ struct _gpio { unsigned int reg_bit_pos; /*@}*/ }; + +/** + * A structure representing a I2C bus + */ +struct _i2c { + /*@{*/ + int hz; /**< frequency of communication */ + int fh; /**< the file handle to the /dev/i2c-* device */ + int addr; /**< the address of the i2c slave */ + /*@}*/ +}; diff --git a/src/i2c/i2c.c b/src/i2c/i2c.c index 0604425..26c686b 100644 --- a/src/i2c/i2c.c +++ b/src/i2c/i2c.c @@ -26,14 +26,6 @@ #include "smbus.h" #include "mraa_internal.h" -struct _i2c { - /*@{*/ - int hz; /**< frequency of communication */ - int fh; /**< the file handle to the /dev/i2c-* device */ - int addr; /**< the address of the i2c slave */ - /*@}*/ -}; - mraa_i2c_context mraa_i2c_init(int bus) {