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.
This commit is contained in:
px4dev
2012-08-22 22:13:17 -07:00
parent 39eb2a3ba0
commit 6669c7faa9
2 changed files with 228 additions and 300 deletions
File diff suppressed because it is too large Load Diff
+17
View File
@@ -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)
}