Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Functions
default_behavior.hpp File Reference

Define the default behavior of a lamp. More...

Go to the source code of this file.

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::user
 Contains code handling custom user mode functions for indexable strips.
 
namespace  lampda::user::default_behaviors
 Define default behavior that are shared between system types.
 

Functions

void lampda::user::button_clicked_default (const uint8_t clicks)
 Called to handle button click events for default user mode behaviors.
 
void lampda::user::button_hold_default (const uint8_t nbClickAndHold, const bool isEndOfHoldEvent, const uint32_t holdDuration)
 Called to handle button click+hold events for user mode behaviors.
 
void lampda::user::power_on_sequence ()
 Called when the system powers on (must be non blocking function!)
 
void lampda::user::power_off_sequence ()
 Called when the system powers off (must be non blocking function!)
 
void lampda::user::brightness_update (const lampda::brightness_t brightness)
 Called when the system changes the LED strip brightness.
 
void lampda::user::sunset_timer_update (const float progress)
 Called when the sunset timer progresses [0; 1].
 
void lampda::user::write_parameters ()
 Called when system wants to write parameters to filesystem.
 
void lampda::user::read_parameters ()
 Called when system wants to read parameters from filesystem.
 
bool lampda::user::button_start_click_default (const uint8_t clicks)
 Called to handle button click on lamp start.
 
bool lampda::user::button_start_hold_default (const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
 Called to handle button hold on lamp start.
 
bool lampda::user::button_clicked_usermode (const uint8_t nbClick)
 Called to handle button click events if "usermode UI" is active.
 
bool lampda::user::button_hold_usermode (const uint8_t nbClickAndHold, const bool isEndOfHoldEvent, const uint32_t holdDuration)
 Called to handle button click+hold events if "usermode UI" is on.
 
void lampda::user::loop ()
 Called at each tick of the main loop.
 
bool lampda::user::should_spawn_thread ()
 Determine if a second user_thread() loop thread should be spawned.
 
void lampda::user::user_thread ()
 Called at each tick of the secondary thread.
 
bool lampda::user::default_behaviors::button_clicked (const uint8_t clicks)
 must be called by the lampda::user::button_clicked_default
 
bool lampda::user::default_behaviors::button_hold (const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
 must be called by the lampda::user::button_hold_default
 
void lampda::user::default_behaviors::__private_elk::handle_brigthness_control (const uint8_t requiredBrigthness)
 handle the brightness command
 
void lampda::user::default_behaviors::__private_elk::handle_on_off_command (const bool shouldBeOn)
 handle the On or Off command
 
void lampda::user::default_behaviors::__private_elk::handle_speed_command (const uint8_t speed)
 Handle the speed command.
 
bool lampda::user::default_behaviors::handle_elk_command (const utils::ELK::Package &elkControlCommand)
 

Detailed Description

Define the default behavior of a lamp.

Function Documentation

◆ handle_speed_command()

void lampda::user::default_behaviors::__private_elk::handle_speed_command ( const uint8_t  speed)

Handle the speed command.

Parameters
[in]speed0-255 speed