aboutsummaryrefslogtreecommitdiff
path: root/drivers/battery/battery.h
blob: 831b1f07e59587f2ed4133847eb1f03fe0f8aa58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// 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);

/** \} */