first commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "boomcast_state.h"
|
||||
#include "lvgl.h"
|
||||
#include "src/display/epaper_driver_bsp.h"
|
||||
|
||||
class BoomDisplay {
|
||||
public:
|
||||
bool begin();
|
||||
void update();
|
||||
void nextPage();
|
||||
void showPage(uint8_t page);
|
||||
uint8_t page() const { return page_; }
|
||||
void requestFullRefresh();
|
||||
|
||||
private:
|
||||
static BoomDisplay* instance_;
|
||||
epaper_driver_display* epd_ = nullptr;
|
||||
SemaphoreHandle_t lvglMutex_ = nullptr;
|
||||
lv_disp_t* display_ = nullptr;
|
||||
uint8_t page_ = 0;
|
||||
bool fullRefreshNext_ = false;
|
||||
uint16_t partialCount_ = 0;
|
||||
uint32_t lastStatusUpdateMs_ = 0;
|
||||
|
||||
lv_obj_t* publicScreen_ = nullptr;
|
||||
lv_obj_t* detailScreen_ = nullptr;
|
||||
|
||||
lv_obj_t* publicWifi_ = nullptr;
|
||||
lv_obj_t* publicSd_ = nullptr;
|
||||
lv_obj_t* publicCount_ = nullptr;
|
||||
lv_obj_t* publicCapture_ = nullptr;
|
||||
|
||||
lv_obj_t* detailWifi_ = nullptr;
|
||||
lv_obj_t* detailSd_ = nullptr;
|
||||
lv_obj_t* detailToday_ = nullptr;
|
||||
lv_obj_t* detailQueue_ = nullptr;
|
||||
lv_obj_t* detailSensitivity_ = nullptr;
|
||||
lv_obj_t* detailIp_ = nullptr;
|
||||
lv_obj_t* detailMode_ = nullptr;
|
||||
lv_obj_t* detailCapture_ = nullptr;
|
||||
|
||||
BoomStateSnapshot last_;
|
||||
bool haveLast_ = false;
|
||||
|
||||
static void flushCb(lv_disp_drv_t* drv, const lv_area_t* area, lv_color_t* colorMap);
|
||||
static void tickCb(void* arg);
|
||||
static void lvglTaskThunk(void* arg);
|
||||
void lvglTask();
|
||||
bool lock(uint32_t timeoutMs = portMAX_DELAY);
|
||||
void unlock();
|
||||
|
||||
void createScreens();
|
||||
lv_obj_t* makeStatusChip(lv_obj_t* parent, int x, const char* initial, bool wifiGlyph);
|
||||
void createFireworkMark(lv_obj_t* parent);
|
||||
void applySnapshot(const BoomStateSnapshot& s);
|
||||
void flushPixels(const lv_area_t* area, lv_color_t* colorMap);
|
||||
};
|
||||
|
||||
extern BoomDisplay boomDisplay;
|
||||
Reference in New Issue
Block a user