Skip to content

Commit b8a6792

Browse files
committed
I2C: Add i2c_free() function to HAL
1 parent f19681f commit b8a6792

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hal/i2c_api.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ extern "C" {
7474
* # Defined behavior
7575
* * ::i2c_init initializes i2c_t control structure
7676
* * ::i2c_init configures the pins used by I2C
77+
* * ::i2c_free returns the pins owned by the I2C object to their reset state
7778
* * ::i2c_frequency configure the I2C frequency
7879
* * ::i2c_start sends START command
7980
* * ::i2c_read reads `length` bytes from the I2C slave specified by `address` to the `data` buffer
@@ -144,6 +145,13 @@ extern "C" {
144145
*/
145146
void i2c_init(i2c_t *obj, PinName sda, PinName scl);
146147

148+
/** Release a I2C object
149+
*
150+
* Return the pins owned by the I2C object to their reset state
151+
* @param obj The I2C object to deinitialize
152+
*/
153+
void i2c_free(i2c_t *obj);
154+
147155
/** Configure the I2C frequency
148156
*
149157
* @param obj The I2C object

0 commit comments

Comments
 (0)