Skip to content

Repository files navigation

Reactive Rust GUI framework being built for embedded systems usage in mind


rsact is at a such early stage where everything is clumsy and messy, there's a lot of work to do, refactor, re-imagine and document. Though I hope the core idea works and will grow into "something".

Intro

rsact is a GUI framework targeting embedded systems. It is based on fine-grained reactivity system, hence the name.

The project consist of these parts:

  • rsact_reactive fine-grained reactivity framework.
  • rsact_ui the core of UI framework.
  • rsact_tiny_icons tuned pre-rendered icons targeting tiny sizes.
  • rsact_macros proc macros used both for rsact_ui and rsact_reactive.
  • rsact_encoder (planned) widgets specific for platforms with encoder+button control.
  • rsact_widgets (planned) high-level widget kinds such as drop-down list, menus, etc.

Setup

To use rsact you need a heap, embedded-alloc can be used in no_std environments. Heap usage depends on your screen size, rsact-ui needs at least a single buffer to render to, though embedded-graphics BinaryColor is optimized and packed by groups of 8 into single byte. It will possibly change in future if I add feature to pre-allocate buffer by users wherever they want. Heap usage also depends on amount of data stored in reactive system, so be carryful with what you put into Signals and Memos. At the moment I have tested rsact only on STM32F412RET6 running at 100MHz with SPI displays ST7789 240x135 and ST7735 160x80, got around 30FPS and 85FPS respectively.

Target support

rsact-ui builds for thumbv7m-none-eabi (Cortex-M3, e.g. STM32F103 "Blue Pill") and above out of the box — pick a reactive-storage backend and a render backend, e.g.:

cargo build -p rsact-ui --no-default-features \
  --features unsafe-single-thread,embedded-graphics,libm --target thumbv7m-none-eabi

(libm is rsact-ui's default math backend; --no-default-features drops it, so re-add libm — or micromath — explicitly. See docs/features.md.)

thumbv6m (Cortex-M0/M0+) note. These cores have no atomic compare-and-swap, which the font-id counter needs. rsact-ui uses portable-atomic, so your final binary must select one of its fallbacks (rsact itself does no feature wiring for this):

  • Sound, via feature unification — add to your binary's Cargo.toml:

    portable-atomic = { version = "1", features = ["critical-section"] }

    (needs a critical-section implementation from your HAL, same as rsact-reactive's single-thread backend).

  • Unsafe but zero-cost, if you are genuinely single-core with no atomic access from interrupts — set in .cargo/config.toml or RUSTFLAGS:

    --cfg portable_atomic_unsafe_assume_single_core

thumbv6m is currently only a compile-check target for rsact (no RAM/flash budgets committed); the floor pair with budgets is Blue Pill (thumbv7m) and Black Pill F401 (thumbv7em-hf).

Development

Framework metrics (reactive node counts, heap, allocs/frame, layout counters, target section sizes) are tracked by the metrics-probe tool — see metrics/README.md and docs/features.md. To auto-record a snapshot on every commit (background, non-blocking), enable the hook once: cargo run -p metrics-probe -- hook-install.

About

GUI framework for embedded Rust powered with fine-grained reactivity

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages