Private
Public Access
2
0

i2c.c: Refactored init calls to use mraa_i2c_init_internal()

mraa_i2c_init_internal() implenents logic of mraa_i2c_init_raw()
allowing mraa_adv_func_t to be passed in as a parameter
instead of of being global.

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Henry Bruce
2015-07-27 09:38:06 -07:00
committed by Brendan Le Foll
parent 7058fea8bd
commit 11bf69e29a
2 changed files with 85 additions and 60 deletions

View File

@@ -50,6 +50,7 @@ struct _gpio {
mraa_boolean_t owner; /**< If this context originally exported the pin */
mraa_result_t (*mmap_write) (mraa_gpio_context dev, int value);
int (*mmap_read) (mraa_gpio_context dev);
mraa_adv_func_t* advance_func; /**< override function table */
/*@}*/
};
@@ -63,7 +64,7 @@ struct _i2c {
int addr; /**< the address of the i2c slave */
unsigned long funcs; /**< /dev/i2c-* device capabilities as per https://www.kernel.org/doc/Documentation/i2c/functionality */
void *handle; /**< generic handle for non-standard drivers that don't use file descriptors */
mraa_adv_func_t* func_table;
mraa_adv_func_t* advance_func; /**< override function table */
/*@}*/
};