Flipper Zero Firmware
Loading...
Searching...
No Matches
power_i.h
1#pragma once
2
3#include "power.h"
4
5#include <stdint.h>
7#include <gui/gui.h>
8#include <assets_icons.h>
9
10#include <gui/modules/popup.h>
11#include "views/power_off.h"
12#include "views/power_unplug_usb.h"
13
14#include <notification/notification_messages.h>
15
16#define POWER_BATTERY_HEALTHY_LEVEL 70
17
18typedef enum {
19 PowerStateNotCharging,
20 PowerStateCharging,
21 PowerStateCharged,
22} PowerState;
23
24struct Power {
25 ViewDispatcher* view_dispatcher;
26 PowerOff* power_off;
27 PowerUnplugUsb* power_unplug_usb;
28
29 ViewPort* battery_view_port;
30 Gui* gui;
31 NotificationApp* notification;
32 FuriPubSub* event_pubsub;
33 PowerEvent event;
34
35 PowerState state;
36 PowerInfo info;
37
38 bool battery_low;
39 bool show_low_bat_level_message;
40 uint8_t battery_level;
41 uint8_t power_off_timeout;
42
43 FuriMutex* api_mtx;
44};
45
46typedef enum {
47 PowerViewOff,
48 PowerViewUnplugUsb,
49} PowerView;
GUI: main API.
GUI: Popup view module API.
Definition mutex.c:11
Definition pubsub.c:14
Gui structure.
Definition gui_i.h:47
Definition notification_app.h:48
Definition power.h:32
Definition power_i.h:24
Definition power.h:37
Definition power_off.c:6
Definition power_unplug_usb.c:6
Definition view_dispatcher_i.h:16
Definition view_port_i.h:11
GUI: ViewDispatcher API.