Expand description
§Boppo WASM Activity API for Rust
Activities are compiled to WASM and run on the Boppo tablet.
§Getting Started
To get started developing on Boppo read our developer documentation with instructions to clone our template repository.
The main entry point is init_and_run_async.
§Lights
For setting the color of lights see the set_color and similar functions on
Button, Buttons, and Lights.
By default all changes are immediately flushed to the hardware. If you want
to make multiple changes in a row and performance matters you can use
Framebuffer or modify the auto flush behavior using MainFramebuffer.
Each Boppo button has 4 LED lights which are represented by LightDir.
For drawing and animating simple shapes treating the entire Boppo surface as
a display see lights_plane.
§Button Events
You can receive button change events as an async stream using
ButtonEvents.
You can also query the current state of the buttons using
Button::is_pressed and Buttons::currently_pressed.
You can use Button::wait_for_press and Button::wait_for_release to
wait for a button to be in a specific state.
§Audio
Play audio using audio::play or the audio::play_* helper functions.
§Guidelines
See Boppo’s Activity Guidelines for guidelines on creating great activities.
Modules§
- audio
- Audio playback and control for Boppo activities.
- color
- Color constants and functions
- commands
- Commands for controlling the Boppo device.
- executor
- An async executor for activities
- internal
- Items internal to the WASM framework or used to initialize it.
- interpolation
- Utilities for interpolation between two values.
- language
- Obtain the current system language with
system_language() - lights_
plane - Utilities based on laying out the button lights on a cartesian plane.
- log
- A lightweight logging facade.
- update_
loop - Provides the
Updatabletrait for calling a function at a fixed interval.
Structs§
- Button
Event - A notification that a top button has been pressed or released
- Button
Events - A stream of top button press and release events.
- Buttons
- A selection of multiple
Buttons. - Framebuffer
- On “off-screen” buffer storing a color for each light on the tablet.
- Lights
- A selection of button lights on the tablet. There are 10 buttons with 4 lights each for a total of 40 lights.
- Main
Framebuffer - The colors that are displaying on the button lights or will be displayed after the next flush. All light color changes in this crate go through this Framebuffer.
- Short
Duration - An unsigned duration with millisecond precision.
Enums§
- Button
- One of the 10 top buttons.
- Column
- A column of
Buttons. When the side buttons face the user,Column::C0is the leftmost column, andColumn::C4is the rightmost column. - Easing
- An
Easingfunction affects how a value transitions (from 0.0 to 1.0) - Error
- Error type returned by Boppo host API calls.
- Light
Dir - The directions lights are positioned around the buttons.
- Row
- A row of
Buttons.
Functions§
- init_
and_ run_ async - Initializes the Boppo WASM runtime and runs an async activity function.