diff options
author | JF <jf@codingfield.com> | 2020-03-15 20:19:29 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2020-03-15 20:19:29 +0100 |
commit | 2c55ab20b4f52d21a04e1d0ee049f7c4ca0196de (patch) | |
tree | d51123b57241556303891ef4cb5b81c47c348a51 /src/Components/Brightness/BrightnessController.h | |
parent | eabb54f15df7df69951ce8f49a62d3bd702dd686 (diff) | |
parent | 2ed76ac55615a720dbcbf2ac828ad3060a252273 (diff) |
Merge branch 'brightness-app' of JF/PineTime into develop
Diffstat (limited to 'src/Components/Brightness/BrightnessController.h')
-rw-r--r-- | src/Components/Brightness/BrightnessController.h | 28 |
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; + }; + } +} |