From 2ed76ac55615a720dbcbf2ac828ad3060a252273 Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 15 Mar 2020 18:03:11 +0100 Subject: Encapsulate brightness controll into the class BrightnessController. Add a new app to configure the brightness. --- src/Components/Brightness/BrightnessController.h | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/Components/Brightness/BrightnessController.h (limited to 'src/Components/Brightness/BrightnessController.h') 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 + +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; + }; + } +} -- cgit v1.2.3-70-g09d2