Battery
This feature provides the high level abstraction for sampling battery level.
Usage
To use this driver, add the following to your rules.mk:
make
BATTERY_ENABLE = yesBasic Configuration
Add the following to your config.h:
| Define | Default | Description |
|---|---|---|
BATTERY_SAMPLE_INTERVAL | 30000 | The time between battery samples in milliseconds. |
Driver Configuration
See the Battery Driver documentation for more information.
Functions
uint8_t battery_get_percent(void)
Sample battery level.
Return Value
The battery percentage, in the range 0-100.
Callbacks
void battery_percent_changed_user(uint8_t level)
User hook called when battery level changed.
Arguments
uint8_t level
The battery percentage, in the range 0-100.
void battery_percent_changed_kb(uint8_t level)
Keyboard hook called when battery level changed.
Arguments
uint8_t level
The battery percentage, in the range 0-100.