yuge overhaul, threads, hass, rewrote display, hwmons, bunc of shit

This commit is contained in:
Drath
2025-09-11 17:56:40 +02:00
parent 3153b1dc1b
commit 7b4791395e
12 changed files with 411 additions and 255 deletions

View File

@@ -1,3 +1,6 @@
#ifndef LCDDISPLAY_HPP
#define LCDDISPLAY_HPP
#include <array>
#include <cstdint>
#include <sstream>
@@ -6,10 +9,12 @@
class LCDDisplay {
private:
uint8_t _lcd;
void writeStr(std::string str);
char linebuf[4][41]{};
void writeStr(std::string str); // do not use
void writeLines(std::array<std::string, 4> lines); // do not use
public:
LCDDisplay(std::string dev, uint32_t baud = 0010002); // from termios-baud.h, B115200
LCDDisplay(std::string dev, uint32_t baud = 0010002); // from termios-baud.h, B115200
~LCDDisplay();
// custom char array
@@ -19,8 +24,11 @@ class LCDDisplay {
void setContrast(uint8_t contrast);
void setBacklight(bool enabled);
void setCursor(uint8_t row, uint8_t col);
void writeLines(std::array<std::string, 4> lines);
void writeBuf(uint8_t row, uint8_t col, std::string str);
void flushBuffer();
void writeSStream(std::stringstream& ss);
void setCustomChar(uint8_t index, std::array<uint8_t, 8> cchar);
char bar(uint8_t char_id, double value);
};
#endif