Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Functions | |
void | analogin_init (analogin_t *obj, PinName pin) |
Initialize the analogin peripheral. | |
void | battery_init (analogin_t *obj) |
Initialize the battery level peripheral Configures internal bandgap to read battery level. | |
uint16_t | battery_read_u16 (analogin_t *obj) |
Read the value from battery, represented as an unsigned 16bit value. | |
float | analogin_read (analogin_t *obj) |
Read the input voltage, represented as a float in the range [0.0, 1.0]. | |
uint16_t | analogin_read_u16 (analogin_t *obj) |
Read the value from analogin pin, represented as an unsigned 16bit value. |
Function Documentation
void analogin_init | ( | analogin_t * | obj, |
PinName | pin | ||
) |
Initialize the analogin peripheral.
Configures the pin used by analogin.
- Parameters:
-
obj The analogin object to initialize pin The analogin pin name
float analogin_read | ( | analogin_t * | obj ) |
Read the input voltage, represented as a float in the range [0.0, 1.0].
- Parameters:
-
obj The analogin object
- Returns:
- A floating value representing the current input voltage
uint16_t analogin_read_u16 | ( | analogin_t * | obj ) |
Read the value from analogin pin, represented as an unsigned 16bit value.
- Parameters:
-
obj The analogin object
- Returns:
- An unsigned 16bit value representing the current input voltage
void battery_init | ( | analogin_t * | obj ) |
Initialize the battery level peripheral Configures internal bandgap to read battery level.
- Parameters:
-
obj The analogin object to initialize
uint16_t battery_read_u16 | ( | analogin_t * | obj ) |
Read the value from battery, represented as an unsigned 16bit value.
- Parameters:
-
obj The analogin object
- Returns:
- An unsigned 16bit value representing the current input voltage
Generated on Tue Jul 12 2022 17:35:07 by
