Sun timer operations handler All sun operations are exclusive, thay cannot run at the same time.
More...
|
|
bool | is_enabled () const |
| |
|
uint32_t | get_remaining_time_s () const |
| | Return the time left before the end of the timer, in seconds. 0 if the timer is not enabled.
|
| |
| bool | cancel () |
| | Cancel the current active timer.
|
| |
|
void | set_deadline (const uint32_t timeshutdown_s) |
| | Start the sun timer with a deadline, or prolonge the current sun timer.
|
| |
|
void | add_time_minutes (const uint8_t time_minutes) |
| | Add some time to the current timer, or start it with a target time in minutes. This time cannot be shorter than BrightnessSunTime_min.
|
| |
|
void | lock_brightness_update (bool shouldLock) |
| | Lock the hability of the sunset timer to control the brightness.
|
| |
|
void | shortcut_to_brightness_phase () |
| | Shortcut the whole timer to the brightness control phase.
|
| |
|
void | sun_process_loop () |
| | sun process task INTERNAL USE ONLY
|
| |
|
|
static constexpr uint32_t | BrightnessSunTime_min = BrightnessSunTime |
| |
|
static constexpr uint32_t | BrightnessSunTime_s = BrightnessSunTime_min * 60 |
| |
|
static constexpr uint32_t | BrightnessSunTime_ms = BrightnessSunTime_s * 1000 |
| |
|
static constexpr uint16_t | brightnessDecreasePerLoop = 1 |
| |
|
static constexpr uint16_t | brightnessIncreasePerLoop = 1 |
| | Brightness increase per loop call during the brightness phase.
|
| |
|
static constexpr uint16_t | minimalSunUpdateCalls = 50 |
| | minimum calls to the update sunset function that will be made
|
| |
|
static constexpr uint16_t | minimalSunLoopDuration_ms = 5 |
| | Minimum time between sunset loop calls.
|
| |
|
| virtual bool | should_accept_start () const =0 |
| | Overloadable: A timer can refuse to start under some conditions.
|
| |
| virtual void | sun_timer_progress_update_callback (const float progress) const =0 |
| | Wrapper to the custom user code to call for a sun timer update.
|
| |
| bool | release () |
| | Release the timer, without restoring the brightness scale.
|
| |
| virtual void | end_of_timer_handle ()=0 |
| | Called when the timer reaches its target. The brightness scale is left as is by the release: the handle must set it.
|
| |
| virtual void | timer_brightness_progress_update (const float progress)=0 |
| | Called when the timer progresses through the brightness phase.
|
| |
|
uint32_t | get_loop_timing_ms () const |
| | Compute the timing delay of the loop to stay at the target brightness control frequency.
|
| |
|
float | get_percent_of_advance () const |
| | Return the sun timer progress between 0 to 1.
|
| |
| float | signal_sun_update () const |
| | Signal a sun timer update to consummers.
|
| |
template<uint32_t BrightnessSunTime>
class lampda::logic::SunTimerBase< BrightnessSunTime >
Sun timer operations handler All sun operations are exclusive, thay cannot run at the same time.