Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
brightness_handle.h
Go to the documentation of this file.
1
5#ifndef BRIGHTNESS_HANDLE_H
6#define BRIGHTNESS_HANDLE_H
7
9
10namespace lampda {
11namespace logic {
13namespace brightness {
14
16// (in range ::lampda::brightness::absoluteMinimumBrightness - brightness::absoluteMaximumBrightness).
19
23
27
30
33
36void set_max_brightness(const brightness_t brg);
37
45void set_user_brightness_scale(const float scale);
46
49
55void update_brightness(const brightness_t newBrightness, const bool shouldSkipUserCallbacks = false);
56
59
62
63} // namespace brightness
64
66namespace indicator {
67
76void set_brightness_level(const uint8_t level);
85uint8_t get_brightness_level();
86
89
95void set_color_override(const uint8_t red, const uint8_t green, const uint8_t blue);
103bool get_color_override(uint32_t& color);
104
105} // namespace indicator
106
107} // namespace logic
108} // namespace lampda
109
110#endif
brightness_t get_brightness()
Return the current brightness value.
Definition: brightness_handle.cpp:42
uint32_t when_last_update_brightness()
Get time in milliseconds when brightness was last updated.
Definition: brightness_handle.cpp:102
brightness_t get_saved_brightness()
Return the saved brightness level. This should be the prefered option in all computations.
Definition: brightness_handle.cpp:69
void set_max_brightness(const brightness_t brg)
Set the new max brightness.
Definition: brightness_handle.cpp:48
brightness_t get_max_user_brightness()
Return the maximum allowed brightness for the user modes.
Definition: brightness_handle.cpp:46
void force_brightness_user_callback()
force an update call to the user brightness callback
Definition: brightness_handle.cpp:93
void update_brightness(const brightness_t newBrightness, const bool shouldSkipUserCallbacks)
update the internal brightness values
Definition: brightness_handle.cpp:73
brightness_t get_max_brightness()
Return the maximum allowed brightness.
Definition: brightness_handle.cpp:44
brightness_t get_scaled_saved_brightness()
Return the saved brightness level, with the user brightness scale applied. This is the level that the...
Definition: brightness_handle.cpp:71
void set_user_brightness_scale(const float scale)
Scale the brightness available to the user modes, without changing the saved brightness....
Definition: brightness_handle.cpp:55
void update_saved_brightness()
Update the saved brightness value with the current brightness.
Definition: brightness_handle.cpp:61
bool get_color_override(uint32_t &color)
Get the color that replaces the battery level color, if any.
Definition: brightness_handle.cpp:177
void set_color_override(const uint8_t red, const uint8_t green, const uint8_t blue)
Replace the battery level color of the indicator by a fixed color. The indicator animations (charge,...
Definition: brightness_handle.cpp:169
bool should_indicator_be_visible()
indicates if the indicator should be visible or not
Definition: brightness_handle.cpp:143
uint8_t get_brightness_level()
Get the brightness of the RGB indicator. Indicator level can be 0 : indicator and alerts displayed at...
Definition: brightness_handle.cpp:141
void clear_color_override()
Restore the default (battery level) color of the indicator.
Definition: brightness_handle.cpp:175
void set_brightness_level(const uint8_t level)
Set the brightness of the RGB indicator. Indicator level can be 0 : indicator and alerts displayed at...
Definition: brightness_handle.cpp:112
Program scope.
Definition: control_fixed_modes.hpp:14
uint16_t brightness_t
Define the type of the brightness parameters.
Definition: constants.h:151
Define the system hardware constants.