PadAnimator
#include "crosspad/pad/PadAnimator.hpp"Generated from crosspad/pad/PadAnimator.hpp in crosspad-core. Edit the header’s doxygen comments to change this page.
Recipes that use it: Pads and LEDs
Functions
Section titled “Functions”getPadAnimator
Section titled “getPadAnimator”PadAnimator & getPadAnimator()Platform-injected singleton accessor.
Used in Pads and LEDs.
Declared in crosspad/pad/PadAnimator.hpp:93.
crosspad::PadAnimator
Section titled “crosspad::PadAnimator”Portable pad LED animator for progress bars, success/error/boot animations.
Uses ILedStrip and IClock — no ESP-IDF dependencies. The platform glue creates the instance and wires the animation-state callback so PadLedController knows when to suppress normal LED updates.
Used in Pads and LEDs.
| Field | Type | Description |
|---|---|---|
kPadCount | constexpr uint8_t |
Members
| Member | Description |
|---|---|
PadAnimator | |
init | Platform only The platform calls it once at start-up (crosspad_platform_init). |
update | Platform only PadManager::update() calls it. |
isActive | |
startProgress | |
setProgress | |
showFrame | |
playSuccess | |
playError | |
playBootAnim | |
startCharging | |
setChargePercent | |
setChargingActive | |
stop | |
setCompletionCallback | |
setAnimationStateCallback |
Methods
PadAnimator
Section titled “PadAnimator”PadAnimator() = defaultPlatform only The platform calls it once at start-up (crosspad_platform_init).
void init(ILedStrip &strip, IClock &clock)update
Section titled “update”Platform only PadManager::update() calls it.
void update()isActive
Section titled “isActive”bool isActive() constUsed in Pads and LEDs.
startProgress
Section titled “startProgress”void startProgress(RgbColor color=RgbColor(208, 240, 9))setProgress
Section titled “setProgress”void setProgress(float progress)showFrame
Section titled “showFrame”void showFrame(const RgbColor(&colors)[kPadCount])Used in Pads and LEDs.
playSuccess
Section titled “playSuccess”void playSuccess(uint32_t fadeMs=800)playError
Section titled “playError”void playError(uint32_t holdMs=2000)playBootAnim
Section titled “playBootAnim”void playBootAnim(uint32_t durationMs=600)startCharging
Section titled “startCharging”void startCharging(float soc=0.0f)setChargePercent
Section titled “setChargePercent”void setChargePercent(float soc)setChargingActive
Section titled “setChargingActive”void setChargingActive(bool active)void stop()Used in Pads and LEDs.
setCompletionCallback
Section titled “setCompletionCallback”void setCompletionCallback(CompletionCallback cb)setAnimationStateCallback
Section titled “setAnimationStateCallback”void setAnimationStateCallback(AnimationStateCallback cb)Declared in crosspad/pad/PadAnimator.hpp:16.