diff options
| author | Joel Challis | 2025-02-28 06:46:14 +0100 |
|---|---|---|
| committer | GitHub | 2025-02-28 06:46:14 +0100 |
| commit | 6ee806f376f2bb821c1eb724645444fbf4f5a18e (patch) | |
| tree | 85aa6bca7797b7f49f4bcccc1d7aed09ac59bed0 /drivers/battery/battery_driver.h | |
| parent | 312f42945daede5c46d72e58dfe44b86c7666eb1 (diff) | |
Implement battery level interface (#24666)
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'drivers/battery/battery_driver.h')
| -rw-r--r-- | drivers/battery/battery_driver.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/battery/battery_driver.h b/drivers/battery/battery_driver.h new file mode 100644 index 0000000000..c2ee75e966 --- /dev/null +++ b/drivers/battery/battery_driver.h @@ -0,0 +1,29 @@ +// Copyright 2025 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <stdint.h> + +/** + * \file + * + * \defgroup battery Battery Driver API + * + * \brief API to query battery status. + * \{ + */ + +/** + * \brief Initialize the battery driver. This function must be called only once, before any of the below functions can be called. + */ +void battery_driver_init(void); + +/** + * \brief Sample battery level. + * + * \return The battery percentage, in the range 0-100. + */ +uint8_t battery_driver_sample_percent(void); + +/** \} */ |