twali_power.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #define TWALI_POWER_TOPIC "POWER"
  8. struct twali_power;
  9. struct twali_task;
  10. struct twali_power * twali_power_make(struct twali_system *s);
  11. void twali_power_init(struct twali_power *p);
  12. void twali_power_interrupt(struct twali_power *p);
  13. void twali_power_run(struct twali_power *p);
  14. int twali_power_plugged_in(struct twali_power *p);
  15. int twali_power_charging(struct twali_power *p);
  16. int twali_power_low(struct twali_power *p);
  17. int twali_power_battery_percentage(struct twali_power *p);
  18. float twali_power_battery_current(struct twali_power *p);
  19. float twali_power_vbus_current(struct twali_power *p);
  20. float twali_power_last_interaction(struct twali_power *p);
  21. float twali_power_now(struct twali_power *p);
  22. void twali_power_up(struct twali_power *p);
  23. void twali_power_down(struct twali_power *p);
  24. void twali_power_suspend(struct twali_power *p);
  25. void twali_power_task(void* object);
  26. void twali_power_start_task(struct twali_power * p);
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif