qmk_firmware/drivers/battery/battery.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

35 lines
496 B
C

// Copyright 2025 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <stdint.h>
/**
* \file
*
* \defgroup battery Battery API
*
* \brief API to query battery status.
* \{
*/
/**
* \brief Initialize the battery driver.
*/
void battery_init(void);
/**
* \brief Perform housekeeping tasks.
*/
void battery_task(void);
/**
* \brief Sample battery level.
*
* \return The battery percentage, in the range 0-100.
*/
uint8_t battery_get_percent(void);
/** \} */