|
|
static void | on_enter_mode (auto &ctx) |
| |
|
static void | loop (auto &ctx) |
| |
| static void | on_exit_mode (auto &ctx) |
| | Custom callback when mode goes outside of focus (optional)
|
| |
| static void | sunset_update (auto &ctx, float progress) |
| | Custom callback when sunset mode is updated (optional)
|
| |
| static void | sunrise_update (auto &ctx, float progress) |
| | Custom callback when sunrise mode is updated (optional)
|
| |
| static void | brightness_update (auto &ctx, brightness_t brightness) |
| | Custom callback when brightness changes (optional)
|
| |
| static void | custom_ramp_update (auto &ctx, uint8_t rampValue) |
| | Custom callback when system sets user ramp (optional)
|
| |
|
static uint8_t | get_custom_ramp_default_value (auto &ctx) |
| | Return the custom ramp default value, in case no preset is used.
|
| |
| static bool | custom_click (auto &ctx, uint8_t nbClick) |
| | Custom "usermode" button UI for "click" action (optional)
|
| |
| static bool | custom_hold (auto &ctx, uint8_t nbClickAndHold, bool isEndOfHoldEvent, uint32_t holdDuration) |
| | Custom "usermode" button UI for "click+hold" action (optional)
|
| |
| static void | power_on_sequence (auto &ctx) |
| | Custom callback when the system powers on (optional)
|
| |
| static void | power_off_sequence (auto &ctx) |
| | Custom callback when the system powers off (optional)
|
| |
| static void | read_parameters (auto &ctx) |
| | Custom callback to read parameters from filesystem (optional)
|
| |
| static void | write_parameters (auto &ctx) |
| | Custom callback to write parameters to filesystem (optional)
|
| |
| static void | user_thread (auto &ctx) |
| | Custom secondary loop, executed in another thread (optional)
|
| |
|
|
static constexpr bool | hasCustomRamp = true |
| | hint manager to save our custom ramp
|
| |
|
static constexpr bool | hasSunsetAnimation = true |
| | sunset & sunrise animation on the fixed modes
|
| |
|
static constexpr bool | hasSunriseAnimation = true |
| |
|
static constexpr bool | usesSunsetGravityDissolveMode = true |
| |
|
static constexpr bool | usesSunriseGravityAppearMode = true |
| |
|
static constexpr bool | isGroupManager = false |
| |
|
static constexpr bool | hasBrightCallback = false |
| | Toggles the use of custom BasicMode::brightness_update() callback.
|
| |
|
static constexpr bool | hasButtonCustomUI = false |
| | Toggles "usermode" button UI custom_click() and custom_hold()
|
| |
| static constexpr bool | hasSystemCallbacks = false |
| | Toggles advanced system callbacks, see list here .
|
| |
| static constexpr bool | requireUserThread = false |
| | Toggles the use of custom BasicMode::user_thread() callback.
|
| |
| static constexpr uint32_t | storeId = 0 |
| | Store identifier for persistent storage (optional)
|
| |
template<bool isStep = false, uint32_t rampUpdateLenght_ms = 55, bool shouldSaturateRamp = false>
struct lampda::modes::fixed::PaletteMode< isStep, rampUpdateLenght_ms, shouldSaturateRamp >
Single-color mode for indexable strips with palette ramp.
- Parameters
-
| [in] | isStep | Set to false, the palette will be interpolated. Set to true, the colors will step through the palette. |
| constexpr uint32_t lampda::modes::BasicMode::storeId = 0 |
|
staticconstexprinherited |
Store identifier for persistent storage (optional)
By default, all modes are reset upon a shutdown, providing no persistence of their state across several on/off cycles. To expose to the user a way to configure your mode in a persistent fashion, you can use:
static void loop(auto& ctx) {
uint8_t rampValue = ctx.get_active_custom_ramp();
}
static constexpr bool hasCustomRamp
hint manager to save our custom ramp
Definition: fixed_modes.hpp:52
This value is configurable through user interaction with the button. If you need a persistent value, private to your mode, you can use:
static void loop(auto& ctx) {
uint8_t indexValue = ctx.get_active_custom_index();
indexValue += 1;
ctx.set_active_custom_index(indexValue);
}
These are the two always-available persistent state that a mode can configure by default. However, for more advanced modes (like games, with a list of high-scores, for example) more flexibility can be required.
If you need such extended storage, see ContextTy::KeyProxy for usage.
If you don't need these capabilities, just ignore this identifier :)