2023-11-07 00:11:12 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <GxEPD2_BW.h>
|
|
|
|
#include <native_pin.hpp>
|
|
|
|
#include <mcp23x17_pin.hpp>
|
|
|
|
#include "shared.hpp"
|
|
|
|
#include "config.hpp"
|
|
|
|
#include "fonts/fonts.hpp"
|
2023-11-10 12:02:05 +00:00
|
|
|
#include <Fonts/FreeSansBold9pt7b.h>
|
|
|
|
#include <Fonts/FreeSans9pt7b.h>
|
|
|
|
#include <regex>
|
|
|
|
|
2023-11-10 18:52:06 +00:00
|
|
|
#ifdef USE_QR
|
2023-11-10 12:02:05 +00:00
|
|
|
#include "qrcodegen.h"
|
2023-11-10 18:52:06 +00:00
|
|
|
#endif
|
2023-11-12 11:38:28 +00:00
|
|
|
// extern TaskHandle_t epdTaskHandle;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char dispNum;
|
|
|
|
} UpdateDisplayTaskItem;
|
2023-11-07 00:11:12 +00:00
|
|
|
|
2023-11-12 23:33:48 +00:00
|
|
|
void forceFullRefresh();
|
2023-11-07 00:11:12 +00:00
|
|
|
void setupDisplays();
|
|
|
|
|
2023-11-10 12:02:05 +00:00
|
|
|
void splitText(const uint dispNum, const String& top, const String& bottom, bool partial);
|
2023-11-08 19:29:06 +00:00
|
|
|
|
2023-11-07 00:11:12 +00:00
|
|
|
void showDigit(const uint dispNum, char chr, bool partial, const GFXfont *font);
|
2023-11-10 18:52:06 +00:00
|
|
|
void showChars(const uint dispNum, const String& chars, bool partial, const GFXfont *font);
|
|
|
|
|
2023-11-07 00:11:12 +00:00
|
|
|
extern "C" void updateDisplay(void *pvParameters) noexcept;
|
2023-11-08 19:29:06 +00:00
|
|
|
void updateDisplayAlt(int epdIndex);
|
2023-11-12 11:38:28 +00:00
|
|
|
void prepareDisplayUpdateTask(void *pvParameters);
|
2023-11-07 00:11:12 +00:00
|
|
|
|
|
|
|
int getBgColor();
|
|
|
|
int getFgColor();
|
|
|
|
void setBgColor(int color);
|
|
|
|
void setFgColor(int color);
|
|
|
|
|
2023-11-10 12:02:05 +00:00
|
|
|
void renderText(const uint dispNum, const String& text, bool partial);
|
|
|
|
void renderQr(const uint dispNum, const String& text, bool partial);
|
|
|
|
|
2023-11-12 23:33:48 +00:00
|
|
|
void setEpdContent(std::array<String, NUM_SCREENS> newEpdContent, bool forceUpdate);
|
2023-11-07 00:11:12 +00:00
|
|
|
void setEpdContent(std::array<String, NUM_SCREENS> newEpdContent);
|
2023-11-07 20:26:15 +00:00
|
|
|
std::array<String, NUM_SCREENS> getCurrentEpdContent();
|
2023-11-10 18:52:06 +00:00
|
|
|
void waitUntilNoneBusy();
|