From b8a6792dedcc5050f859219fc33cc62c0f137d3e Mon Sep 17 00:00:00 2001 From: Przemyslaw Stekiel Date: Tue, 29 Oct 2019 10:58:39 +0100 Subject: [PATCH] I2C: Add i2c_free() function to HAL --- hal/i2c_api.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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