โจ Bootsplash โ
The bootsplash crate provides a focused startup animation layer around the graphics manager and LVGL objects.
Role โ
- Owns creation and teardown of the boot logo animation sequence.
- Encapsulates the startup-only animation policy so initialization code does not manipulate LVGL animation internals directly.
Boundaries โ
- In scope: logo object setup, animation callback wiring, animation lifetime management.
- Out of scope: window/session management, general UI composition, or reusable animation framework APIs.
Internal structure โ
lib.rs:Bootsplashstate (lv_anim_t+Logo) and lifecycle methods.error.rs: crate-local error type mapped from graphics failures.- One
unsafe extern "C"callback (load_animation_callback) updates part opacity across logo children.
Runtime interaction โ
Bootsplash::newacquiresgraphics::Managerlock.- It uses current screen geometry to compute
Logo::get_factor(...)and instantiate logo. - It initializes
lv_anim_t(duration, reverse timing, repeat count) and registers callback. Bootsplash::stopdeletes the animation vialv_anim_deleteunder manager lock.
Dependency model โ
- Internal runtime dependency: ๐ผ๏ธ Graphics only.
- Uses LVGL symbols re-exported through graphics (
lv_anim_*,lv_obj_*).
Failure semantics โ
- Setup failures propagate as crate
Errorduringnew. stopcan fail through graphics lock/manager-level error propagation.
Extension points โ
- Animation timing/profile can be changed centrally in
Bootsplash::new. - Alternate startup visuals can reuse the same lifecycle contract (
new/stop) while changing object composition.
Contract vs implementation โ
- Contract: construct bootsplash with
Bootsplash::new(...), stop it withBootsplash::stop(...). - Current implementation: LVGL opacity animation over 4 logo parts using theme primary color and ease-in-out path.
Limitations and trade-offs โ
- Uses
std::os::raw::c_voidand LVGL callback ABI, so the implementation is intentionally low-level. - Animation is tightly tied to current logo part layout and not exposed as a generic animation graph.