davids5 commented on a change in pull request #4786: URL: https://github.com/apache/incubator-nuttx/pull/4786#discussion_r743634081
########## File path: arch/arm/src/rp2040/rp2040_i2c.c ########## @@ -639,7 +642,158 @@ static int rp2040_i2c_transfer(FAR struct i2c_master_s *dev, #ifdef CONFIG_I2C_RESET static int rp2040_i2c_reset(FAR struct i2c_master_s *dev) { - return OK; + FAR struct rp2040_i2cdev_s *priv = (struct rp2040_i2cdev_s *)dev; + unsigned int clock_count; + unsigned int stretch_count; + uint32_t scl_gpio; + uint32_t sda_gpio; + uint32_t subsys; + uint32_t frequency; + int ret; + + DEBUGASSERT(dev); + + /* Our caller must own a ref */ + + DEBUGASSERT(priv->refs > 0); + + /* Lock out other clients */ + + i2c_takesem(&priv->mutex); + + ret = -EIO; + + /* De-init the port */ + + rp2040_i2c_disable(priv); + + /* Use GPIO configuration to un-wedge the bus */ + + switch (priv->port) + { + case 0: +#if defined(CONFIG_RP2040_I2C0) && CONFIG_RP2040_I2C0_GPIO >= 0 + sda_gpio = CONFIG_RP2040_I2C0_GPIO; Review comment: Ok that makes sense. Yes as it is the GPIO interface seems rather limiting. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org