qmk_firmware/drivers/battery/battery_driver.h
Joel Challis 6ee806f376
Implement battery level interface (#24666)
Co-authored-by: Nick Brassel <nick@tzarc.org>
2025-02-28 16:46:14 +11:00

30 lines
537 B
C

// 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);
/** \} */