|
Lamp-Da 0.1
A compact lantern project
|
Classes | |
| struct | StateTy |
Static Public Member Functions | |
| static void | loop (auto &ctx) |
| static void | on_enter_mode (auto &ctx) |
| static void | on_exit_mode (auto &ctx) |
| static void | sunset_update (auto &ctx, float progress) |
| static void | brightness_update (auto &ctx, brightness_t brightness) |
| static void | custom_ramp_update (auto &ctx, uint8_t rampValue) |
| static bool | custom_click (auto &ctx, uint8_t nbClick) |
| static bool | custom_hold (auto &ctx, uint8_t nbClickAndHold, bool isEndOfHoldEvent, uint32_t holdDuration) |
| static void | power_on_sequence (auto &ctx) |
| static void | power_off_sequence (auto &ctx) |
| static void | read_parameters (auto &ctx) |
| static void | write_parameters (auto &ctx) |
| static void | user_thread (auto &ctx) |
| static void | brightness_update (auto &ctx, brightness_t brightness) |
| Custom callback when brightness changes (optional) | |
Static Public Attributes | |
| static constexpr bool | hasBrightCallback = false |
| static constexpr bool | hasCustomRamp = false |
| static constexpr bool | hasButtonCustomUI = false |
| static constexpr bool | hasSystemCallbacks = false |
| static constexpr bool | requireUserThread = false |
| static constexpr bool | isGroupManager = false |
| static constexpr bool | hasSunsetAnimation = false |
| Toggles the use of custom BasicMode::sunset_update() callback. | |
| static constexpr uint32_t | storeId = 0 |
| Store identifier for persistent storage (optional) | |
|
inlinestaticinherited |
Custom callback when brightness changes (optional)
Callback active only if BasicMode::hasBrightCallback is True
| [in] | ctx | The current context |
| [in] | brightness | The brightness value set by the system |
|
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:
This value is configurable through user interaction with the button. If you need a persistent value, private to your mode, you can use:
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 :)