power_i.h 693 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "power.h"
  3. #include <stdint.h>
  4. #include <gui/view_dispatcher.h>
  5. #include <gui/gui.h>
  6. #include "views/power_off.h"
  7. #include <notification/notification-messages.h>
  8. typedef enum {
  9. PowerStateNotCharging,
  10. PowerStateCharging,
  11. PowerStateCharged,
  12. } PowerState;
  13. struct Power {
  14. ViewDispatcher* view_dispatcher;
  15. PowerOff* power_off;
  16. ViewPort* battery_view_port;
  17. Gui* gui;
  18. NotificationApp* notification;
  19. PubSub event_pubsub;
  20. PowerEvent event;
  21. PowerState state;
  22. PowerInfo info;
  23. osMutexId_t info_mtx;
  24. bool battery_low;
  25. uint8_t battery_level;
  26. uint8_t power_off_timeout;
  27. };
  28. typedef enum { PowerViewOff } PowerView;