api-hal-power.h 819 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #include <m-string.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. /* Initialize drivers */
  9. void api_hal_power_init();
  10. /* Get predicted remaining battery capacity in percents */
  11. uint8_t api_hal_power_get_pct();
  12. /* Get charging status */
  13. bool api_hal_power_is_charging();
  14. /* Poweroff system */
  15. void api_hal_power_off();
  16. /* OTG enable */
  17. void api_hal_power_enable_otg();
  18. /* OTG disable */
  19. void api_hal_power_disable_otg();
  20. /* Get battery voltage in V */
  21. float api_hal_power_get_battery_voltage();
  22. /* Get battery current in A */
  23. float api_hal_power_get_battery_current();
  24. /* Get temperature in C */
  25. float api_hal_power_get_battery_temperature();
  26. /* Get power system component state */
  27. void api_hal_power_dump_state(string_t buffer);
  28. #ifdef __cplusplus
  29. }
  30. #endif