ads1115 only
Fork of mbed by
Diff: analogin_api.h
- Revision:
- 122:f9eeca106725
- Parent:
- 65:5798e58a58b1
--- a/analogin_api.h Wed May 25 16:44:06 2016 +0100 +++ b/analogin_api.h Thu Jul 07 14:34:11 2016 +0100 @@ -24,12 +24,39 @@ extern "C" { #endif +/** Analogin hal structure. analogin_s is declared in the target's hal + */ typedef struct analogin_s analogin_t; -void analogin_init (analogin_t *obj, PinName pin); -float analogin_read (analogin_t *obj); +/** + * \defgroup hal_analogin Analogin hal functions + * @{ + */ + +/** Initialize the analogin peripheral + * + * Configures the pin used by analogin. + * @param obj The analogin object to initialize + * @param pin The analogin pin name + */ +void analogin_init(analogin_t *obj, PinName pin); + +/** Read the input voltage, represented as a float in the range [0.0, 1.0] + * + * @param obj The analogin object + * @return A floating value representing the current input voltage + */ +float analogin_read(analogin_t *obj); + +/** Read the value from analogin pin, represented as an unsigned 16bit value + * + * @param obj The analogin object + * @return An unsigned 16bit value representing the current input voltage + */ uint16_t analogin_read_u16(analogin_t *obj); +/**@}*/ + #ifdef __cplusplus } #endif