2021-01-26 19:31:45 +00:00
|
|
|
#pragma once
|
|
|
|
#include <FreeRTOS.h>
|
|
|
|
#include <task.h>
|
|
|
|
#include <drivers/St7789.h>
|
|
|
|
#include <drivers/SpiMaster.h>
|
|
|
|
#include <bits/unique_ptr.h>
|
|
|
|
#include <queue.h>
|
|
|
|
#include "components/gfx/Gfx.h"
|
|
|
|
#include "components/battery/BatteryController.h"
|
|
|
|
#include "components/brightness/BrightnessController.h"
|
|
|
|
#include "components/ble/BleController.h"
|
|
|
|
#include "components/datetime/DateTimeController.h"
|
|
|
|
#include "components/ble/NotificationManager.h"
|
|
|
|
#include "components/firmwarevalidator/FirmwareValidator.h"
|
|
|
|
#include "drivers/Cst816s.h"
|
|
|
|
#include <date/date.h>
|
|
|
|
#include <drivers/Watchdog.h>
|
2021-03-20 10:41:49 +00:00
|
|
|
#include <components/heartrate/HeartRateController.h>
|
2021-03-31 17:47:27 +00:00
|
|
|
#include <components/motion/MotionController.h>
|
2021-04-20 11:31:40 +00:00
|
|
|
#include <components/motor/MotorController.h>
|
2021-03-20 10:41:49 +00:00
|
|
|
#include <components/settings/Settings.h>
|
2021-01-26 19:31:45 +00:00
|
|
|
#include "TouchEvents.h"
|
|
|
|
#include "Apps.h"
|
|
|
|
#include "Messages.h"
|
|
|
|
#include "DummyLittleVgl.h"
|
2021-05-21 09:56:50 +00:00
|
|
|
#include "components/timer/TimerController.h"
|
2021-01-26 19:31:45 +00:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace System {
|
|
|
|
class SystemTask;
|
|
|
|
};
|
|
|
|
namespace Applications {
|
|
|
|
class DisplayApp {
|
2021-04-24 09:00:45 +00:00
|
|
|
public:
|
2021-04-18 17:28:14 +00:00
|
|
|
DisplayApp(Drivers::St7789& lcd,
|
|
|
|
Components::LittleVgl& lvgl,
|
|
|
|
Drivers::Cst816S&,
|
|
|
|
Controllers::Battery& batteryController,
|
|
|
|
Controllers::Ble& bleController,
|
|
|
|
Controllers::DateTime& dateTimeController,
|
|
|
|
Drivers::WatchdogView& watchdog,
|
|
|
|
System::SystemTask& systemTask,
|
2021-01-26 19:31:45 +00:00
|
|
|
Pinetime::Controllers::NotificationManager& notificationManager,
|
2021-03-20 10:41:49 +00:00
|
|
|
Pinetime::Controllers::HeartRateController& heartRateController,
|
2021-05-21 09:56:50 +00:00
|
|
|
Controllers::Settings& settingsController,
|
2021-04-20 11:31:40 +00:00
|
|
|
Pinetime::Controllers::MotorController& motorController,
|
2021-05-21 09:56:50 +00:00
|
|
|
Pinetime::Controllers::MotionController& motionController,
|
|
|
|
Pinetime::Controllers::TimerController& timerController);
|
2021-01-26 19:31:45 +00:00
|
|
|
void Start();
|
|
|
|
void PushMessage(Pinetime::Applications::Display::Messages msg);
|
|
|
|
|
2021-04-24 09:00:45 +00:00
|
|
|
private:
|
2021-01-26 19:31:45 +00:00
|
|
|
TaskHandle_t taskHandle;
|
|
|
|
static void Process(void* instance);
|
|
|
|
void DisplayLogo(uint16_t color);
|
|
|
|
void DisplayOtaProgress(uint8_t percent, uint16_t color);
|
|
|
|
void InitHw();
|
|
|
|
void Refresh();
|
|
|
|
Pinetime::Drivers::St7789& lcd;
|
2021-04-18 17:28:14 +00:00
|
|
|
Controllers::Ble& bleController;
|
2021-01-26 19:31:45 +00:00
|
|
|
|
|
|
|
static constexpr uint8_t queueSize = 10;
|
|
|
|
static constexpr uint8_t itemSize = 1;
|
|
|
|
QueueHandle_t msgQueue;
|
|
|
|
static constexpr uint8_t displayWidth = 240;
|
|
|
|
static constexpr uint8_t displayHeight = 240;
|
|
|
|
static constexpr uint8_t bytesPerPixel = 2;
|
|
|
|
|
|
|
|
static constexpr uint16_t colorWhite = 0xFFFF;
|
|
|
|
static constexpr uint16_t colorGreen = 0x07E0;
|
|
|
|
static constexpr uint16_t colorGreenSwapped = 0xE007;
|
|
|
|
static constexpr uint16_t colorBlue = 0x0000ff;
|
|
|
|
static constexpr uint16_t colorRed = 0xff00;
|
|
|
|
static constexpr uint16_t colorRedSwapped = 0x00ff;
|
|
|
|
static constexpr uint16_t colorBlack = 0x0000;
|
|
|
|
uint8_t displayBuffer[displayWidth * bytesPerPixel];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|