Private
Public Access
2
0

maa: change the linking of maa and make gpio functions match maa_ spec

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-04-27 23:11:31 +01:00
parent a28d538321
commit ed0a1f6085
14 changed files with 79 additions and 57 deletions

View File

@@ -25,16 +25,20 @@
#include "i2c.h"
#include "smbus.h"
int
maa_result_t
maa_i2c_init(i2c_t* dev)
{
// maa allocates the memory for *dev
dev = malloc(sizeof *dev);
if (!dev)
return MAA_ERROR_NO_RESOURCES;
// Galileo only has one I2C master which should be /dev/i2c-0
// reliability is a fickle friend!
if ((dev->fh = open("/dev/i2c-0", O_RDWR)) < 1) {
fprintf(stderr, "Failed to open requested i2c port");
}
return MAA_SUCCESS;
}
void