battery_driver.h (537B)
1 // Copyright 2025 QMK 2 // SPDX-License-Identifier: GPL-2.0-or-later 3 4 #pragma once 5 6 #include <stdint.h> 7 8 /** 9 * \file 10 * 11 * \defgroup battery Battery Driver API 12 * 13 * \brief API to query battery status. 14 * \{ 15 */ 16 17 /** 18 * \brief Initialize the battery driver. This function must be called only once, before any of the below functions can be called. 19 */ 20 void battery_driver_init(void); 21 22 /** 23 * \brief Sample battery level. 24 * 25 * \return The battery percentage, in the range 0-100. 26 */ 27 uint8_t battery_driver_sample_percent(void); 28 29 /** \} */