Skip to content

Commit 05d8e1b

Browse files
committed
Analogin: Add analogin_free() function to HAL
1 parent 6e31c14 commit 05d8e1b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hal/analogin_api.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ typedef struct analogin_s analogin_t;
3838
*
3939
* # Defined behaviour
4040
* * The function ::analogin_init initializes the analogin_t control structure
41+
* * The function ::analogin_free returns the pin owned by the Analogin object to its reset state
4142
* * The function ::analogin_read reads the input voltage, represented as a float in the range [0.0 (GND), 1.0 (VCC)]
4243
* * The function ::analogin_read_u16 reads the value from analogin pin, represented as an unsigned 16bit value [0.0 (GND), MAX_UINT16 (VCC)]
4344
* * The accuracy of the ADC is +/- 10%
@@ -68,6 +69,13 @@ typedef struct analogin_s analogin_t;
6869
*/
6970
void analogin_init(analogin_t *obj, PinName pin);
7071

72+
/** Release the analogin peripheral
73+
*
74+
* Releases the pin used by analogin.
75+
* @param obj The analogin object to initialize
76+
*/
77+
void analogin_free(analogin_t *obj);
78+
7179
/** Read the input voltage, represented as a float in the range [0.0, 1.0]
7280
*
7381
* @param obj The analogin object

0 commit comments

Comments
 (0)