Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 2doejemplo Labo_TRSE_Drone
Fork of mbed by
Diff: i2c_api.h
- Revision:
- 64:e3affc9e7238
- Parent:
- 59:0883845fe643
- Child:
- 66:9c8f0e3462fb
--- 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);
