logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

battery_driver.h (537B)


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