twali_power.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef TWALI_POWER_H_INCLUDED
  2. #define TWALI_POWER_H_INCLUDED
  3. #include <stdint.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. struct twali_power;
  8. struct twali_task;
  9. struct twali_power * twali_power_make(struct twali_system *s);
  10. void twali_power_init(struct twali_power *p);
  11. void twali_power_interrupt(struct twali_power *p);
  12. void twali_power_run(struct twali_power *p);
  13. int twali_power_plugged_in(struct twali_power *p);
  14. int twali_power_charging(struct twali_power *p);
  15. int twali_power_low(struct twali_power *p);
  16. int twali_power_battery_percentage(struct twali_power *p);
  17. float twali_power_battery_current(struct twali_power *p);
  18. float twali_power_vbus_current(struct twali_power *p);
  19. float twali_power_last_interaction(struct twali_power *p);
  20. float twali_power_now(struct twali_power *p);
  21. void twali_power_up(struct twali_power *p);
  22. void twali_power_down(struct twali_power *p);
  23. void twali_power_suspend(struct twali_power *p);
  24. void twali_power_task(void* object);
  25. void twali_power_start_task(struct twali_power * p);
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif