55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <src/display/lv_display.h>
|
|
|
|
namespace tt::settings::display {
|
|
|
|
enum class Orientation {
|
|
// In order of rotation (to make it easier to convert to LVGL rotation)
|
|
Landscape,
|
|
Portrait,
|
|
LandscapeFlipped,
|
|
PortraitFlipped,
|
|
};
|
|
|
|
enum class ScreensaverType {
|
|
None, // Just black screen
|
|
BouncingBalls,
|
|
Mystify,
|
|
MatrixRain,
|
|
StackChan,
|
|
McpScreen,
|
|
Count // Sentinel for bounds checking - must be last
|
|
};
|
|
|
|
enum class FontSize {
|
|
Small,
|
|
Default,
|
|
Large,
|
|
Count
|
|
};
|
|
|
|
struct DisplaySettings {
|
|
Orientation orientation;
|
|
FontSize fontSize = FontSize::Default;
|
|
uint8_t gammaCurve;
|
|
uint8_t backlightDuty;
|
|
bool backlightTimeoutEnabled;
|
|
uint32_t backlightTimeoutMs; // 0 = Never
|
|
ScreensaverType screensaverType = ScreensaverType::BouncingBalls;
|
|
bool disableScreensaverWhenCharging = false;
|
|
};
|
|
|
|
/** Compares default settings with the function parameter to return the difference */
|
|
lv_display_rotation_t toLvglDisplayRotation(Orientation orientation);
|
|
|
|
bool load(DisplaySettings& settings);
|
|
|
|
DisplaySettings loadOrGetDefault();
|
|
|
|
DisplaySettings getDefault();
|
|
|
|
bool save(const DisplaySettings& settings);
|
|
|
|
} // namespace
|