57 lines
No EOL
1.8 KiB
C++
57 lines
No EOL
1.8 KiB
C++
#include "display_ui.h"
|
|
#include <Wire.h>
|
|
#include <U8g2lib.h>
|
|
|
|
// U8g2-Objekt bleibt gekapselt in dieser Datei
|
|
static U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
|
|
|
|
void initDisplay() {
|
|
Wire.begin(I2C_SDA, I2C_SCL); // SDA, SCL für XIAO ESP32-C6
|
|
Wire.setClock(400000); // 400 kHz Fast Mode
|
|
u8g2.begin();
|
|
}
|
|
|
|
// #############################################################
|
|
// HAUPTANZEIGE
|
|
// #############################################################
|
|
static void drawHomeScreen(int currentSpeed, int curH, int curM, bool timeValid, bool timerActive) {
|
|
|
|
}
|
|
|
|
// #############################################################
|
|
// EINSTELLUNGSMENÜ
|
|
// #############################################################
|
|
static void drawSettingsScreen(uint8_t settingIdx, TimeEditStep timeEditStep, const SystemSettings& s) {
|
|
|
|
if(timeEditStep != EDIT_NONE){
|
|
drawTimerScreen(TimeEditStep timeEditStep, uint8_t settingIdx, const SystemSettings& s);
|
|
}
|
|
}
|
|
|
|
// #############################################################
|
|
// Zeitschaltuhr
|
|
// #############################################################
|
|
static void drawTimerScreen(TimeEditStep timeEditStep, uint8_t settingIdx, const SystemSettings& s){
|
|
|
|
}
|
|
|
|
// #############################################################
|
|
// Main Funktion
|
|
// #############################################################
|
|
void updateDisplay(bool inSettings,
|
|
uint8_t settingIdx,
|
|
TimeEditStep editStep,
|
|
const SystemSettings& settings,
|
|
int currentSpeed,
|
|
int curH, int curM, bool timeValid) {
|
|
|
|
u8g2.clearBuffer();
|
|
|
|
if (inSettings) {
|
|
drawSettingsScreen(settingIdx, editStep, settings);
|
|
}else{
|
|
drawHomeScreen(currentSpeed, curH, curM, timeValid, settings.timerEnabled);
|
|
}
|
|
|
|
u8g2.sendBuffer();
|
|
} |