Introduction
This project defines WASI APIs for embedded devices with the aim of providing common language and platform independent runtimes for embedded use, allowing applications to be abstract from platforms, supporting dynamic discovery and hot reloading of applications, and making it easy to design / share / mess with embedded things.
The WASI APIs are intended to span from basic peripheral drivers like SPI and I2C, to more complex functionality like driving LEDs or displays and publishing or subscribing to data. Everything one could need to write unreasonably portable embedded applications.
The project provides an API specification with runtimes to support the execution of this and Hardware Abstraction Layers (HALs) for application development. To get started using embedded-wasm, grab the relevant components and/or check out the Getting Started section.
You might also be interested in the chat and project meta issue.
Components
Specification
The embedded-wasm/spec project provides the witx
API specification as well as helper abstractions for platform implementations and standard tests for HAL/runtime interoperability.
Runtimes
wasm-embedded-rt
An embedded-wasm runtime for execution on linux / macOS / windows, wrapping specific runtime implementations to provide a ready-to-go binary. This supports mocking on all platforms, with physical hardware access only on linux (for now?).
You can install this with cargo install wasm-embedded-rt
or grab a binary from the releases page.
wasm-embedded-rt-wasmtime
A Rust/wasmtime based engine for application use, built into wasm-embedded-rt
with the rt_wasmtime
feature.
Typically you'll want to embed this library in your project, either as a git submodule or by copying out the lib
directory.
wasm-embedded-rt-wasm3
A C/wasm3 based engine designed for embedding, built into wasm-embedded-rt-wasm3
with the rt_wasm3
feature.
Typically you'll want to embed this library in your project, either as a cargo dependency, git submodule or by copying out the relevant directories (note for C use you will also need headers from embedded-wasm/spec
).
Hardware Abstraction Layers (HALs)
Rust
Rust bindings based on embedded-hal.
Add this to your project with cargo add wasm-embedded-hal
.
AssemblyScript
Bindings for AssemblyScript, compiled with asc
.
Add this to your project with npm install --save wasm-embedded-hal
.
Tools
wasm-embedded-cli
WIP: A command line interface for interacting with embedded-wasm capable devices.