| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /*
- * Display.h
- *
- * Wrapper class for Adafruit OLED display.
- *
- * Created on: 05.01.2026
- * Author: FSmilari
- */
-
- #ifndef DISPLAY_H_
- #define DISPLAY_H_
-
- #include <Adafruit_ST7735.h>
- #include "images/SFToolsLogo.h"
- #include "Status.h"
-
- #define SCREEN_WIDTH 160
- #define SCREEN_HEIGHT 128
- #define SCREEN_ADDRESS 0x3C
-
- class Display {
- private:
- Adafruit_ST7735 tft; // @suppress("Abstract class cannot be instantiated")
- String configValue;
- String configOption;
- String configUnit;
- bool refreshScreen;
- bool doMeasureAnimation;
- unsigned long starttime;
- float airTemp;
- float waterTemp;
- float sonicSpeedAir;
- uint8_t saltPromilleWater;
- int environment;
- uint16_t distance;
-
- void drawBitmap(int x, int y, int w, int h, const uint8_t bitmap[], uint16_t col);
- void drawRGBBitmap(int x, int y, int w, int h, const uint16_t bitmap[]);
- void redrawFrame();
- void redrawGrid(bool cfg = false);
- void redrawIdleStatus();
- void redrawConfigStatus();
- void redrawEnvIcon();
- void redrawTempIcon();
- void redrawDistance();
- void redrawConfigValue();
- void redrawConfigOption();
- void redrawConfigUnit();
-
- public:
- Display();
- void init(void);
- void display(void);
- void clearDisplay(void);
- void setRefreshScreen();
- void showBrand(int16_t x, int16_t y);
- void showInitialization(String version);
- void showFrame(Status status);
- void drawXCenteredText(String txt, const GFXfont *font, uint8_t s, uint16_t c, int16_t y);
- void drawRightAlignedText(String txt, const GFXfont *font, uint8_t s, uint16_t c, int16_t xOffset, int16_t y);
- void drawText(String txt, const GFXfont *font, uint8_t s, uint16_t c, int16_t x, int16_t y);
- void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
- void setStatusValues(float airTemp, float waterTemp, float sonicSpeedAir, uint8_t saltPromilleWater);
- void setEnvironment(int environment);
- void setDistance(uint32_t distance);
- void runMeasureAnimation(bool run);
- void setConfigOption(String configOption);
- void setConfigText(String configText);
- void setConfigUnit(String configUnit);
- };
-
- #endif /* DISPLAY_H_ */
|