|
Lamp-Da 0.1
A compact lantern project
|
Contains code handling custom user mode functions for indexable strips. More...
Namespaces | |
| namespace | custom |
| Custom user mode groups. | |
| namespace | default_behaviors |
| Define default behavior that are shared between system types. | |
Typedefs | |
| using | ManagerTy = modes::ManagerForHiddenGroups< #ifdef NUDZ_MODES_ENABLED 1, #else 2, #endif modes::FixedModes, modes::legacy::CalmModes, modes::legacy::PartyModes, modes::legacy::SoundModes, custom::NudzModes, modes::bluetooth::BluetoothModes > |
Functions | |
| void | button_clicked_default (const uint8_t clicks) |
| Called to handle button click events for default user mode behaviors. | |
| void | 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 | power_on_sequence () |
| Called when the system powers on (must be non blocking function!) | |
| void | power_off_sequence () |
| Called when the system powers off (must be non blocking function!) | |
| void | brightness_update (const lampda::brightness_t brightness) |
| Called when the system changes the LED strip brightness. | |
| void | sunset_timer_update (const float progress) |
| Called when the sunset timer progresses [0; 1]. | |
| void | write_parameters () |
| Called when system wants to write parameters to filesystem. | |
| void | read_parameters () |
| Called when system wants to read parameters from filesystem. | |
| bool | button_start_click_default (const uint8_t clicks) |
| Called to handle button click on lamp start. | |
| bool | button_start_hold_default (const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration) |
| Called to handle button hold on lamp start. | |
| bool | button_clicked_usermode (const uint8_t nbClick) |
| Called to handle button click events if "usermode UI" is active. | |
| bool | 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 | loop () |
| Called at each tick of the main loop. | |
| bool | should_spawn_thread () |
| Determine if a second user_thread() loop thread should be spawned. | |
| void | user_thread () |
| Called at each tick of the secondary thread. | |
| void | handle_elk_command (const utils::ELK::Package &elkControlCommand) |
| Handle a ELK BLE package. | |
| void | set_color (const uint8_t color) |
| static auto | get_context () |
| static auto | get_context () |
Variables | |
| constexpr uint8_t | minBrightness = 13 |
| static platform::gpio::DigitalPin | WhiteColorPin (platform::gpio::DigitalPin::GPIO::gpio6) |
| static platform::gpio::DigitalPin | YellowColorPin (platform::gpio::DigitalPin::GPIO::gpio7) |
| constexpr uint32_t | colorKey = utils::hash("color") |
| uint8_t | currentColor = 0 |
| uint8_t | lastColor = 0 |
| static uint8_t | currentBrightness = 0 |
Contains code handling custom user mode functions for indexable strips.
Add the nudz mode the compilation.
| void lampda::user::brightness_update | ( | const brightness_t | brightness | ) |
Called when the system changes the LED strip brightness.
| [in] | brightness | The brightness value set by the system |
| void lampda::user::button_clicked_default | ( | const uint8_t | clicks | ) |
Called to handle button click events for default user mode behaviors.
| [in] | clicks | The number of clicks made by the user |
| bool lampda::user::button_clicked_usermode | ( | const uint8_t | nbClick | ) |
Called to handle button click events if "usermode UI" is active.
| [in] | nbClick | The number of clicks made by the user |
| 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.
Default behavior is the "default UI" navigation mode, that supports:
Event 1H/2H (brightness) is handled by button_hold_callback() in behavior.h
| [in] | nbClickAndHold | The number of clicks made by the user |
| [in] | isEndOfHoldEvent | True if the user just released the button |
| [in] | holdDuration | The duration of the on-going held event |
isEndOfHoldEvent is True, then holdDuration is zero | 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.
| [in] | nbClickAndHold | The number of clicks made by the user |
| [in] | isEndOfHoldEvent | True if the user just released the button |
| [in] | holdDuration | The duration of the on-going hold event |
isEndOfHoldEvent is True, then holdDuration is zero | bool lampda::user::button_start_click_default | ( | const uint8_t | clicks | ) |
Called to handle button click on lamp start.
| [in] | clicks | The number of clicks made by the user |
| 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.
| [in] | clicks | The number of clicks made by the user |
| [in] | isEndOfHoldEvent | True if the user just released the button |
| [in] | holdDuration | The duration of the on-going held event |
isEndOfHoldEvent is True, then holdDuration is zero | void lampda::user::handle_elk_command | ( | const utils::ELK::Package & | elkControlCommand | ) |
Handle a ELK BLE package.
| [in] | elkControlCommand |
| void lampda::user::loop | ( | ) |
Called at each tick of the main loop.
By default, dispatched to modes::BasicMode::loop()
| bool lampda::user::should_spawn_thread | ( | ) |
Determine if a second user_thread() loop thread should be spawned.
The thread is needed to update the strip, so non negociable.
| void lampda::user::user_thread | ( | ) |
Called at each tick of the secondary thread.