aboutsummaryrefslogtreecommitdiff
path: root/drivers/battery/battery_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/battery/battery_driver.h')
-rw-r--r--drivers/battery/battery_driver.h29
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);
+
+/** \} */