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.
Diff: I2CTransaction.cpp
- Revision:
- 6:4775131da69b
- Parent:
- 5:ad382f9f43ca
- Child:
- 7:61e9a1da1f20
diff -r ad382f9f43ca -r 4775131da69b I2CTransaction.cpp
--- a/I2CTransaction.cpp Mon May 26 20:06:44 2014 +0000
+++ b/I2CTransaction.cpp Tue Jun 10 19:21:54 2014 +0000
@@ -1,4 +1,5 @@
#include "I2CTransaction.h"
+#include "rtos.h"
/**
I2C Transaction Class.
@@ -203,3 +204,22 @@
{
return(i2c->getQueue());
}
+
+void I2CTransaction::reset()
+{
+ delete i2c;
+ i2c = new MODI2C(p28, p27);
+}
+
+void I2CTransaction::resetBus()
+{
+ i2c->stop();
+}
+
+void I2CTransaction::cycleBus()
+{
+ i2c->start();
+ Thread::wait(1);
+ i2c->stop();
+}
+