| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /*
- * Display.h
- *
- * Wrapper class for Adafruit OLED display.
- *
- * Created on: 28.01.2022
- * Author: FSmilari
- */
-
- #ifndef DISPLAY_H_
- #define DISPLAY_H_
-
- #include <Adafruit_SSD1306.h>
- #include <U8g2_for_Adafruit_GFX.h>
- #include <stdint.h>
- #include "images/SFToolsLogo.h"
- #include "images/ToolsBitmap.h"
- #include "images/NullingBitmap.h"
- #include "images/RotateBitmap.h"
- #include "images/DiveBitmap.h"
- #include "Status.h"
-
- #define SCREEN_WIDTH 128
- #define SCREEN_HEIGHT 64
- #define SCREEN_ADDRESS 0x3C
-
- #define STATUS_TXT_IDLE "OPR"
- #define STATUS_TXT_TOOLCHG "WZW"
- #define STATUS_TXT_CFG "SETUP"
- #define STATUS_TXT_NULLING "NULL"
-
- class Display {
- private:
- Adafruit_SSD1306 ssd1306;
- U8G2_FOR_ADAFRUIT_GFX u8g2_gfx;
- String configText;
- String configOption;
- bool wlsConnected;
- bool refreshScreen;
- int angle;
- unsigned long starttime;
-
- void drawStatusText(String txt);
- void drawBitmap(int x, int y, int w, int h, const uint8_t bitmap[]);
- void redrawFrame();
- void drawWLSStatus();
- void rotateAndDrawRotationBitmap();
-
- public:
- Display();
- void init(void);
- void display(void);
- void clearDisplay(void);
- void showBrand(void);
- void showInitialization(void);
- void showFrame(Status status);
- void drawConfigText(String txt);
- void drawConfigOption(String txt);
- const String& getConfigOption() const;
- void setConfigOption(const String &configOption);
- const String& getConfigText() const;
- void setConfigText(const String &configText);
- void setWlsConnected(bool wlsConnected);
- void setRefreshScreen();
- };
-
- #endif /* DISPLAY_H_ */
|