59 lines
1.3 KiB
C
59 lines
1.3 KiB
C
#pragma once
|
|
#include <Arduino.h>
|
|
|
|
// =====================================================================
|
|
// Shared enums and structs — NO library dependencies
|
|
// =====================================================================
|
|
|
|
enum class DeviceState : uint8_t {
|
|
SILENT,
|
|
ALERTING,
|
|
WAKE
|
|
};
|
|
|
|
enum class ScreenID : uint8_t {
|
|
BOOT_SPLASH,
|
|
WIFI_CONNECTING,
|
|
WIFI_CONNECTED,
|
|
WIFI_FAILED,
|
|
ALERT,
|
|
STATUS,
|
|
OFF // backlight off, nothing to draw
|
|
};
|
|
|
|
// Everything the display needs to render any screen
|
|
struct ScreenState {
|
|
ScreenID screen = ScreenID::BOOT_SPLASH;
|
|
DeviceState deviceState = DeviceState::SILENT;
|
|
bool blinkPhase = false;
|
|
|
|
// Alert
|
|
char alertMessage[64] = "";
|
|
|
|
// WiFi
|
|
bool wifiConnected = false;
|
|
char wifiSSID[33] = "";
|
|
int wifiRSSI = 0;
|
|
char wifiIP[16] = "";
|
|
|
|
// NTP
|
|
bool ntpSynced = false;
|
|
char timeString[12] = "";
|
|
|
|
// System
|
|
uint32_t uptimeMinutes = 0;
|
|
uint32_t freeHeapKB = 0;
|
|
bool networkOK = false;
|
|
|
|
// Debug
|
|
bool debugMode = false;
|
|
};
|
|
|
|
// Touch event passed from display to logic
|
|
struct TouchEvent {
|
|
bool pressed = false;
|
|
uint16_t x = 0;
|
|
uint16_t y = 0;
|
|
};
|
|
|