Skip to main content

Crate boppo_core

Crate boppo_core 

Source
Expand description

The core APIs for creating activities for Boppo shared across different environments.

§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

Provides SoundInstruction and SoundBuilder for creating sounds. Playing those sounds is environment-dependent.

§Guidelines

See Boppo’s Activity Guidelines for guidelines on creating great activities.

Re-exports§

pub use log;

Modules§

audio
Audio playback utilities.
color
Color constants and functions
executor
An async executor for activities
internal
Internal module for device and framework implementers.
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.
update_loop
Provides the Updatable trait for calling a function at a fixed interval.

Structs§

ButtonEvent
A notification that a top button has been pressed or released
ButtonEvents
A stream of top button press and release events.
Buttons
A selection of multiple Buttons.
Framebuffer
An “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.
MainFramebuffer
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.
ShortDuration
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::C0 is the leftmost column, and Column::C4 is the rightmost column.
Easing
An Easing function affects how a value transitions (from 0.0 to 1.0)
LightDir
The directions lights are positioned around the buttons.
Row
A row of Buttons.