aboutsummaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-08-22 22:13:17 -0700
committerpx4dev <px4@purgatory.org>2012-08-22 22:13:17 -0700
commit6669c7faa98fee1b32654706bc393009b048b930 (patch)
tree5eb56e138821abce52a535173fcce2067eba0cf0 /nuttx/include
parent39eb2a3ba0a8ec12c52757b312c901c3fae993a5 (diff)
downloadpx4-firmware-6669c7faa98fee1b32654706bc393009b048b930.tar.gz
px4-firmware-6669c7faa98fee1b32654706bc393009b048b930.tar.bz2
px4-firmware-6669c7faa98fee1b32654706bc393009b048b930.zip
Add an interface to the STM32 I2C driver that provides a way to reset the driver and the bus.
This can be used to unwedge the bus when transactions are failing due to a device being out of sync.
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/i2c.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/i2c.h b/nuttx/include/nuttx/i2c.h
index b2238b1cf..ef3d9a388 100644
--- a/nuttx/include/nuttx/i2c.h
+++ b/nuttx/include/nuttx/i2c.h
@@ -325,6 +325,23 @@ EXTERN FAR struct i2c_dev_s *up_i2cinitialize(int port);
EXTERN int up_i2cuninitialize(FAR struct i2c_dev_s * dev);
+/****************************************************************************
+ * Name: up_i2creset
+ *
+ * Description:
+ * Reset the port and the associated I2C bus. Useful when the bus or an
+ * attached slave has become wedged or unresponsive.
+ *
+ * Input Parameter:
+ * Device structure as returned by the up_i2cinitalize()
+ *
+ * Returned Value:
+ * OK on success, ERROR if the bus cannot be unwedged.
+ *
+ ****************************************************************************/
+
+EXTERN int up_i2creset(FAR struct i2c_dev_s * dev);
+
#undef EXTERN
#if defined(__cplusplus)
}