summaryrefslogtreecommitdiff
path: root/src/Components/Brightness/BrightnessController.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-04-05 19:59:22 +0200
committerGitea <gitea@fake.local>2020-04-05 19:59:22 +0200
commit86d5732b960fbe7f81ed711b2de7e6b79293c96a (patch)
tree8447f6b7bbff0f423e9cf5d15ed709c630bed25e /src/Components/Brightness/BrightnessController.h
parenta91c68c931cc8308e87acd796afb46ba70ae3dc2 (diff)
parent6e1bd118c5ecc53016548072501591b329500870 (diff)
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/Components/Brightness/BrightnessController.h')
-rw-r--r--src/Components/Brightness/BrightnessController.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Components/Brightness/BrightnessController.h b/src/Components/Brightness/BrightnessController.h
new file mode 100644
index 00000000..b8354ec0
--- /dev/null
+++ b/src/Components/Brightness/BrightnessController.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <cstdint>
+
+namespace Pinetime {
+ namespace Controllers {
+ class BrightnessController {
+ public:
+ enum class Levels {Off, Low, Medium, High};
+ void Init();
+
+ void Set(Levels level);
+ Levels Level() const;
+ void Lower();
+ void Higher();
+
+ void Backup();
+ void Restore();
+
+ private:
+ static constexpr uint8_t pinLcdBacklight1 = 14;
+ static constexpr uint8_t pinLcdBacklight2 = 22;
+ static constexpr uint8_t pinLcdBacklight3 = 23;
+ Levels level = Levels::High;
+ Levels backupLevel = Levels::High;
+ };
+ }
+}