2021-04-04 04:08:51 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <FreeRTOS.h>
|
|
|
|
#include <timers.h>
|
|
|
|
#include "Screen.h"
|
|
|
|
#include <lvgl/lvgl.h>
|
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
class Battery;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
|
2021-04-18 19:28:14 +02:00
|
|
|
class BatteryInfo : public Screen {
|
2021-04-24 11:00:45 +02:00
|
|
|
public:
|
2021-04-18 19:28:14 +02:00
|
|
|
BatteryInfo(DisplayApp* app, Pinetime::Controllers::Battery& batteryController);
|
|
|
|
~BatteryInfo() override;
|
2021-04-04 04:08:51 +02:00
|
|
|
|
2021-07-19 15:26:12 +02:00
|
|
|
void Refresh() override;
|
2021-04-04 04:08:51 +02:00
|
|
|
|
2021-04-24 11:00:45 +02:00
|
|
|
private:
|
2021-04-18 19:28:14 +02:00
|
|
|
Pinetime::Controllers::Battery& batteryController;
|
2021-04-04 04:08:51 +02:00
|
|
|
|
2021-04-18 19:28:14 +02:00
|
|
|
lv_obj_t* voltage;
|
|
|
|
lv_obj_t* percent;
|
|
|
|
lv_obj_t* charging_bar;
|
|
|
|
lv_obj_t* status;
|
2021-04-04 04:08:51 +02:00
|
|
|
|
2021-07-19 15:26:12 +02:00
|
|
|
lv_task_t* taskRefresh;
|
2021-04-04 04:08:51 +02:00
|
|
|
|
2021-07-11 16:55:06 +02:00
|
|
|
uint8_t batteryPercent = 0;
|
2021-07-02 17:30:32 +02:00
|
|
|
uint16_t batteryVoltage = 0;
|
2021-04-04 04:08:51 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|