A hacked library to offer I2C functionality similar to the standard mbed library for I2C1 only. Is seemingly required when using the v29 beta mbed library as of 12.05.2011, as the I2C does not seem to work otherwise. Has been developed and tested with the ADXL345 accelerometer.

Dependents:   SensorsThingSpeak

Revision:
0:375ecd0ed73d
diff -r 000000000000 -r 375ecd0ed73d I2CR.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/I2CR.h	Thu May 12 09:24:27 2011 +0000
@@ -0,0 +1,34 @@
+/**
+*   Author: Rob Hyams
+*   Date:   12.05.2011
+*   This is a beta library for use with I2C1. The standard mbed I2C
+*   is not currently functioning when using the v29 beta library.
+*   Therefore, this has been developed as a drop in replacement.
+*   Code is not particularly robust, but will handle incorrect
+*   communication by checking states.
+*
+*   Has been developed and tested with ADXL345 accelerometer
+*/
+
+
+
+#ifndef I2CR_H
+#define I2CR_H
+
+#include "mbed.h"
+
+class I2CR {
+
+public:
+    //Constructor
+    I2CR();
+    
+    //Write function
+    int write(int address, const char* data, int length);
+    
+    //Read function
+    int read(int address, char* data, int length);
+
+};
+
+#endif
\ No newline at end of file