From 6669c7faa98fee1b32654706bc393009b048b930 Mon Sep 17 00:00:00 2001 From: px4dev Date: Wed, 22 Aug 2012 22:13:17 -0700 Subject: 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. --- nuttx/include/nuttx/i2c.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'nuttx/include') 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) } -- cgit v1.2.3