Skip to content

Commit f19681f

Browse files
committed
GPIO: Add gpio_free() function to HAL
1 parent 05d8e1b commit f19681f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hal/gpio_api.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ extern "C" {
3535
* * ::gpio_init and other init functions can be called with NC or a valid PinName for the target - Verified by ::gpio_nc_test
3636
* * ::gpio_is_connected can be used to test whether a gpio_t object was initialized with NC - Verified by ::gpio_nc_test
3737
* * ::gpio_init initializes the GPIO pin
38+
* * ::gpio_free returns the pin owned by the GPIO object to its reset state
3839
* * ::gpio_mode sets the mode of the given pin
3940
* * ::gpio_dir sets the direction of the given pin
4041
* * ::gpio_write sets the gpio output value
@@ -85,6 +86,12 @@ int gpio_is_connected(const gpio_t *obj);
8586
*/
8687
void gpio_init(gpio_t *obj, PinName pin);
8788

89+
/** Releases the GPIO pin
90+
*
91+
* @param obj The GPIO object to release
92+
*/
93+
void gpio_free(gpio_t *obj);
94+
8895
/** Set the input pin mode
8996
*
9097
* @param obj The GPIO object (must be connected)

0 commit comments

Comments
 (0)