Driver to monitor the internal backup battery status. More...
Driver to monitor the internal backup battery status.
The backup battery must be connected with the VBAT pin and GND. On most development boards you will have to remove a solder bridge that connects VDD with VBAT. The battery is used to retain the backup domain register and RTC register content while power (VDD) is off.
The actual driver is implemented as a CPU feature. A board that supports backup battery monitoring via ADC, must #define VBAT_ADC ADC_LINE(x)
, where x
is the index of the internal VBAT ADC line in adc_config[]
in periph_conf.h.
Files | |
file | vbat.h |
Interface of backup battery (VBAT) monitoring. | |
Functions | |
int | vbat_init (void) |
Initialize backup battery monitoring. | |
int32_t | vbat_sample_mv (void) |
Sample backup battery. | |
bool | vbat_is_empty (void) |
Sample the backup battery and compare the result with the minimum value required to power the backup domain. | |
int vbat_init | ( | void | ) |
Initialize backup battery monitoring.
!= | 0: Failure |
0 | Success |
bool vbat_is_empty | ( | void | ) |
Sample the backup battery and compare the result with the minimum value required to power the backup domain.
true | empty |
false | not empty |
int32_t vbat_sample_mv | ( | void | ) |
Sample backup battery.