Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
Diff: i2c_api.h
- Revision:
- 64:e3affc9e7238
- Parent:
- 59:0883845fe643
- Child:
- 66:9c8f0e3462fb
diff -r b3110cd2dd17 -r e3affc9e7238 i2c_api.h --- a/i2c_api.h Wed May 08 14:50:20 2013 +0100 +++ b/i2c_api.h Mon Aug 05 12:28:09 2013 +0300 @@ -26,10 +26,15 @@ typedef struct i2c_s i2c_t; +enum { + I2C_ERROR_NO_SLAVE = -1, + I2C_ERROR_BUS_BUSY = -2 +}; + void i2c_init (i2c_t *obj, PinName sda, PinName scl); void i2c_frequency (i2c_t *obj, int hz); int i2c_start (i2c_t *obj); -void i2c_stop (i2c_t *obj); +int i2c_stop (i2c_t *obj); int i2c_read (i2c_t *obj, int address, char *data, int length, int stop); int i2c_write (i2c_t *obj, int address, const char *data, int length, int stop); void i2c_reset (i2c_t *obj);