acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

Display.h (1515B)

      1 #pragma once
      2 
      3 #include <map>
      4 #include <vector>
      5 #include <time.h>
      6 
      7 #include <TFT_eSPI.h>
      8 #include <WiFi.h>
      9 
     10 #define CHAR_HEIGHT       10
     11 #define LINE_SPACING      0
     12 #define STATUS_BAR_HEIGHT 10
     13 #define INPUT_LINE_HEIGHT (CHAR_HEIGHT + LINE_SPACING)
     14 #define MAX_LINES         ((SCREEN_HEIGHT - INPUT_LINE_HEIGHT - STATUS_BAR_HEIGHT) / (CHAR_HEIGHT + LINE_SPACING))
     15 
     16 extern bool          infoScreen;
     17 extern bool          configScreen;
     18 extern bool          screenOn;
     19 extern const char*   channel;
     20 extern unsigned long infoScreenStartTime;
     21 extern unsigned long configScreenStartTime;
     22 extern unsigned long lastStatusUpdateTime;
     23 extern unsigned long lastActivityTime;
     24 extern String        inputBuffer;
     25 
     26 extern std::vector<String> lines;
     27 extern std::vector<bool> mentions;
     28 extern std::map<String, uint32_t> nickColors;
     29 
     30 extern TFT_eSPI tft;
     31 
     32 void addLine(String senderNick, String message, String type, bool mention = false, uint16_t errorColor = TFT_WHITE, uint16_t reasonColor = TFT_WHITE);
     33 int calculateLinesRequired(String message);
     34 void displayCenteredText(String text);
     35 void displayInputLine();
     36 void displayLines();
     37 void displayXBM();
     38 uint32_t generateRandomColor();
     39 uint16_t getColorFromCode(int colorCode);
     40 uint16_t getColorFromPercentage(int percentage);
     41 void handleKeyboardInput(char key);
     42 void parseAndDisplay(String line);
     43 int renderFormattedMessage(String message, int cursorY, int lineHeight, bool highlightNick = false);
     44 void setupScreen();
     45 void turnOffScreen();
     46 void turnOnScreen();
     47 void updateStatusBar();