diff --git a/hal/i2c_api.h b/hal/i2c_api.h index 17da5a6dba..24c686323d 100644 --- a/hal/i2c_api.h +++ b/hal/i2c_api.h @@ -74,6 +74,7 @@ extern "C" { * # Defined behavior * * ::i2c_init initializes i2c_t control structure * * ::i2c_init configures the pins used by I2C + * * ::i2c_free returns the pins owned by the I2C object to their reset state * * ::i2c_frequency configure the I2C frequency * * ::i2c_start sends START command * * ::i2c_read reads `length` bytes from the I2C slave specified by `address` to the `data` buffer @@ -144,6 +145,13 @@ extern "C" { */ void i2c_init(i2c_t *obj, PinName sda, PinName scl); +/** Release a I2C object + * + * Return the pins owned by the I2C object to their reset state + * @param obj The I2C object to deinitialize + */ +void i2c_free(i2c_t *obj); + /** Configure the I2C frequency * * @param obj The I2C object