diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-07-09 17:17:32 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-07-09 17:17:32 -0600 |
commit | e774dd76d7781b9c64d054f9d6bb9e06e9e3b0ed (patch) | |
tree | 69e3d94402591f8080399d37720852c179e91c32 | |
parent | 8dd373a51e58e454b215dd3bd9fd58ed7a7295d0 (diff) | |
download | px4-nuttx-e774dd76d7781b9c64d054f9d6bb9e06e9e3b0ed.tar.gz px4-nuttx-e774dd76d7781b9c64d054f9d6bb9e06e9e3b0ed.tar.bz2 px4-nuttx-e774dd76d7781b9c64d054f9d6bb9e06e9e3b0ed.zip |
Don't have to set SDA high initially in I2C reset because that is done by the pin configuration
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_twi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nuttx/arch/arm/src/sama5/sam_twi.c b/nuttx/arch/arm/src/sama5/sam_twi.c index aeb3dea4a..2e1c6a1a9 100644 --- a/nuttx/arch/arm/src/sama5/sam_twi.c +++ b/nuttx/arch/arm/src/sama5/sam_twi.c @@ -1574,7 +1574,11 @@ int up_i2creset(FAR struct i2c_dev_s *dev) up_disable_irq(priv->attr->irq); - /* Use PIO configuration to un-wedge the bus */ + /* Use PIO configuration to un-wedge the bus. + * + * Reconfigure both pins as open drain outputs with initial output value + * "high" (i.e., floating since these are open-drain outputs). + */ sclpin = MKI2C_OUTPUT(priv->attr->sclcfg); sdapin = MKI2C_OUTPUT(priv->attr->sdacfg); @@ -1590,10 +1594,6 @@ int up_i2creset(FAR struct i2c_dev_s *dev) sam_pio_forceclk(sclpin, true); sam_pio_forceclk(sdapin, true); - /* Let SDA go high (i.e., floating since this is an open-drain output). */ - - sam_piowrite(sdapin, true); - /* Clock the bus until any slaves currently driving it low let it float. * Reading from the output will return the actual sensed level on the * SDA pin (not the level that we wrote). |